home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!spool.mu.edu!darwin.sura.net!news.udel.edu!chopin.udel.edu!kurisuto
- From: kurisuto@chopin.udel.edu (Sean J. Crist)
- Subject: Opening resource file prevents segments from being loaded
- Message-ID: <By7BnK.wv@news.udel.edu>
- Sender: usenet@news.udel.edu
- Nntp-Posting-Host: chopin.udel.edu
- Organization: University of Delaware
- Date: Tue, 24 Nov 1992 03:42:54 GMT
- Lines: 30
-
- This may be a FAQ, but here's what's happening. My program is divided in
- the normal way into CODE segments, including two which I will call segment
- A and segment B. At a point where segment B hasn't yet been loaded into
- memory (i.e., I haven't called any procedures in it yet), segment A opens
- a resource file. Then, when a procedure in segment B is called, the
- segment loader balks and doesn't load segment B, which of course brings
- the program to a speedy crash.
-
- By inserting calls in segment A to a do-nothing routine in segment B, I
- have narrowed the problem down to the line in my code where I open the
- resource file. If I call segment B before that, segment B loads fine; if
- I call segment B even one line after opening the resource file, then
- segment B is not loaded. I don't think the problem is a lack of memory
- because I have tried making my heap bigger, which didn't keep this from
- happening (and besides, by looking at my heap with a debugger I can see
- that there's all kinds of space there for segment B).
-
- Of course, the easy way around the problem is to simply load segment B by
- calling a do-nothing routine in segment B before opening the resource
- file. This is what I'm currently doing, and it works fine. But there's
- something strange going on here which I don't understand, and you know how
- such islands of ignorance can come back and bite you on the nose. Surely the
- segment loader doesn't use the one-deep resource manager calls?
-
- (The problem occurs within the run environment in Think Pascal 4.0. I've
- observed it both on an SE and on a IIcx. I haven't checked to see whether
- the problem also occurs in a stand-alone application.)
-
- --Kurisuto
-
-