HeapBlock doesn't know it's size?


#1

HeapBlock has no size() method. I am guessing that Jules wanted the the footprint of the class to be no different from a regular pointer. But I am keeping a cache of HeapBlock and I return a HeapBlock* from a function that gets an available block from the cache, and the receiving function can’t determine the size of the block.

I suppose I could wrap it in a template but it would be nice if there was a HeapBlockWithSize class.

Or if you think this is all crazy talk then ignore this post, I’m rambling.


#2

You could use a MemoryBlock for that?


#3

Seems like you’re always one step ahead of me!


#4

Can’t beat the master… :smiley: