🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.transputer
2 messages
2 total messages Started by Netherwood P J Mon, 11 Mar 1991 14:24
how much memory left
#1486
Author: Netherwood P J
Date: Mon, 11 Mar 1991 14:24
13 lines
1142 bytes
Does anyone know of a method of determining how much memory you have
left after a series of calls to malloc in 3L's Parallel C ?

-------------------------------------------------------------------------------
Paul Netherwood                      janet    :  P.J.Netherwood@uk.ac.kingston
Research                             internet :  P.J.Netherwood@kingston.ac.uk
                                     phone    :  (+44) 81 549 1366 ext 2923    
                                     local    :  cs_s424@ux.king  
          
School of Computer Science and Electronic Systems,
|/ingston |>olytechnic, Penrhyn Road, Kingston-upon-Thames, Surrey KT1 2EE, UK.
|\--------|--------------------------------------------------------------------
  \
Re: how much memory left
#1496
Author: Mitsunori Kawabe
Date: Wed, 13 Mar 1991 02:08
20 lines
1253 bytes
In article <9103111424.aa27802@sappho.ux.King.AC.UK> cs_s424@ux.kingston.ac.uk (Netherwood P J) writes:

 |Does anyone know of a method of determining how much memory you have
 |left after a series of calls to malloc in 3L's Parallel C ?

How about use undocumented global variable "IMP___HEAP_LIMIT".
It points top of heap. So you can estimate free memory left by subtracting
this value from current stack address like following.

int free_mem()
{
  extern char *IMP___HEAP_LIMIT;
  char tmp;
  return &tmp - IMP___HEAP_LIMIT;
}

--
$@@nJUK~FA!w!J3t!K0B@nEE5!@=:n=j(J $@8&5f=j(J $@8&5fBh#1%0%k!<%W(J  TEL (093)641-3111
						        FAX (093)631-8440
kawa@yesun.yelab.yaskawa.co.jp
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