GBDK 2020 API Docs
API Documentation for GBDK 2020
Main Page
Related Pages
Classes
Files
File List
File Members
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
34
extern
UBYTE
malloc_heap_start
;
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 */
debug
void debug(char *routine, char *msg) NONBANKED
malloc_heap_start
UBYTE malloc_heap_start
smalloc_hunk::status
int status
Definition:
malloc.h:30
smalloc_hunk::next
pmmalloc_hunk next
Definition:
malloc.h:28
UBYTE
UINT8 UBYTE
Definition:
types.h:45
malloc_gc
void malloc_gc(void) NONBANKED
smalloc_hunk
Definition:
malloc.h:26
NONBANKED
#define NONBANKED
Definition:
types.h:11
smalloc_hunk::size
UWORD size
Definition:
malloc.h:29
malloc_first
pmmalloc_hunk malloc_first
smalloc_hunk::magic
UBYTE magic
Definition:
malloc.h:27
pmmalloc_hunk
struct smalloc_hunk * pmmalloc_hunk
Definition:
malloc.h:24
UWORD
UINT16 UWORD
Definition:
types.h:49