memory allocation problem
Jiann-Ming Su
js1@microwave.ph.msstate.edu
Mon Nov 20 16:36:00 GMT 2000
I'm using egcs-2.91.66 with glibc-2.1.2. In my c++ code, I call
new to allocate 60 bytes of memory. It returns a pointer to 0x806b5f0.
Before freeing that buffer, I ask for 62 more bytes. I get a pointer
to 0x806b630. It's pretty clear that 630(hex) minus 5f0 equals 40.
It's pretty clear what happens next. I delete 0x806b5f0. The program
then seg faults when it tries to delete 0x806b630. I'm running Linux
2.2.16 on Intel platform. Anybody else experiencing this type of
problem? Thanks for any help.
--
Jiann-Ming Su, js1@microwave.ph.msstate.edu
More information about the Gcc
mailing list