psl1ght
A free SDK for Sony's PS3 console
Loading...
Searching...
No Matches
heap.h File Reference

Heap management functions. More...

#include <ppu-types.h>

Go to the source code of this file.

Data Structures

struct  _heap_block_t
 
struct  _heap_cntrl_t
 

Macros

#define CPU_ALIGNMENT   PPU_ALIGNMENT
 
#define HEAP_BLOCK_PREV_USED   ((uintptr_t) 1)
 
#define HEAP_BLOCK_ALLOC_BONUS   (sizeof(uintptr_t))
 
#define HEAP_BLOCK_HEADER_SIZE   (2*sizeof(uintptr_t))
 

Typedefs

typedef struct _heap_block_t heap_block
 
typedef struct _heap_cntrl_t heap_cntrl
 

Functions

struct _heap_block_t __attribute__ ((packed))
 
uintptr_t heapInit (heap_cntrl *theheap, void *start_addr, uintptr_t size)
 
void * heapAllocate (heap_cntrl *theheap, uintptr_t size)
 
void * heapAllocateAligned (heap_cntrl *theheap, uintptr_t size, uintptr_t alignment)
 
bool heapFree (heap_cntrl *theheap, void *ptr)
 

Variables

uintptr_t prev_size
 
uintptr_t size
 
heap_blocknext
 
heap_blockprev
 
struct _heap_cntrl_t __attribute__
 

Detailed Description

Heap management functions.

Definition in file heap.h.

Macro Definition Documentation

◆ CPU_ALIGNMENT

#define CPU_ALIGNMENT   PPU_ALIGNMENT

Definition at line 10 of file heap.h.

◆ HEAP_BLOCK_ALLOC_BONUS

#define HEAP_BLOCK_ALLOC_BONUS   (sizeof(uintptr_t))

Definition at line 13 of file heap.h.

◆ HEAP_BLOCK_HEADER_SIZE

#define HEAP_BLOCK_HEADER_SIZE   (2*sizeof(uintptr_t))

Definition at line 14 of file heap.h.

◆ HEAP_BLOCK_PREV_USED

#define HEAP_BLOCK_PREV_USED   ((uintptr_t) 1)

Definition at line 12 of file heap.h.

Typedef Documentation

◆ heap_block

typedef struct _heap_block_t heap_block

Definition at line 20 of file heap.h.

◆ heap_cntrl

typedef struct _heap_cntrl_t heap_cntrl

Definition at line 21 of file heap.h.

Function Documentation

◆ __attribute__()

struct _heap_block_t __attribute__ ( (packed)  )

◆ heapAllocate()

void * heapAllocate ( heap_cntrl theheap,
uintptr_t  size 
)

◆ heapAllocateAligned()

void * heapAllocateAligned ( heap_cntrl theheap,
uintptr_t  size,
uintptr_t  alignment 
)

◆ heapFree()

bool heapFree ( heap_cntrl theheap,
void *  ptr 
)

◆ heapInit()

uintptr_t heapInit ( heap_cntrl theheap,
void *  start_addr,
uintptr_t  size 
)

Variable Documentation

◆ __attribute__

__attribute__

◆ next

heap_block* next

Definition at line 2 of file heap.h.

◆ prev

heap_block* prev

Definition at line 3 of file heap.h.

◆ prev_size

uintptr_t prev_size

Definition at line 0 of file heap.h.

◆ size

uintptr_t size

Definition at line 1 of file heap.h.