[comp.sys.mac] Terror Stalks the Soul of a New Machine

saunders@batcomputer.tn.cornell.edu (kevin eric saunders) (07/02/87)

   Kudos to the dear soul who noted that multitasking on the Mac
could be saved from MapRgn()'s habit of ravishing the "free space"
between HeapEnd and the stack pointer (which will contain your 
code if you allocate new stacks in the heap!) by the simple 
expedient of resetting HeapEnd to the base of your stack.  
(Sounds scary, but it works....)

   Or it did.  Alas, perusing the shattered hulk of our application 
on the Mac II with MacsBug, it seems such bars will no longer 
restrain the madness, that this raving psychotic has been
paroled; we see all too clearly the "Mark of Zorro" 
(7fff .* 7fff) etched all across that lovely code.

   Gee, and it still works fine on an SE.  Suggestions, anyone?  

   "Well, Holmes?",
   kevin

-- 
Kevin Eric Saunders			
ARPA: saunders@tcgould.tn.cornell.edu
uw-beaver!cornell!batcomputer!saunders

mrh@Shasta.STANFORD.EDU (Marc Hannah) (07/03/87)

In article <1593@batcomputer.tn.cornell.edu>, saunders@batcomputer.tn.cornell.edu (kevin eric saunders) writes:
> 
>    Kudos to the dear soul who noted that multitasking on the Mac
> could be saved from MapRgn()'s habit of ravishing the "free space"
> between HeapEnd and the stack pointer (which will contain your 
> code if you allocate new stacks in the heap!) by the simple 
> expedient of resetting HeapEnd to the base of your stack.  
> (Sounds scary, but it works....)
> 
>    Or it did.  Alas, perusing the shattered hulk of our application 
> on the Mac II with MacsBug, it seems such bars will no longer 
...
>    Gee, and it still works fine on an SE.  Suggestions, anyone?  
...
>    kevin
     I never understood how that HeapEnd resetting could possibly
work. It seemed to me that the memory manager would be constantly
adjusting the value of HeapEnd OR that you might confuse the allocation
of new memory by using bogus values for HeapEnd. Changing the value
arbitrarily implies for this purpose implied that HeapEnd was only
used by QuickDraw.
    In any case, it is of no surprise to me that the Mac II might blow
away that kind of kludge. Quickdraw has been changed (extended) and one
might imagine that taking advantage of old 'features' in Classic Quickdraw
could cause problems. 
    David Gelphman  daveg%slacvm.bitnet@forsythe.stanford.edu