psl1ght
A free SDK for Sony's PS3 console
Loading...
Searching...
No Matches
heap.h
Go to the documentation of this file.
5#ifndef __SYS_HEAP_H__
6#define __SYS_HEAP_H__
7
8#include <ppu-types.h>
9
10#define CPU_ALIGNMENT PPU_ALIGNMENT
11
12#define HEAP_BLOCK_PREV_USED ((uintptr_t) 1)
13#define HEAP_BLOCK_ALLOC_BONUS (sizeof(uintptr_t))
14#define HEAP_BLOCK_HEADER_SIZE (2*sizeof(uintptr_t))
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
22
24{
25 uintptr_t prev_size;
26 uintptr_t size;
29} __attribute__((packed));
30
46
47uintptr_t heapInit(heap_cntrl *theheap, void *start_addr, uintptr_t size);
48void* heapAllocate(heap_cntrl *theheap, uintptr_t size);
49void* heapAllocateAligned(heap_cntrl *theheap, uintptr_t size, uintptr_t alignment);
50bool heapFree(heap_cntrl *theheap, void *ptr);
51
52#ifdef __cplusplus
53 }
54#endif
55
56#endif
void * heapAllocateAligned(heap_cntrl *theheap, uintptr_t size, uintptr_t alignment)
void * heapAllocate(heap_cntrl *theheap, uintptr_t size)
struct _heap_cntrl_t __attribute__
uintptr_t size
Definition heap.h:1
bool heapFree(heap_cntrl *theheap, void *ptr)
uintptr_t heapInit(heap_cntrl *theheap, void *start_addr, uintptr_t size)
uintptr_t prev_size
Definition heap.h:25
heap_block * next
Definition heap.h:27
uintptr_t size
Definition heap.h:26
heap_block * prev
Definition heap.h:28
heap_block * last_block
Definition heap.h:44
uintptr_t min_block_size
Definition heap.h:38
uintptr_t heap_end
Definition heap.h:41
s32 lock
Definition heap.h:33
heap_block free_list
Definition heap.h:35
heap_block * first_block
Definition heap.h:43
uintptr_t page_size
Definition heap.h:37
uintptr_t heap_begin
Definition heap.h:40