Jump to content

SOMMalloc: Difference between revisions

From EDM2
Created page with "This function allocates the specified amount of memory. ==Syntax== <PRE> size_t size; somToken rc; rc = (*SOMMalloc)(size); </PRE> ==Parameters== ; size (size_t): T..."
 
No edit summary
Line 26: Line 26:
* [[SOMCalloc]]  
* [[SOMCalloc]]  
* [[SOMRealloc]]
* [[SOMRealloc]]
* [[SOMFree]]  
* [[somFree]]  


[[Category:SOM Kernel]]
[[Category:SOM Kernel]]

Revision as of 19:28, 10 October 2017

This function allocates the specified amount of memory.

Syntax

size_t      size;
somToken    rc;

rc = (*SOMMalloc)(size);

Parameters

size (size_t)
The amount of memory to be allocated, in bytes.

Return Code

rc (somToken)
A pointer to the first byte of the allocated space.

Remarks

This function allocates size bytes of memory. This function has the same interface as the C malloc function. It performs the same basic function as malloc with some supplemental error checking. If an error occurs, the SOMError function is called. This routine is replaceable by changing the value of the global variable SOMMalloc.

Example Code


Related

Functions