[comp.sys.mac.hypercard] XCMDs and heap space

Arne.Venstad@delab.sintef.no (06/11/91)

Hi,
A simple question: Are the code resources (XCMD/XFCN) of a stack copied into
the heap on opening the stack (i.e. before any XCMD/XFCN are called)?
I have made a rather large XCMD with multiple entry points (first parameter
is a tag) in order to utilize a common library of utilities. Alternatively
I could have split the XCMD into several independant code resources, duplicating
the utilities in each. Can anybody comment on my solution?

Best regards,

Arne Venstad	E-mail: Arne.Venstad@delab.sintef.no
SINTEF DELAB
N-7034 Trondheim
Norway.

jkc@Apple.COM (John Kevin Calhoun) (06/12/91)

In article <1991Jun11.104716*Arne.Venstad@delab.sintef.no>
Arne.Venstad@delab.sintef.no writes:
>A simple question: Are the code resources (XCMD/XFCN) of a stack copied into
>the heap on opening the stack (i.e. before any XCMD/XFCN are called)?

No.  Externals are copied into the heap only when they're invoked for
execution.  In 2.x, they remain there until purged by the Memory Manager
or the Resource Manager.

Kevin Calhoun
jkc@apple.com