This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
memory allocation problem
- To: gcc at gcc dot gnu dot org
- Subject: memory allocation problem
- From: Jiann-Ming Su <js1 at microwave dot ph dot msstate dot edu>
- Date: Mon, 20 Nov 2000 18:36:35 -0600 (CST)
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