Closed bogdanm closed 9 years ago
@autopulated , @0xc0170 , I know you hate me by now, but I can't help it :) I plan to allocate stuff from MINAR on top of this extendable thing, but other than that it is absolutely general purpose. Also, does anybody have any good pointers about how to test if some piece of code is truly reentrant?
OK, I've changed the memory layout and hopefully made the code easier to read. I'm still waiting for comments on the race condition, I'm curious if you're thinking of a fairly pathological case or something simpler that I didn't take into account.
@autopulated , does the latest commit look like it'd made race conditions less likely ?
Yeah that looks better
OK, I'm going to wait a bit more for comments, then merge this.
The extendable pool allocator behaves like a pool allocator (can only allocate elements of a certain size), but can extend itself automatically when it runs out of memory by calling 'mbed_ualloc' to get space for another pool. The implementation is designed to be reentrant and to minimize the time spent in critical sections.