== Quote from bearophile ([email protected])'s article
> dsimcha:
> > Since this is such a rare case in practice,<
> I don't think this is a so uncommon case, I use something similar for my
> memory
pools.
Why not dynamic arrays? Wouldn't it make more sense to do:
class MemoryPool {
// other stuff
uint[] memory;
this() {
memory = new uint[someHugeNumber];
}
}
This would have negligible additional overhead and would allow you to change the
size of the memory pool at runtime. I personally find that I almost never use
static arrays, either on the stack or inside heap-allocated objects because the
fact that their size is fixed at compile time is just too restrictive. About my
only use for them is to store compile-time constants in the static data segment.