Important: The information in this document is obsolete and should not be used for new development.
NewRoutineDescriptor
You can call theNewRoutineDescriptorfunction 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
TheNewRoutineDescriptorfunction creates a new routine descriptor and returns a pointer (of typeUniversalProcPtr) to it. If the value of thetheProcparameter isNULL,NewRoutineDescriptorreturns the valueNULL.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
TheNewRoutineDescriptorfunction 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 byNewRoutineDescriptoris 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
USESROUTINEDESCRIPTORScompile flag isfalse, theNewRoutineDescriptorfunction simply returns the address passed in
thetheProcparameter 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.