ROFL-pipeline  v0.6.0dev
Functions
Memory API

Memory management API definition (malloc, free..), that must be implemented by the library users. More...

Functions

ROFL_BEGIN_DECLS void * platform_malloc (size_t length)
 Allocates a chunk of dynamic memory of size length. More...
 
void * platform_malloc_shared (size_t length)
 Allocates a chunk of dynamic memory of size length, which must be accessible (R/W) for all the threads/hw threads, cores... More...
 
void platform_free (void *data)
 Frees a chunk of dynamic memory previously allocated with platform_malloc(). More...
 
void platform_free_shared (void *data)
 Frees a chunk of dynamic memory previously allocated with platform_malloc_shared(). More...
 
void * platform_memcpy (void *dst, const void *src, size_t length)
 Copies a chunk of memory. More...
 
void * platform_memset (void *src, int c, size_t length)
 Sets 'c' to the whole chunk of memory. More...
 
void * platform_memmove (void *dst, const void *src, size_t length)
 Moves a chunk of memory from src to dst. More...
 

Detailed Description

Memory management API definition (malloc, free..), that must be implemented by the library users.

Function Documentation

void platform_free ( void *  data)

Frees a chunk of dynamic memory previously allocated with platform_malloc().

This in LIBC compatible platforms is equivalent to free()

void platform_free_shared ( void *  data)

Frees a chunk of dynamic memory previously allocated with platform_malloc_shared().

This in LIBC compatible platforms is equivalent to free()

ROFL_BEGIN_DECLS void* platform_malloc ( size_t  length)

Allocates a chunk of dynamic memory of size length.

This in LIBC compatible platforms is equivalent to malloc()

void* platform_malloc_shared ( size_t  length)

Allocates a chunk of dynamic memory of size length, which must be accessible (R/W) for all the threads/hw threads, cores...

that may interact with the same logical switch.

void* platform_memcpy ( void *  dst,
const void *  src,
size_t  length 
)

Copies a chunk of memory.

Equivalent to LIBC memcpy()

void* platform_memmove ( void *  dst,
const void *  src,
size_t  length 
)

Moves a chunk of memory from src to dst.

Equivalent to memmove().

The user of the library can assume both src and dst ointers will ALWAYS be allocated via the same call (malloc/malloc_shared)

void* platform_memset ( void *  src,
int  c,
size_t  length 
)

Sets 'c' to the whole chunk of memory.

Equivalent to LIBC memset()