[comp.sys.mac.programmer] Cant malloc in think C 4

hagan@ecs.umass.edu (05/03/91)

apologies for the absurdity of this question, i only
a beginning CS major (aka 200 level)

I am programming in think c 4.02 using the ansi library,
and have recently run into some problems with the 
malloc and calloc functions:  They are hanging my macintosh.
To be more specific, in certain functions which use them,
the SECOND time the function is called, my mac hangs on the
malloc/calloc call (literally, i checked it out with the 
think debugger, and it never came back from that instruction).
The first time that these functions are called, no problem. Also
This doesn't affect everything in my program, nor is it consistant
(except when i am debugging). Memory shouldn't be a problem,
as i am only allocating about 8 bytes of memmory at a time,
and have 1 meg for the project, likewise, think c is set at 1.5 megs.
It was suggested for me to typecast the sizeof function:
e.g. (DATATYPE)malloc((size_t)sizeof(DATATYPE));  that didn't
work, either -- it still hung.

my system is a mac plus running system 6.0.5 with 4 megs of ram.

craig hagan     HAGAN@ECS.UMASS.EDU