MiniCRT icon indicating copy to clipboard operation
MiniCRT copied to clipboard

fix next size

Open WellOptimized opened this issue 4 years ago • 0 comments

hi,i find that void* malloc(unsigned size) in malloc.c has a bug.

when we malloc,the memory layout like this: header1,size1,header2,size2. header will take up space and header->size includes header. header1->size > size1

so,next->size = header->size -(size + HEADER_SIZE);

WellOptimized avatar Feb 13 '21 03:02 WellOptimized