aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/libc/malloc.s
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2020-09-19 20:43:05 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2020-09-19 20:43:05 +0800
commit9f4891f95070c66ea9f1aba99d72724d4ab24e5a (patch)
tree723e3ef2118a3d1a9e6dafa811ed1b8b1bc9196e /libpsn00b/libc/malloc.s
parent6762c39551ded059450d17d8bb0cb80642c8aaab (diff)
downloadpsn00bsdk-9f4891f95070c66ea9f1aba99d72724d4ab24e5a.tar.gz
Revised makefiles, added strtok(), command line arguments, SetHeapSize(), moved ISR and callback system to psxetc, moved debug font to psxgpu, fixed CD-ROM library crashing on PSIO, fixed interrupt callback setup to fix crashing on ResetGraph()
Diffstat (limited to 'libpsn00b/libc/malloc.s')
-rw-r--r--libpsn00b/libc/malloc.s11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpsn00b/libc/malloc.s b/libpsn00b/libc/malloc.s
index fdb196d..90f9bd4 100644
--- a/libpsn00b/libc/malloc.s
+++ b/libpsn00b/libc/malloc.s
@@ -38,6 +38,17 @@ InitHeap:
jr $ra
sw $0 , ND_SIZE($a0)
+
+# Changes the heap size without clearing or relocating the heap
+# a0 - Size of memory heap in bytes
+.global SetHeapSize
+.type SetHeapSize, @function
+SetHeapSize:
+ la $v1, _malloc_size
+ lw $v0, 0($v1)
+ jr $ra
+ sw $a1, 0($v1)
+
# Allocates a block of memory in the heap
# a0 - Size of memory block to allocate.