= 0)); 将这些限制总结起来就是: 分配大小限制: 分配的chunk大小小于128K(此时将使用brk拓展堆,否则将使用mmap) 分配的chunk大小应大于被修改后的Top Chunk大小减去 fencepost
heap)); set_head (top (av), (heap->size - sizeof (*heap)) | PREV_INUSE); /* Setup fencepost free the old top chunk with a multiple of MALLOC_ALIGNMENT in size. */ /* The fencepost
prev_heap, prev_heap->size - (MINSIZE-2*SIZE_SZ)); assert(p->size == (0|PREV_INUSE)); /* must be fencepost
(*heap)); set_head(top(av), (heap->size - sizeof(*heap)) | PREV_INUSE); /* Setup fencepost and free the old top chunk. */ /* The fencepost takes at least MINSIZE bytes, because it might Insert a double fencepost at old_top to prevent consolidation with space we don't We need the fencepost, even if old_top otherwise gets lost. */ chunk_at_offset