Multipipe SDK 3.2 Reference

Name

MPKArena - MPKArena functional interface.

Header File

#include <mpk/arena.h>

Synopsis

void* mpkMalloc(size_t size);
void mpkFree(void* ptr);
void* mpkCalloc(size_t nelem, size_t elsize);
void* mpkRealloc(void* ptr, size_t size);
char* mpkStrDup(const char* s1);

Description

The MPKArena functional interface provides a simple memory allocation package that enables OpenGL Multipipe SDK applications to allocate data regardless of their current execution mode (see MPKGlobal).

Function descriptions


mpkMalloc returns a pointer to a block of at least size bytes suitably aligned for any use.

The argument to mpkFree is a pointer to a block previously allocated by mpkMalloc, mpkCalloc or mpkStrDup; after mpkFree is performed this space is made available for further allocation, but its contents are left undisturbed.

mpkCalloc allocates space for an array of nelem elements of size elsize. The space is initialized to zeros.

mpkRealloc changes the size of the block pointed to by ptr to size bytes and returns a pointer to the (possibly moved) block. The contents will be unchanged up to the lesser of the new and old sizes.

mpkStrDup returns a pointer to a new string which is a duplicate of the string pointed to by s1. The space for the new string is obtained using mpkMalloc. If the new string can not be created, it returns NULL.

See also

MPKGlobal