Carbon


ATSUCreateMemorySetting

Header: ATSUnicode.h Carbon status: Unsupported

Creates a memory setting.

OSStatus ATSUCreateMemorySetting (
    ATSUHeapSpec iHeapSpec, 
    ATSUMemoryCallbacks *iMemoryCallbacks, 
    ATSUMemorySetting *oMemorySetting
);
Parameter descriptions
iHeapSpec

A value that indicates whether ATSUI or your application will control memory allocation operations. See “Heap Specification Constants” for a description of possible values. If you pass the kATSUUseSpecificHeap constant, you must pass a pointer to a union that contains the correctly-prepared heap in the heapToUse field in the iMemoryCallbacks parameter. If you pass the kATSUUseCallbacks constant, you must pass a pointer to a ATSUMemoryCallbacks union that contains pointers to your application-defined functions in the iMemoryCallbacks parameter. If you pass the kATSUUseCurrentHeap or kATSUUseAppHeap constant, you should pass a NULL pointer in the iMemoryCallbacks parameter. You must pass a valid value for this parameter.

iMemoryCallbacks

A pointer to a memory callback union that contains either pointers to your memory allocation callback functions or the heap that you want ATSUI to use when allocating memory.

oMemorySetting

On return, a pointer to a reference to a new memory allocation setting. To make this setting current, you must pass it to the function ATSUSetCurrentMemorySetting. You cannot pass NULL for this parameter.

function result

A result code.

DISCUSSION

The ATSUCreateMemorySetting function enables you to specify whether you wish to perform memory allocations yourself or have ATSUI do so. If you want to control memory allocation in ATSUI, pass kATSUUseCallbacks in the iHeapSpec parameter and a pointer to a ATSUMemoryCallbacks union that contains pointers to your callback functions in the iMemoryCallbacks parameter.

After creating a memory setting, you must pass it to the function ATSUSetCurrentMemorySetting to ensure that it will be used in subsequent Memory Manager calls.

You might want to create different memory settings for different memory allocation operations. For example, you might create two different settings designating different heaps to use for allocating the memory associated with style and text layout object creation. Before creating a style or text layout object, you would then make the appropriate setting current by calling ATSUSetCurrentMemorySetting.

VERSION NOTES

Available beginning with ATSUI 1.1.

AVAILABILITY

Not supported in Carbon. Not available in Carbon.

CARBON NOTES

Control of memory allocation not available in CarbonLib and not necessary on Mac OS X.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)