🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.transputer
Article #474

Dynamically determining memory size

#474
From: Mark from Philips
Date: Thu, 18 Jan 1990 09:07
24 lines
1347 bytes
You can determine memory size dynamically by using the variable 'freespace'.
freespace gives you the total amount of memory left over after your program
(and other programs, e.g. compiler on a host) has been loaded.  Since occam has
no dynamic features, freespace is a constant.  You can even use it, e.g. as an
array: 

VAL freesize IS freespace :
[]INT array IS [freespace FROM 0 FOR freesize] :


However, you do need to know what other programs are currently loaded into
memory and the size of their program and data spaces - but that shouldn't be
too tricky to work out.

In fact, you could even write a process (a memory manager) that allocates
freespace to itself, and accepts requests from other processes for bits of it.
That way, you can (sort of) have some sort of dynamic memory arrangement
(procedural abstraction?). 


Mark Edmonds
Philips Research Labs

edmonds@uk.co.philips.prl
Technical Details
Message-ID: <900118090758.0000409D0C1@prlvax1.prl.philips.co.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!prlvax1.prl.philips.co.uk!EDMONDS

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!prlvax1.prl.philips.co.uk!EDMONDS
From: EDMONDS@prlvax1.prl.philips.co.uk (Mark from Philips)
Newsgroups: comp.sys.transputer
Subject: Dynamically determining memory size
Message-ID: <900118090758.0000409D0C1@prlvax1.prl.philips.co.uk>
Date: 18 Jan 90 09:07:58 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 24