GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
cu_temp_buffer_malloc.h File Reference
#include "ghost/error.h"
Include dependency graph for cu_temp_buffer_malloc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ghost_error ghost_cu_temp_buffer_malloc (void **mem, size_t bytesize)
 Useful for allocating small temporary buffers. Keeps a list of previously allocated and freed buffers, and returns one if the size fits. Threadsafe. More...
 
ghost_error ghost_cu_temp_buffer_free (void *mem)
 Frees memory allocated with ghost_cu_temp_buffer_malloc. Threadsafe. More...
 

Function Documentation

ghost_error ghost_cu_temp_buffer_free ( void *  mem)

Frees memory allocated with ghost_cu_temp_buffer_malloc. Threadsafe.

Parameters
memWhich address to free
Returns
GHOST_SUCCESS on success or an error indicator.
ghost_error ghost_cu_temp_buffer_malloc ( void **  mem,
size_t  bytesize 
)

Useful for allocating small temporary buffers. Keeps a list of previously allocated and freed buffers, and returns one if the size fits. Threadsafe.

Parameters
memWhere to store the memory.
bytesizeThe number of bytes to allocate.
Returns
GHOST_SUCCESS on success or an error indicator.