Mail Archives: djgpp/1998/04/05/18:01:36
I've had problems in some of my programs using 'new' which of course
comes out using malloc anyway. I found this out quickly when a lot of
my programs kept crashing and gdb kept saying malloc did it ;)
I don't know if there's a problem with malloc in djgpp or not, but it
certainly doesn't work 100% correctly when I use it. Some of my
programs I spent hours debugging only to find that if I pass a
constant added to a variable to my allocation function (Alloc I called
it, wow pretty original =) malloc works fine, otherwise it doesn't.
For example. I was messing around with a convenient "substring" style
function that I was making. In one part I have:
Alloc(newlen);
This crashes the program after going past it only once or twice.
However if I...
Alloc(100);
It works fine. Similarly:
Alloc(newlen + 100);
works fine as well. !??!?!? I have DJGPP 2.01. Has anyone else had
this problem?
--
/----------------------[nobremski AT hotmail DOT com]----------------------\
( Neil C. Obremski Ashrak DeadEye
)
\-----------------[http://www.nwrain.com/~deadeye/]-----------------/
- Raw text -