[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Foreign Functions, NewPtr, and Heap Question



> Hi, all.

hi, richard


> I have some foreign function code written in MPW C

congratz!


> NewPtr can step on MCL's internal heap, or something to that effect.

no.  mcl maintains a mac and a lisp heap.  ALL ff-environs are in the
"normal", ie non-gc'ed heap.


> The documentation led me to believe that the ff-load created an
> "environment" on each call, which conceivably would include a heap

the docs are right on this! :)


> as well as copies of the libraries the ff was linked with.

Yes, unfortunately.  There is no such thing like sharing of routines
of another environment  :(


> It seems that heaps are heaps, and that MCL should at some
> level manage them correctly, with respect to pointers and
> handles in foreign functions. If you have references to any
> info, please provide them with your comments.  Thanks a
> billion,

just act as if you'd write a normal Mac app and everything is 

fine.  Pointers are Pointers, Handles Handles, and Heaps Heaps! 



-Tobias Kunze 


____________________________________________________________
Center for Computer Research in Music and Acoustics
Stanford University, Stanford, CA