In Linux, is there a library that takes a large block of memory (e.g. a megabyte returned from malloc), and then carries out allocations and frees from within that larger block? I sometimes work with games consoles whose SDKs come with similar functions, but I can't find anything like that for Linux.
I don't want a fixed-size pool allocator; the allocation requests will not all be the same size.
It's easy enough to write a naive one (e.g. the K&R C book has an example of a first-fit), but I doubt I'm the first person to want to do so.