Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC System Software /
Chapter 2 - Mixed Mode Manager / Mixed Mode Manager Reference
Mixed Mode Manager Routines / Creating and Disposing of Routine Descriptors


NewRoutineDescriptor

You can call the NewRoutineDescriptor function to create a new routine descriptor.

pascal UniversalProcPtr NewRoutineDescriptor 
                     (ProcPtr theProc, ProcInfoType theProcInfo, 
                        ISAType theISA);
theProc
The address of the routine.
theProcInfo
The procedure information to be associated with the routine.
theISA
The instruction set architecture of the routine being described.
DESCRIPTION
The NewRoutineDescriptor function creates a new routine descriptor and returns a pointer (of type UniversalProcPtr) to it. If the value of the theProc parameter is NULL, NewRoutineDescriptor returns the value NULL.

The memory occupied by the new routine descriptor is allocated in the current heap. If you want the memory to be allocated in some other heap, you'll need to set the current heap to that heap and then restore the current heap before exiting.

SPECIAL CONSIDERATIONS
The NewRoutineDescriptor function allocates memory; you should not call it at interrupt time or from any code that might be executed when memory is low. In addition, the block of memory allocated by NewRoutineDescriptor is nonrelocatable. To help minimize heap fragmentation, you should try to allocate any routine descriptors you will need early in your application's execution.

When the USESROUTINEDESCRIPTORS compile flag is false, the NewRoutineDescriptor function simply returns the address passed in
the theProc parameter and does not allocate memory for a routine descriptor.

SEE ALSO
See "Using Universal Procedure Pointers" beginning on page 2-21 for a more complete description of when and how to create routine descriptors. See "Specifying Procedure Information" beginning on page 2-14 for information on creating procedure information.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996