Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!bu.edu!mirror!rayssd!galaxia!mrsoft!mrr From: mrr@mrsoft.Newport.RI.US (Mark Rinfret) Newsgroups: comp.sys.mac.programmer Subject: Re: Growing system heap, etc. (my previous post) Message-ID: Date: 27 Aug 90 23:12:22 GMT Lines: 53 A while back, I requested a reasonable approach to growing the system heap from within an INIT. Several readers responded with references to the 'sysz' resource, which indeed does what it is supposed to. It turns out that my problem was two-fold. I made an assumption that the size of the system heap was the problem (it wasn't) and the little hack I wrote to measure system heap size wasn't reporting useful info (more stuff accumulated in the additional heap area, masking the size increase; I didn't use a call which would have caused a compaction/purge - duh!). It turns out that the bug was actually in the device driver which my INIT installs. In short, it was caused by a bad pointer reference in the CONTROL entry. Control was being called by the system because I had needlessly set the "needGoodBye" flag in the driver resource. Multifinder operation was masking the problem. Thanks to all who responded. Now, for another question... As I mentioned, my INIT installs a new device driver (a "software" device). This is done as follows: - Load and detach the 'DRVR' resource - Obtain an available driver reference number by scanning the unit table for an empty entry. Start scanning at (-12 + 1), per an example in Tech Note 71 (I think; the note was about scanning for device driver names). - Call _DrvrInstall (with the reference number) - Get the handle to the DCE and fill in the DCE with pertinent info. - Leave. I don't open the driver in the INIT. The first application to call OpenDriver with my driver's name causes dCtlStorage to be allocated. The driver is never closed. All of the above works very well EXCEPT when I'm running TOPS networking software. In that case, it seems that TOPS simply clobbers my driver installation. If I name my INIT file such that it has a leading underscore (thus running after the TOPS init), everything works fine. Is TOPS making assumptions or am I breaking the rules? Mark -- ################################################################# # Mark R. Rinfret, MRSoft Home: 401-846-7639 # # mrr@mrsoft, galaxia!mrsoft!mrr Work: 401-849-9930 x301 # #################################################################