Thread View: comp.sys.transputer
1 messages
1 total messages
Started by Mark from Philips
Thu, 18 Jan 1990 09:07
Dynamically determining memory size
Author: Mark from Philips
Date: Thu, 18 Jan 1990 09:07
Date: Thu, 18 Jan 1990 09:07
24 lines
1347 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads