所以我想用sbrk()系统调用来实现我自己的malloc。这里的问题是,当我试图分配动态内存时,sbrk()和malloc()返回不同的不连续地址。("\nsbrk(0) %llu ",(unsigned long long)sbrk(0)); printf("\nmalloc(8) %llu ",(unsigned lo
代码示例(foo.c) int *x=(int*)malloc(sizeof(int)); // break here free(x);Breakpoint 1, main () at src.c:7Breakpoint 2 at 0x550944Program exited我的系统规范是:
gcc: gcc (GCC) 4.1.2 20080704 (红帽4