🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10686

Re: CloseFonts() problems

#10686
From: Leo L. Schwab
Date: Fri, 23 Dec 1988 08:13
28 lines
2030 bytes
In article <3599@tekig5.PEN.TEK.COM> wayneck@tekig5.PEN.TEK.COM (Wayne Knapp) writes:
>I'm working on a program that makes massive use of fonts.  The problem
>I have is that once a font is loaded into memory, it stays there forever.
>[ ... ]
>Seemly the CloseFont() call dose not ever release the font from memory.
>[ ... ]  Dose [sic] anyone know what is wrong?
>
	Nothing is wrong.  Fonts are rather like libraries; they hang around
in memory until memory becomes short.  The reason it does this is so that it
doesn't have to load them off disk every time they're opened.  The fonts and
libraries will be purged from memory when the memory is needed.

	You can force the system to purge all loaded fonts and libraries
that are not currently in use by trying to allocate four gigabytes of RAM:

	AllocMem (4000000000L, NULL);

	This will always fail (unless you actually happen to *have* four
gigabytes of RAM hanging around (or if AmigaDOS/Kickstart ever goes
virtual)).  However, in the process of trying to satisfy this request, Exec
will make room in memory by flushing out all loaded fonts and libraries that
aren't in use.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	INET: well!ewhac@ucbvax.Berkeley.EDU
 \_ -_		Recumbent Bikes:	UUCP: pacbell > !{well,unicom}!ewhac
O----^o	      The Only Way To Fly.	      hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor
Technical Details
Message-ID: <10097@well.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!hplabs!well!ewhac
References: <3599@tekig5.PEN.TEK.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!hplabs!well!ewhac
From: ewhac@well.UUCP (Leo L. Schwab)
Newsgroups: comp.sys.amiga.tech
Subject: Re: CloseFonts() problems
Summary: How to get your memory back.
Message-ID: <10097@well.UUCP>
Date: 23 Dec 88 08:13:01 GMT
References: <3599@tekig5.PEN.TEK.COM>
Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab)
Organization: Klein Bottle Wanted; Inquire Within.
Lines: 27
Quote: "The Plain Man's Guide to Alien Invasion."  -- Avon