Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!udel!mmdf From: AXDRW%ALASKA.BITNET@cunyvm.cuny.edu (Don R. Withey) Newsgroups: comp.sys.amiga Subject: Re: File Requester Library Message-ID: <15151@louie.udel.EDU> Date: 10 May 89 23:54:49 GMT Sender: mmdf@udel.EDU Lines: 45 > From: Rob Peck on Date: 10 May 89 16:30:37 GMT > > Brian Rhodefer responded directly via email to my earlier posting: >> >> In article <6374@ardent.UUCP> you write: >> >"malloc" could be used to allocate these buffers in the first place Yup bad idea... >> Are you referring, perhaps, to Manx' "malloc"? It seems this way >> because Manx' malloc has this property of "auto-releasing". It also probably won't work with Lattice startup/exit code, stick with the system functions. >> > Yes, I was referring to either Manx or Lattice 'malloc', but not having > the source to the libs, would not have been aware that the code was not > re-entrant. Would assume, however, that if I re-propose that malloc > be used if and only if surrounded with a Forbid/Permit pair, that might > solve the problem? Maybe I better find someone that has the source and > be sure. Manx malloc uses global variables? Can anyone expand on this? > Why would malloc not be useable in shared library code? Anyway, thanks > Brian, for responding. May save someone else from a problem. > It would be better to use AllocRemember and attach the remember list to your task structure, this way when your task goes away, the system will automatically deallocate the memory. I'm not too sure about the details, but I know that CreateTask does something like this with the stack it allocates for your task, so that when you RemTask yourself, the stack goes away automatically. This seems like the way to go, I assume that since CreateTask is a support library routine in Amiga.lib, and RemTask lives in the Exec.library that what CreateTask does is legal to do elsewhere. [...feeder fodder deleted] > Rob Peck Don ------------------------------------------------------------- Snail Mail: Don R. Withey, 3700 East 65th Ave, Anch, AK 99507 Phone: 907-786-1074 (work), 907-344-4057 (home) Email: Bitnet: axdrw@alaska.bitnet BIX: dwithey University of AK Anch, Computing & Technology Services (CATS ;-) -------------------------------------------------------------