diff options
| author | John "Lameguy" Wilbert Villamor <lameguy64@gmail.com> | 2022-10-19 17:57:06 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-19 17:57:06 +0800 |
| commit | e08a3d9366f8ca14a76b3dd569dac1fb9f569748 (patch) | |
| tree | 33654513b0b184c27f8035dbc405640fcbeb44ab /libpsn00b/include/stdlib.h | |
| parent | c4a2533d21dfd05cde841ea48c67b05e0e6a853f (diff) | |
| parent | 9b2ffc6078a850b7d354855cca7622090b41f30c (diff) | |
| download | psn00bsdk-e08a3d9366f8ca14a76b3dd569dac1fb9f569748.tar.gz | |
Merge pull request #59 from spicyjpeg/psxmdec
IRQ handler fix, .STR playback example, multiple library builds (v0.21)
Diffstat (limited to 'libpsn00b/include/stdlib.h')
| -rw-r--r-- | libpsn00b/include/stdlib.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libpsn00b/include/stdlib.h b/libpsn00b/include/stdlib.h index 1888c69..f0753c1 100644 --- a/libpsn00b/include/stdlib.h +++ b/libpsn00b/include/stdlib.h @@ -12,6 +12,16 @@ #define RAND_MAX 0x7fff +/* Structure definitions */ + +typedef struct _HeapUsage { + size_t total; // Total size of heap + stack + size_t heap; // Amount of memory currently reserved for heap + size_t stack; // Amount of memory currently reserved for stack + size_t alloc; // Amount of memory currently allocated + size_t alloc_max; // Maximum amount of memory ever allocated +} HeapUsage; + /* API */ #ifdef __cplusplus @@ -33,11 +43,12 @@ long double strtold(const char *nptr, char **endptr); double strtod(const char *nptr, char **endptr); float strtof(const char *nptr, char **endptr); -void _mem_init(size_t ram_size, size_t stack_max_size); void InitHeap(void *addr, size_t size); -//int SetHeapSize(size_t size); void *sbrk(ptrdiff_t incr); +void TrackHeapUsage(ptrdiff_t alloc_incr); +void GetHeapUsage(HeapUsage *usage); + void *malloc(size_t size); void *calloc(size_t num, size_t size); void *realloc(void *ptr, size_t size); |
