Subject: Re: anybody familiar with these Mac ROM calls?
To: Henry B. Hotz <henry.b.hotz@jpl.nasa.gov>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 04/09/1996 18:39:54
> >No, nobody moves anybody else's memory blocks under NetBSD, so
> >basically any block is always "locked".
> 
> Danger, Will Robinson!!  Paradigm shift ahead!
> 
> The Mac is a single-user machine so there *never* *was* anyone else to mess
> with memory (unless you were in an interrupt routine, in which case messing
> with memory was prohibited).  The issue is that some toolbox calls changed
> memory on you as a side effect.  Simply allocating some memory might do
> this because the memory manager would move things to avoid encroaching on
> possible stack expansion space.  Simply doing a subroutine call might do it
> because the routine might be in a different code resource which would have
> to be read in (and space would have to be allocated to read it into. . .).

I though the main reason for handles was that the memory manager could
de-fragment the application memory space automagically. Given how
memory-locked the early macs were, this could be a big win.

> Anyway, my point is that some care should be taken in reimplimenting the
> *Handle routines.  They would go to excessive lengths to avoid memory
> fragmentation and driver code that allocated space in a
> fragmentation-inducing order could possibly stop working, or at least waste
> a lot of space, if we don't implement all the "features."

I agree. Though as you said in a part I snipped, just malloc'ing
space and making a pointer to a pointer would probably suffice at first.

Take care,

Bill