Sujet : Re: portable or not? Volatile strings
De : do-not-use (at) *nospam* swldwa.uk (Gerry Jackson)
Groupes : comp.lang.forthDate : 14. Aug 2024, 11:16:30
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v9i05q$dh3v$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 14/08/2024 08:03, Anton Ertl wrote:
However, if we adopt Gerry Jackson's attitude and make every transient
region permanent, creating a new permanent word (in a separate
section) for every parsed number, string, etc. is fine, and ticking
that word is fine, too. For most programs, the space taken by the
recognized words is proportional to the size of the source code, which
is acceptable on desktops with GBs of RAM. However, programs that use
EVALUATE a lot will need more recognized-word storage. A contrived
example is:
: foo 1000000000 0 ?do s" 123" evaluate drop loop ; foo
I wasn't clear enough when I suggested making transient areas 'permanent'. Currently transient areas are overwritten either by the user or the system when it decides to re-use the transient region for something else. If we take the <# buffer as an example, I meant that the user would declare the memory to be used for that buffer once and that would be used thereafter. It's permanent in the sense that the allocation is permanent, not the contents - the system would not be allowed to corrupt it. THe user would be free to re-use it or to make the contents permanent by declaring another bit of memory to be used for the buffer. If the user ALLOCATEd the memory it could later be FREEd by the user. The user manages it not the system.
-- Gerry