rtaylor@tron.UUCP (Randy Taylor) (12/04/90)
Subject: Re: Malloc ? I originally posted this directly to the original sender, Glen Hansen, and then I discovered PNews ! Is my inexperience showing !? :-() At any rate, here is the original message from Glen : >From: gah@CML.UNL.EDU (Glen A. Hansen) >Newsgroups: comp.sys.apollo >Subject: Malloc? >Message-ID: <9011271454.AA09035@cml.unl.edu> >Date: 27 Nov 90 14:54:22 GMT >Sender: daemon@ucbvax.BERKELEY.EDU >Organization: The Internet >Lines: 10 >I would like to develop a C program using dynamic memory allocation on a >DN3000 running SR10.2. However, I am unable to locate the alloc.h header >file (or any other containing prototypes for malloc, calloc, and free). >It would be nice to include a prototype for these routines in my code. >Am I overlooking something obvious? >Thanks in advance, >-Glen Hansen And here's my reply : I could not find a reference for malloc,calloc, or free in /usr/include or in bsd4.3/usr/include (sys5 also). One of our programming aces said that in 9.7 it was in stdio.h but she's lost track of it since then. I have written some programs that use dynamic allocation and I have some warnings for you. 1) The 6.7 version of the C compiler *is not* the most robust compiler I've seen from Apollo. We have really good programmers occaisionally tearing out their hair because their compiled routines may run on one machine, but will not run on a different, but identically configured machine. 2) My routines suffer from "illegal address" errors from time to time, and I've been able to troubleshoot it down to problems in RAM allocation. If a machine has about 10 processes running and I fire up my program, it fails in my malloc routine with an "illegal address" error. When I sigp or kill a process or two, my program runs fine - hence my belief that the v6.7 C compiler does not seem to map available RAM very well. It always wants to start dynamic allocation at the same address, regardless of whether or not it is in use. 3) (1) & (2) above hold true in SR10.1, I can't speak for SR10.2, we'll be leapfrogging 10.2 for 10.3 in the near future. However, the v6.7 C compiler is used in 10.3, so it must be in 10.2 also. v6.8 does not have a release date. Hope this helps. Randy Taylor ------------------------------------------------------------------------------ rtaylor@sky00.bwi.wec.com "Open the pod bay doors please HAL" rtaylor@tron.bwi.wec.com David Bowman -- Dave Kerr (301) 765-4453 (WIN)765-4453 tron::kerr Internal WEC vax mail kerr@tron.bwi.wec.com from an Internet site kerr@tron.UUCP from a smart uucp mailer
paul@CAEN.ENGIN.UMICH.EDU (Paul Killey) (12/04/90)
rtaylor%tron.uucp@uunet.uu.net writes: >2) My routines suffer from "illegal address" errors from time to time ... Under version 10.2.0.4, we have seen programs die with a tb showing bad heap, or corrupted heap, or some such. It is a sporadic problem. It seems to happen in a child process right after a fork.