stauffer@masg1.epfl.ch (Laurent Stauffer) (04/11/91)
Hello, I just want to know if there is a function which returns the amount of free dynamic memory ? -- Laurent Stauffer <stauffer@masg1.epfl.ch> ROSO - DMA - EPFL Ecublens 1015 Lausanne SUISSE
richard@aiai.ed.ac.uk (Richard Tobin) (04/11/91)
In article <1276@sicsun.epfl.ch> stauffer@masg1.epfl.ch (Laurent Stauffer) writes: >I just want to know if there is a function which returns the >amount of free dynamic memory ? No, there isn't. At least, the C language doesn't define one. Depending on your operating system, it may not even be a reasonable question. It is possible that one is available under your operating system / C implementation combination; I suggest (a) reading the manuals or if that fails (b) enquiring in a newsgroup related to your operating system. -- Richard -- Richard Tobin, JANET: R.Tobin@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nsfnet-relay.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin
gordon@osiris.cso.uiuc.edu (John Gordon) (04/12/91)
What system are you running? DOS, UNIX, Sun, etc?
ckp@grebyn.com (Checkpoint Technologies) (04/12/91)
In article <1276@sicsun.epfl.ch> stauffer@masg1.epfl.ch (Laurent Stauffer) writes: >Hello, >I just want to know if there is a function which returns the >amount of free dynamic memory ? If you want to write a portable program, no. There is nothing you can count on to tell you in advance how much memory you are allowed to malloc. You can only count on being told when you have run out, when malloc returns NULL. If you know more about your particular platform, and don't mind losing portability to other platforms, then you may find something in your OS services or compiler vendor's library that does it. -- First comes the logo: C H E C K P O I N T T E C H N O L O G I E S / / ckp@grebyn.com \\ / / Then, the disclaimer: All expressed opinions are, indeed, opinions. \ / o Now for the witty part: I'm pink, therefore, I'm spam! \/
pierreg@siegfried.vlsi.polymtl.ca (Pierre Girard (Cerbere)) (04/16/91)
> Hello, > I just want to know if there is a function which returns the > amount of free dynamic memory ? None that i know of on UNIX, on PCs and turbo C there is coreleft and farcoreleft. Of course you can implement an inefficient one by allocating blocks 'till malloc tells youy there ain't no space left. -- ___ ___ ___ ___ ___ ___ ___ / /__ /__/ /__/ /__ /__/ /__ /__ /__ / \ /__/ /___ / \ /___ Pierre Girard, Ecole Polytechnique de Montreal, Quebec, Canada. pierreg@info.polymtl.ca pierreg@crt.umontreal.ca
avery@netcom.COM (Avery Colter) (04/18/91)
I know that this function is called all the time on an Apple II GS and probably on the Macs... but not as a STANDARD C function. The functions which return total free memory are O/S toolbox functions in Apple's case. -- ^ ^ Avery Ray Colter /^\___/^\ avery@netcom.com {apple|claris}!netcom!avery ( o _ o ) elfcat@btr.btr.com {decwrl|mips|sgi}!btr!elfcat \ /v\ / 71067.606@compuserve.com (415) 839-4567 \_*-*_/ `-' Afternoon has gently passed me by. - The ELFCAT! And Evening spreads itself against the sky. Police