byzhang / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

GenericStringBuffer Allocator = MemoryPoolAllocator #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in GenericStringBuffer declaration for template used Allocator = CrtAllocator

in other class declaration used Allocator = MemoryPoolAllocator<>

i am changed this for main stream and code accuracy with defaults

Original issue reported on code.google.com by vodi...@gmail.com on 30 Aug 2013 at 6:23

Attachments:

GoogleCodeExporter commented 9 years ago
This is by intention.
StringBuffer is actually like a std::vector, which expands via Realloc() when 
it is full.

MemoryPoolAllocator cannot free existing allocation blocks, and just allocate 
at the end. So it will waste more memory than CrtAllocator.

Original comment by milo...@gmail.com on 30 Jun 2014 at 1:55