Carbon


BlockMove

Header: MacMemory.h Carbon status: Supported

Copies a sequence of bytes from one location in memory to another.

void BlockMove (
    const void *srcPtr, 
    void *destPtr, 
    Size byteCount
);
Parameter descriptions
srcPtr

The address of the first byte to copy.

destPtr

The destination address.

byteCount

The number of bytes to copy. If the value of byteCount is 0, BlockMove does nothing.

DISCUSSION

The BlockMove function copies the specified number of bytes from the address designated by srcPtr to that designated by destPtr. It updates no pointers.

The BlockMove function works correctly even if the source and destination blocks overlap.

You can safely call BlockMove at interrupt time. Even though it moves memory, BlockMove does not move relocatable blocks, but simply copies bytes.

Call the function MemError to get the result code. See “Result Codes”.

The BlockMove function currently flushes the processor caches whenever it moves more than 12 bytes. This behavior can adversely affect your application’s performance. You might want to avoid calling BlockMove to move small amounts of data in memory if there is no possibility of moving stale data or instructions. For more information about stale data and instructions, see the discussion of the processor caches in the chapter “Memory Management Utilities” in this book.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


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