Harlequin RIP SDK

Memory-related utility functions. More...

#include <stdlib.h>
#include "skinkit.h"
#include "kit.h"
#include "mem.h"
#include "mpscmvff.h"
#include "mpsavm.h"
#include "mpsacl.h"
#include "skinmon.h"
#include "mps.h"
#include "mpslib.h"
#include "hqmemcpy.h"
#include "hqmemset.h"
#include "swcopyf.h"
#include "swdevice.h"

Data Structures

struct  header_s
 Each block allocated needs to remember its size, so we add a header to keep it in. HEADER_BLOCK and BLOCK_HEADER translate between a pointer to the header and a pointer to the block (what the caller of malloc gets). More...
 

Macros

#define OTHER_MEMORY_IN_BYTES   ((size_t)74 * (size_t)1024 * (size_t)1024)
 
#define OTHER_ADDRESS_SPACE_IN_BYTES   ((size_t)24 * (size_t)1024 * (size_t)1024)
 

Typedefs

typedef struct header_s header_s
 Each block allocated needs to remember its size, so we add a header to keep it in. HEADER_BLOCK and BLOCK_HEADER translate between a pointer to the header and a pointer to the block (what the caller of malloc gets).
 

Functions

void MemLogInit (const char *mps_log, unsigned long mps_telemetry)
 Set up the memory system to log to a file. More...
 
HqBool MemInit (size_t *RIP_maxAddressSpaceInBytes, size_t *RIP_workingSizeInBytes, void *pMemory, SysMemFns *pSysMemFns)
 Initialise the memory arena and create the memory pool for use in skin. More...
 
void MemFinish (int32 fError)
 Release the arena of managed memory. More...
 
void * MemAlloc (size_t cbSize, HqBool fZero, int actionOnFail)
 Allocate a block of memory for use by the skin layer. More...
 
void * MemRealloc (void *ptr, size_t cbSize)
 Reallocate a block of memory that was allocated by a prior call to MemAlloc(). More...
 
void MemFree (void *ptr)
 Free a block of memory that was allocated by a prior call to MemAlloc(). More...
 
void * SysAlloc (size_t cbSize)
 Allocate a block of system memory for use by the skin layer. More...
 
void SysFree (void *ptr)
 Free a block of memory that was allocated by a prior call to SysAlloc(). More...
 
mps_arena_t MemGetArena (void)
 Returns the single arena of managed memory that is shared between the core RIP and the skin layer.
 
size_t GetPeakArenaSize (void)
 Obtain the peak arena size in bytes. More...
 
size_t GetArenaCommitLimit (void)
 Obtain the commit limit of the arena in bytes. More...
 

Variables

static mps_arena_t mem_arena = ((void*)0)
 The single MPS arena used by both core and skin.
 
static mps_pool_t skin_pool = ((void*)0)
 The memory pool for use in skin.
 

Detailed Description

Memory-related utility functions.

Macro Definition Documentation

◆ OTHER_ADDRESS_SPACE_IN_BYTES

#define OTHER_ADDRESS_SPACE_IN_BYTES   ((size_t)24 * (size_t)1024 * (size_t)1024)

Address space left for other allocations (libraries).

◆ OTHER_MEMORY_IN_BYTES

#define OTHER_MEMORY_IN_BYTES   ((size_t)74 * (size_t)1024 * (size_t)1024)

Memory left for other allocations (OS and libraries).