Article # 683, added by Geoworks, historical record
| first | previous | index | next | last |

The discardable-dgroup flag in .gp files.



Q. Why use this flag? What are the trade-offs between using this
   flag and not using this flag?

A. This flag turns on error checking in glue to ensure that your
   geode has a discardable dgroup. If your geode does not have a
   discardable dgroup, it means that RAM is always reserved for your
   geodes' dgroup, even if the geode isn't currently loaded. This is
   bad, as the typical app's dgroup is over 2K, because of the stack.


Q. How does using this flag affect how you code your application?
   Does it mean that I can't do this?

	segmov	ds, dgroup, ax

   How do I get to my dgroup then?  ES no longer points to dgroup
   in methods.

A. You can still have handle relocations to your dgroup resource,
   and you can always do "resid dgroup", so you can do one of the
   following:

	GetResourceSegmentNS	dgroup, 

	Which does:
		push	bx
		mov	bx, resid dgroup
		call	GeodeGetResourceHandle
		call	MemDerefDS
			or
		call	MemDerefES
		pop	bx


	Or you can do the shorter:

		mov	bx, handle dgroup
		call	MemDerefDS/MemDerefES

	I'm sticking with GetResourceSegmentNS...

   If C geodes need to load DS with dgroup (this is typically
   done for routines that are externally callable), they can call
   GeodeLoadDgroup.