Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site cbosgd.UUCP Path: utzoo!linus!decvax!harpo!floyd!vax135!ariel!hou5f!hou5g!hou5h!eagle!mhuxl!houxm!ihnp4!cbosgd!mark From: mark@cbosgd.UUCP Newsgroups: net.micro,net.micro.apple Subject: Re: Followup to 'In Defense of Apple Pascal' Message-ID: <557@cbosgd.UUCP> Date: Mon, 7-Nov-83 22:38:19 EST Article-I.D.: cbosgd.557 Posted: Mon Nov 7 22:38:19 1983 Date-Received: Wed, 9-Nov-83 05:21:40 EST References: <709@ihuxl.UUCP> Organization: AT&T Bell Laboratories, Columbus Lines: 13 The mark and release functions of Apple Pascal are straight out of UCSD Pascal, which in turn our straight out of the P2 compiler. They are no substitute for dispose, but are sufficient to implement the compiler (and, indeed, are more convenient for it than dispose). Basically, the heap is treated as a stack (allocated from the other end of memory). A pointer is kept to the top of the stack (e.g. next available place to allocate). new grabs a hunk from the stack and increments the pointer. Period. No hunting from a free block. mark saves the pointer. release restores the pointer from the saved value. In effect, release frees all memory allocated since the last mark. This is convenient for freeing the symbol table in a block structured language. (I can't remember, but I suppose the marks must stack.)