Older Newer
Tue, 17 Dec 2019 04:39:19 . . . . SyneRyder [Initial function definition]


Changes by last author:

Added:
= allocHost =

== Syntax ==

int allocHost(int size)

== Arguments ==

:size

::The size of the memory block to allocate in bytes.

== Return ==

A bufferID for the allocated memory block, or NULL if the memory couldn't be allocated (or the host program doesn't support allocated memory blocks).

== Description ==

Allocates a block of memory through the host application. Since some graphics programs like Photoshop manage memory and allocate large chunks of memory for themselves, you might want to use this in preference to the system memory functions like malloc and calloc.

== Example ==

<code>

int bufferID = allocHost(100);

if (bufferID == NULL) {

Warn("Could not allocate memory");

}

else {

char* memptr = lockHost(bufferID);

sprintf(memptr, "Message goes here!");

Info(memptr);

freeHost(bufferID);

}

</code>

== See Also ==

lockHost, freeHost