Carbon


NewFatRoutineDescriptor

Header: MixedMode.h Carbon status: Unsupported

Creates a new fat routine descriptor.

UniversalProcPtr NewFatRoutineDescriptor (
    ProcPtr theM68kProc, 
    ProcPtr thePowerPCProc, 
    ProcInfoType theProcInfo
);
theM68kProc

The address of a 680x0 routine.

thePowerPCProc

The address of a PowerPC routine.

theProcInfo

The procedure information to be associated with the routine.

function result

A pointer to the new routine descriptor.

DISCUSSION

The NewFatRoutineDescriptor function creates a new fat routine descriptor and returns a pointer (of type UniversalProcPtr) to it. The routine descriptor contains routine records for both 680x0 and PowerPC versions of a routine. If the value of either the theM68kProc parameter or the thePowerPCProc parameter is NULL, NewFatRoutineDescriptor 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 will need to set the current heap to that heap and then restore the original heap before exiting.

In general, you need to create routine descriptors only for routines whose addresses are exported to the system software (for example, a completion procedure). You do not need to create a routine descriptor for a routine that is called by code of the same type.

In general, you need to call this function only from PowerPC code. To maintain a single source code base for your software, however, you can call this function from 680x0 code, as long as you set the USESROUTINEDESCRIPTORS compiler flag to false (its default setting). To compile code for the PowerPC environment, you should set the USESROUTINEDESCRIPTORS flag to true.

SPECIAL CONSIDERATIONS

The NewFatRoutineDescriptor 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 NewFatRoutineDescriptor 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 NewFatRoutineDescriptor function is undefined.

AVAILABILITY

Not supported in Carbon. Not available in CarbonLib, but available when InterfaceLib 7.1 or later is installed. Exported by InterfaceLib 7.1 and later.

CARBON NOTES

68K-specific. Does nothing in PowerPC-native code.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)