RetroArch
lwp_heap.h
Go to the documentation of this file.
1 #ifndef __LWP_HEAP_H__
2 #define __LWP_HEAP_H__
3 
4 #include <gctypes.h>
5 #include "machine/asm.h"
6 
7 #define HEAP_BLOCK_USED 1
8 #define HEAP_BLOCK_FREE 0
9 
10 #define HEAP_DUMMY_FLAG (0+HEAP_BLOCK_USED)
11 
12 #define HEAP_OVERHEAD (sizeof(u32)*2)
13 #define HEAP_BLOCK_USED_OVERHEAD (sizeof(void*)*2)
14 #define HEAP_MIN_SIZE (HEAP_OVERHEAD+sizeof(heap_block))
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 typedef struct _heap_block_st heap_block;
26 };
27 
28 typedef struct _heap_iblock_st {
33 } heap_iblock;
34 
35 typedef struct _heap_cntrl_st {
37  heap_block *final;
38 
44 } heap_cntrl;
45 
46 u32 __lwp_heap_init(heap_cntrl *theheap,void *start_addr,u32 size,u32 pg_size);
47 void* __lwp_heap_allocate(heap_cntrl *theheap,u32 size);
48 BOOL __lwp_heap_free(heap_cntrl *theheap,void *ptr);
49 u32 __lwp_heap_getinfo(heap_cntrl *theheap,heap_iblock *theinfo);
50 
51 #ifdef LIBOGC_INTERNAL
52 #include <libogc/lwp_heap.inl>
53 #endif
54 
55 #ifdef __cplusplus
56  }
57 #endif
58 
59 #endif
u32 __lwp_heap_init(heap_cntrl *theheap, void *start_addr, u32 size, u32 pg_size)
Definition: lwp_heap.c:10
const GLvoid * ptr
Definition: nx_glsym.h:242
Definition: lwp_heap.h:28
struct _heap_cntrl_st heap_cntrl
Data type definitions.
void * __lwp_heap_allocate(heap_cntrl *theheap, u32 size)
Definition: lwp_heap.c:41
GLsizeiptr size
Definition: glext.h:6559
u32 used_blocks
Definition: lwp_heap.h:31
u32 used_size
Definition: lwp_heap.h:32
heap_block * next
Definition: lwp_heap.h:24
heap_block * perm_null
Definition: lwp_heap.h:40
heap_block * first
Definition: lwp_heap.h:39
Definition: lwp_heap.h:21
Definition: lwp_heap.h:35
u32 free_blocks
Definition: lwp_heap.h:29
heap_block * last
Definition: lwp_heap.h:41
u32 __lwp_heap_getinfo(heap_cntrl *theheap, heap_iblock *theinfo)
Definition: lwp_heap.c:162
struct _heap_iblock_st heap_iblock
unsigned int BOOL
Definition: gctypes.h:51
heap_block * prev
Definition: lwp_heap.h:25
u32 free_size
Definition: lwp_heap.h:30
u32 front_flag
Definition: lwp_heap.h:23
u32 back_flag
Definition: lwp_heap.h:22
u32 reserved
Definition: lwp_heap.h:43
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
u32 pg_size
Definition: lwp_heap.h:42
heap_block * start
Definition: lwp_heap.h:36
BOOL __lwp_heap_free(heap_cntrl *theheap, void *ptr)
Definition: lwp_heap.c:99