Subject: Re: [boost] [Countertree + Suballocator] New Version
From: Francisco José Tapia (fjtapia_at_[hidden])
Date: 2012-04-14 13:43:32
I am not theoretical. To write code is my hobby , not my work. And after my
work and my family, in my free time , I like to think about algorithms and
to write them.
I would know all the details about the GCC std::allocator ( named
new_allocator) examining the code, but I have not time.I don't know what
must do a pool allocator and how manage the memory.
I like the simple and economical things, and the suballocator is designed
according this. When the suballocator don't need a chuck of memory, return
it to the allocator for to be used by other data structure or, if the
allocator return the memory to the Operating System, to be used by other
I only know the results as you can see in the benchmark graphs, where all
is explained (
According my information ( perhaps I am wrong). In the boost library you
have two allocators : boost::pool_allocator and boost::fast_pool_allocator.
The first fail when must allocate 50.000.000 elements because the time was
excessive. The second is fast, an excelent allocator, but have problems
with the memory. If you allocate many elements and check the memory used,
deallocate all the elements and check the memory again, you can see it is
using the same amount of memory
The suballocator have several advantages compared with the
a) It is a byte faster. (This is the less important question)
b) The allocator can be used with any allocator. If you have an allocator
for share memory , you can't use the fast_pool_allocator
c) If in your program you are using a fast_pool_allocator,and in a moment
have a peak of work, the memory used by the program grows. But when the
work return to low level, the program continues using the same amount of
memory. If you use a suballocator, probably the memory used by the program
I don't know the categories where can be included the suballocator. When I
study in the Engineer School, They teached me "if somethig run... RUN",
this is the important question, not the name.