[comp.sys.amiga.programmer] Opening a diskfont??

sutela@polaris.utu.fi (Kari Sutela) (01/10/91)

peterk@cbmger.UUCP (Peter Kittel GERMANY) writes:

>>Also, in my experience, OpenDiskFont does NOT check to see
>>if the font is already loaded, and will load a duplicate.

>Hmm, I'm told this by everyone, but it doesn't fit with my
>experiences:
[some omissions]
>Could it be that OpenDiskFont() is intelligent enough to look into
>RAM first, without explicitly calling OpenFont()? Or that a
>duplicate font gets loaded over an already existing one in RAM?

I think that what is really happening in a tight memory situation is:

1. You OpenDiskFont()
2. System makes an AllocMem() to get memory for your DiskFont (which actually
   already is in the memory).
3. AllocMem() fails
4. System flushes all unused libraries and fonts from the memory (thus getting
   rid of the in-memory DiskFont).
5. Another, AllocMem() (this time with success)
6. A successful loading of the DiskFont to memory

This would also explain why your program got slower in tight memory situations.

-- 
Kari Sutela	sutela@polaris.utu.fi