Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!ames!ucsd!swrinde!cs.utexas.edu!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: Memory and PIC Message-ID: <1083.UUL1.3#5129@willett.UUCP> Date: 3 Jun 90 23:08:20 GMT Organization: Latest link in the ForthNet chain. (Pgh, PA) Lines: 31 Date: 05-31-90 (17:27) Number: 406 (Echo) To: ALL Refer#: NONE From: DAVID BREEDING Read: (N/A) Subj: DYNAMIC ALLOCATION Status: PUBLIC MESSAGE Although I consider dynamic allocation to be one of the highest priorities in the new standard, I have yet to read ANYTHING about it. I keep waiting for someone to bring it up, but somehow no one ever does, so I've finally gotten down to writing myself. All of the so called "modern" languages support some form of dynamic allocation within the language itself. This memory can be called from fast ram, cache, or even disk. All of this is transparent to the user. One of the reasons I heard that colleges don't use Forth for teaching is that it leaves out this very thing. I'm not saying that adding DA will make colleges and universities start teaching Forth, but I bet they'll sit up and notice. Now...how to implement it... First, let's keep it simple. Two words, DALLOT and UNALLOT. All this does is return an address of N items and then returns this address to a pool. Most of the work in DA is easily accomplished using ram past HERE, and then feeding the memory back (keeping a linked list of deallocated memory chunks) to HERE after UNALLOT. Any specialized memory management could be handled by the individual system, only the standard words need to be there for the programers. ----- This message came from GEnie via willett through a semi-automated process. Report problems to: uunet!willett!dwp or willett!dwp@hobbes.cert.sei.cmu.edu