问题
This is more a semantic question than a coding question....
What's the difference between a memory arena and a memory allocator?
I'm working in C++ and I'm seeing some memory management libs using concepts like "memory arena", "memory allocator" and sometimes both in the same lib.
I know what an allocator is; I'm just not sure what a memory arena is if it's not just another word for allocator.
回答1:
"Memory arena" typically means a large lump (or collection of lumps) of memory from which smaller lumps are allocated. The word "pool" is also commonly used for such a thing.
"Memory allocator" typically means the software that determines how to allocate memory from an arena.
回答2:
Strictly speaking, a "memory arena" is a pool of memory that a "memory allocator" allocates memory from. But I wouldn't be surprised to see "memory arena" used as a synonym for "memory allocator".
来源:https://stackoverflow.com/questions/13381123/whats-the-difference-between-a-memory-arena-and-a-memory-allocator