From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,f5509e59beedd6b,start X-Google-Attributes: gid1164f8,public From: jdevlin Subject: comp.sys.dec Date: 1998/05/30 Message-ID: #1/1 X-Deja-AN: 358132812 Organization: University of Southern California, Los Angeles, CA Newsgroups: comp.sys.dec When I use malloc() within a function, the memory allocated byt the call is being reused -- as if it was returned to the heap despite the fact that I haven't free()'d it. The malloc() man page says that this is precisely the behavior you'd expect of alloca() when the alloca.h file is included. Apparently this function allocates space from the stack area which presumably gets popped off as the function exits. So for some reason or other malloc() is behaving like alloca() when it shouldn't be (as far as I can tell). I want space allocated from the heap and not returned to it until I free() it. Can anyone suggest either what I'm doing wrong or how I can change this behavior? As far as I can tell malloc() has not been setup as a macro for alloca(). In addition, the behavior goes away when the code is run in dxladebug without modifications. Any help would be appreicated. The code was compiled using /bin/cc on a Dec Alpha: uname -a = "OSF1 bravo.lang.psyc.bbk.ac.uk V4.0 878 alpha" - Joe ************************************************************************* Joseph Devlin, PhD * Center for Speech and Language * email: j.devlin@psyc.bbk.ac.uk Birkbeck College * London WC1E 7HX * "The axon doesn't think. Phone: 0171-631-6325 * It just ax." George Bishop Fax: 0171-631-6587 * *************************************************************************