GBDK 2020 API Docs
API Documentation for GBDK 2020
 All Classes Files Functions Variables Typedefs Macros Pages
malloc.h
Go to the documentation of this file.
1 
6 #ifndef __SYS_MALLOC_H
7 #define __SYS_MALLOC_H
8 
9 #include <types.h>
10 
11 /* The various constants */
15 #define MALLOC_FREE 1
16 #define MALLOC_USED 2
17 
20 #define MALLOC_MAGIC 123
21 
22 /* malloc hunk header definition */
23 typedef struct smalloc_hunk mmalloc_hunk;
24 typedef struct smalloc_hunk * pmmalloc_hunk;
25 
26 struct smalloc_hunk {
27  UBYTE magic; /* Magic number - indicates valid hunk header */
28  pmmalloc_hunk next; /* Pointer to the next hunk */
29  UWORD size; /* Size in bytes of this region */
30  int status; /* One of MALLOC_FREE or MALLOC_USED */
31 };
32 
35 
37 extern pmmalloc_hunk malloc_first;
38 
40 void malloc_gc(void) NONBANKED;
42 void debug( char *routine, char *msg ) NONBANKED;
43 
44 #endif /* __SYS_MALLOC_H */
void debug(char *routine, char *msg) NONBANKED
UBYTE malloc_heap_start
int status
Definition: malloc.h:30
pmmalloc_hunk next
Definition: malloc.h:28
UINT8 UBYTE
Definition: types.h:45
void malloc_gc(void) NONBANKED
Definition: malloc.h:26
#define NONBANKED
Definition: types.h:11
UWORD size
Definition: malloc.h:29
pmmalloc_hunk malloc_first
UBYTE magic
Definition: malloc.h:27
struct smalloc_hunk * pmmalloc_hunk
Definition: malloc.h:24
UINT16 UWORD
Definition: types.h:49