Why does free() only set the 8 first bytes to zero?
问题 I've a question about free() behavior. Juste a simple code which use malloc and strcpy a char*. So, all is set on the HEAP : (gdb) x/100b 0x602010 0x602010: 66 111 110 106 111 117 114 32 0x602018: 116 111 117 116 32 108 101 32 0x602020: 109 111 110 100 101 0 0 0 0x602028: 0 0 0 0 0 0 0 0 0x602030: 0 0 0 0 0 0 0 0 0x602038: 33 0 0 0 0 0 0 0 When I free the chunk with free(), the result is : (gdb) x/100b 0x602010 0x602010: 0 0 0 0 0 0 0 0 0x602018: 116 111 117 116 32 108 101 32 0x602020: 109