Function Allocate global or local memory.
Syntax
#include <dx/dx.h> Pointer DXAllocate(unsigned int n) Pointer DXAllocateZero(unsigned int n) Pointer DXAllocateLocal(unsigned int n) Pointer DXAllocateLocalZero(unsigned int n) Pointer DXAllocateLocalOnly(unsigned int n) Pointer DXAllocateLocalOnlyZero(unsigned int n).
Functional Details For all of these routines, n must be greater than zero.
DXAllocate | Allocates n bytes of memory in global memory. |
DXAllocateZero | Allocates and clears n bytes of global memory. |
DXAllocateLocal | On platforms with per-processor local memory (such as multiprocessor workstations), allocates n bytes of memory in local memory. |
DXAllocateLocalZero | Allocates n bytes in local memory and zeros the allocated memory. |
DXAllocateLocal, DXAllocateLocalZero | If n bytes of local memory are not available, allocate them from global memory. |
DXAllocateLocalOnly, DXAllocateLocalOnlyZero | Allocate local memory only. |
On platforms without per-processor local memory (such as all currently supported workstations), DXAllocateLocal is identical to DXAllocate.
Although local is usually faster than global access, local memory should be used only for Objects within a task or for parts of a module not in a task Group: Objects in local memory cannot be shared between processors. Objects that are the output of a module must be in global memory.
Note: Memory allocated by any routine listed here should be freed (with DXFree) when it is no longer needed.
Return Value Returns a pointer to the allocated memory or returns NULL and sets an error code.
See Also DXAbortTaskGroup, DXAddTask, DXCreateTaskGroup, DXExecuteTaskGroup, DXFree, DXPrintAlloc, DXReAllocate
[Data Explorer Home Page | Contact Data Explorer | Same document on Data Explorer Home Page ]