
Hi, I'm sorry if the question goes in OT. I'm searching for a simple cross platform memory manager/allocator library/class to simply allocate/read/write blocks of memory. I googled around and I found some projects: http://code.google.com/p/stdext/ http://memory-mgr.sourceforge.net/ there is also boost.interprocess but I don't need its complexity. I'd like to know if there is a well-known and used one. Thanks in advance. Daniele.

I'm sorry if the question goes in OT. I'm searching for a simple cross platform memory manager/allocator library/class to simply allocate/read/write blocks of memory. I googled around and I found some projects:
http://code.google.com/p/stdext/ http://memory-mgr.sourceforge.net/
there is also boost.interprocess but I don't need its complexity. I'd like to know if there is a well-known and used one.
There's a memory-pool library in boost: http://www.boost.org/doc/libs/1_39_0/libs/pool/doc/index.html

Igor R ha scritto:
There's a memory-pool library in boost: http://www.boost.org/doc/libs/1_39_0/libs/pool/doc/index.html
Thanks Igor, I didn't seen it! :-P I profit by you to ask a question.. Here (http://xushiwei.com/gc-allocator#toc7) there are timing comparison between some allocators.. You know why there is a so big difference between Linux and Win32 implementations for boost::pool? (if this timing are says the truth) Thanks, Daniele.

You know why there is a so big difference between Linux and Win32 implementations for boost::pool? (if this timing are says the truth)
Where do you see a big difference? From the 2 pictures that I can see, the measurement for "BoostPool" is ~7ms, and for "BoostObjectPool" is ~13 -- on both pictures. Do I miss something?

Igor R ha scritto:
You know why there is a so big difference between Linux and Win32 implementations for boost::pool? (if this timing are says the truth)
Where do you see a big difference? From the 2 pictures that I can see, the measurement for "BoostPool" is ~7ms, and for "BoostObjectPool" is ~13 -- on both pictures. Do I miss something?
Never mind, it's my fault! I'm very sorry! I didn't seen that the two Y scale are different!! I've take a look to boost::pool, tell me if I understand well. I have to allocate contiguous memory to store a recorded audio samples. So, is legal to do something like this: //Allocate chunks of 65535 bytes boost::pool<> p(65535); //Allocate 100*65535 bytes of contiguous chunks void * pMem = p.ordered_malloc(100) Now, assumes that I have a function like: void MyMemoryObj::Write(long pData, long byte_to_write) { // In windows I write the data pointed to pData into the buffer with: RtlMoveMemory pMem, pData, byte_to_write } Is there a way to copy memory in boost? Thanks, Daniele.

I've take a look to boost::pool, tell me if I understand well.
Unfortunately, I never used it myself, so I'm afraid I can't enlighten you more than the library reference.
void MyMemoryObj::Write(long pData, long byte_to_write) { // In windows I write the data pointed to pData into the buffer with: RtlMoveMemory pMem, pData, byte_to_write }
Is there a way to copy memory in boost?
Why boost? It's just std::copy() Or if you insist on working with plain C pointers, instead of c++ iterators, then use plain C memcpy()

Igor R ha scritto:
I've take a look to boost::pool, tell me if I understand well.
Unfortunately, I never used it myself, so I'm afraid I can't enlighten you more than the library reference.
Ok, no worries. I'll simply try!
void MyMemoryObj::Write(long pData, long byte_to_write) { // In windows I write the data pointed to pData into the buffer with: RtlMoveMemory pMem, pData, byte_to_write }
Is there a way to copy memory in boost?
Why boost? It's just std::copy() Or if you insist on working with plain C pointers, instead of c++ iterators, then use plain C memcpy()
Ehehe...My 'STL use' is a little bit rusty and sometimes I forgot that I have a simply solution in the hand! Thanks Igor! Daniele.

You might also be interested in the high-performance tcmalloc,
which I think is open sourced by Google.
http://code.google.com/p/google-perftools/
Chris
On Tue, Jun 16, 2009 at 6:02 AM, Daniele
Barzotti
Hi,
I'm sorry if the question goes in OT. I'm searching for a simple cross platform memory manager/allocator library/class to simply allocate/read/write blocks of memory. I googled around and I found some projects:
http://code.google.com/p/stdext/ http://memory-mgr.sourceforge.net/
there is also boost.interprocess but I don't need its complexity. I'd like to know if there is a well-known and used one.
Thanks in advance. Daniele. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Chris Uzdavinis ha scritto:
You might also be interested in the high-performance tcmalloc, which I think is open sourced by Google.
http://code.google.com/p/google-perftools/
Chris
Thanks Chris, I'll take a look! Daniele.
participants (3)
-
Chris Uzdavinis
-
Daniele Barzotti
-
Igor R