Article # 418, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
Moving things out of dgroup.
Q. I've created numerous subclasses in my application from the GEOS superclasses, adding methods and instance data. I've tried to keep my global variables to nil. I know that my subclass templates are stored in the dgroup. One problem: my compiles are indicating that my dgroup is getting to be inefficiently large (>1KB). I'm not sure as to what to do to decrease the size of my dgroup. Ideas? A. It turns out that you can move your class definitions to their own resource. All the classes must still be in the same (fixed) block, but at least the stack (2kb) won't be in that block as well. To do this, simply define your classes as usual in your .goc file, but make the following change in your .gp file: resource MYCLASSSTRUCTURES fixed read-only shared (If the app is named Hello, DON'T name your new resource HELLOCLASSSTRUCTURES, since that's the default name -- choose something else, as done above.) You'll also have to create a local.mk file, to customize the makefile. It should look exactly as follows: # # -C flag puts class tables in their own resource, # instead of dgroup. # GOCFLAGS += -CMyClassStructures # # Include the system makefile. # #include <$(SYSMAKEFILE)> Note: The Swat command "classes" will no longer work, since the command looks in dgroup to find your class definitions. So you'll have to set breakpoints in your methods using alternate means (viewing the source code and using the mouse to set the breakpoint; or using "stop at: " syntax. One slight benefit above that of reducing the size of dgroup is that if your app is ever made XIP, this is one of the steps you'd have to do.