This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

memory allocation problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]