[comp.sys.mac.programmer] malloc/calloc problem in Think C

kingson@uxh.cso.uiuc.edu (Kingson Gunawan) (01/30/91)

I have a problem with Think C malloc and calloc functions. I am writing a progra
m that iteratively call several functions.  In each of these functions, I alloca
te memory space using either malloc or calloc ( I tried both ) and release the s
pace using free() function just before I return to the main program from the fun
ction.  The problem is that after several iteration the program just quit ( the
system says " application quit unexpectedly").  When I ran the same program in T
hink C debugger I traced the problem coming from the malloc or calloc function.
 The debugger gave "odd address" error.  I know I allocated much more than enoug
h memory for this particular program (about 2meg for a program that take only ab
out 450k memory including the space for the variables, etc.).  Any idea of what
type of problem this might be?