[comp.windows.ms] EMS

c-mikema@microsoft.UUCP (Michael Bakkemo) (06/15/89)

 Michael Roper: How do I make sure the alloc grabs memory above the
	        640k line?

 Let me apologize for sounding more esoteric than I meant to
when all I meant to do was make sure nobody did anything stupid,
even though they probably wouldn't have anyway.

 The answer is you deliberatly have to NOT allocate above the line
by using the GMEM_NOT_BANKED or the GMEM_DDESHARE flags. Anything
else automatically allocates above the line (assuming you have it of course).

 If you bitmaps in memory, the redraw is fast, but thats memory that
another program can't allocate. If you don't mind a slower redraw
speed, have a discardable bitmap. If it hangs around, great. If it
gets chucked, band it in from disk.


Michael Bakkemo.
Microsoft has no idea I can think up crazy stuff like this all on
my own, and wouldn't approve of it even if they did.

roper@june.cs.washington.edu (Michael Roper) (06/17/89)

Michael Bakkemo writes:

>  Michael Roper: How do I make sure the alloc grabs memory above the
> 	        640k line?

The question I asked was:  

	"How can one dictate to GDI where it allocates its 
	objects with respect to the bank line?"

They aren't the same thing.  We have labored over this problem
for some time and found that in small-frame EMS, GDI allocations
are unpredictable with respect to the bank line (the same is 
true for GlobalAlloc's unless the GMEM_NOT_BANKED or GMEM_DDESHARE
flags are used to force the allocation below the bank line -- as
you pointed out).  In large-frame EMS however, it appears that
GDI -always- allocates above the line.  This was (and possibly
still is) a problem for us in certain cases that involve sharing
bitmaps that are created by a library.  The question remains:
how can one control GDI allocations?

Michael Roper
hDC Computer Corporation