Instance Method

newZoneForBuffersWithSize:andType:

Creates a zone large enough to fit the specified group of allocation sizes.

Required.

Declaration

- (id<MDLMeshBufferZone>)newZoneForBuffersWithSize:(NSArray<NSNumber *> *)sizes andType:(NSArray<NSNumber *> *)types;

Parameters

sizes

An array of integers, each the length in bytes of an allocation to be made later.

types

An array of integers, each the MDLMeshBufferType value corresponding to an allocation described in the sizes array.

Return Value

A new memory zone.

Discussion

Objects implementing the MDLMeshBufferZone protocol describe a logical pool of memory for allocation of related buffers. The actual class of buffer zone objects vended by an allocator may be private.

This method creates a zone with enough capacity to allocate buffers with the sizes and types specified, taking into account any alignment restrictions necessary to use these buffers.

See Also

Allocating Mesh Buffers

- newZone:

Creates a zone for related memory allocations.

Required.

- newBuffer:type:

Creates a new buffer of the specified length.

Required.

- newBufferFromZone:length:type:

Creates a new buffer of the specified length in the specified zone.

Required.

- newBufferWithData:type:

Creates a new buffer containing the specified data.

Required.

- newBufferFromZone:data:type:

Creates a new buffer containing the specified data in the specified zone.

Required.