(点击上方蓝字,快速关注我们)作者: wklken如有好文章投稿,请点击 → 这里了解详情Python 的内存分配策略arenaarena: 多个pool聚合的结果arena sizepool的大小默认值位4KBarena的大小默认值256KB, 能放置 256/4=64 个poolobmalloc.c中代码#define ARENA_SIZE (256 arena 结构一个完整的arena = arena_object + pool集合typedef uchar block; /* Record keeping for arenas. */struct arena_object { /* The address of the arena, as returned by malloc. Note that 0 * will never be returned by a successful malloc, and is used * here to mark an arena_object that doesn't correspond to an * allocated arena. */ uptr address; /* Pool-aligned pointer to the next pool to be carved off. */ block* pool_address; /* The number of available pools
………………………………