January 21, 2008
Unknown W. Brackets wrote:
> That's a good trick, but it's probably not helpful in this case.  My problem is, I know that I'm going to have 1000 of these objects. There's no reason to allocate each one individually.  Rather I should create a pool for them, and shove the instances into the pool.

In Tango, use GC.sizeOf to tell you the size of the block reserved for the pointer in question, and GC.reserve to pre-allocate a chunk of memory if you have an idea of the high-water mark if your app. GC.reserve is a relatively new addition and can speed up an app tremendously in some cases.


Sean
January 21, 2008
"Sean Kelly" <sean@f4.ca> wrote in message news:fn1l3g$2v3n$1@digitalmars.com...

> GC.reserve is a relatively new addition and can speed up an app tremendously in some cases.

Can't wait for 0.99.5 then ;)  (as you know I'm currently allocating large chunks of memory and then deleting them to fake a reserve operation)


1 2
Next ›   Last »