Boost logo

Boost Users :

Subject: Re: [Boost-users] Memory manager/allocator
From: Daniele Barzotti (daniele.barzotti_at_[hidden])
Date: 2009-06-16 10:08:14


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net