Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbatt!ihnp4!meccts!ahby From: ahby@meccts.UUCP Newsgroups: comp.sys.apple Subject: Re: FRE Message-ID: <2759@meccts.MECC.MN.ORG> Date: Sat, 16-May-87 01:06:38 EDT Article-I.D.: meccts.2759 Posted: Sat May 16 01:06:38 1987 Date-Received: Sun, 17-May-87 01:04:09 EDT References: <8705111018.aa01214@SPARK.BRL.ARPA> <610@fai.UUCP> Reply-To: ahby@meccts.UUCP (Shane P. McCarron) Distribution: world Organization: MECC Technical Services, St. Paul, MN Lines: 41 Keywords: garbage collection In article <610@fai.UUCP> dalea@fai.UUCP (Dale M. Arends) writes: >Unless it was changed by Apple, the BASIC.SYSTEM interpreter has it's own >version of FRE that is extremely fast. To call it, instead of FRE(0) issue >the following ProDOS call: > >xx PRINT D$;"FRE" : REM Where xx is the line # and D$ is a CONTROL-D > >This can be called as often as desired but should be often enough that the >Applesoft FRE(0) routine be avoided. Actually, I'm pretty sure that BASIC.SYSTEM is constantly monitoring the bottom of strings/top of arrays area. If it notices them getting too close together, it automatically calls its internal fre() handler. It will also automatically do a fre whenever you open a file, it has to allocate a file buffer. It frees memory by moving the strings down by 1k or so. Also, I was pretty sure that ProDOS would spot a call to fre() and use its internal routine instead of handing it over to Applesoft. However, I haven't taken a close look at that part of BASIC.SYSTEM since its initial beta release in 82(?), so I could be wrong about this. It is interesting to note that BASIC.SYSTEM is really over-zealous in the way it hooks into basic. The link into chrget (I think its chrget) causes a performance loss of something like 4% off of the already slow Applesoft! Also, it has its own internal version of the BASIC token table, so there is no way to supply additional or changed tokens to applesoft. We discovered this when trying to port our version of extended Applesoft (EBASIC) into the ProDOS world. We had defined additional tokens for things like WHILE, CASE, WHEN, ELSE, SELECT, etc - and there was no way to do this under BASIC.SYSTEM. Thanks for another piece of software engineering genius, Apple! If you want a real laugh, take a look at the code inside BASIC.SYSTEM. Or better yet, look at the color screen dump driver that is supplied with the Imagewriter II. Hah! What a mess! (giggle, giggle) -- Shane P. McCarron UUCP ihnp4!meccts!ahby, ahby@MECC.MN.ORG MECC Technical Services ATT (612) 481-3589 (C) Copyright 1987 Shane P. McCarron Redistribution allowed only if your recipients can redistribute