Skip to content

Commit b5e6b8d

Browse files
calc84maniacmateoconlechuga
authored andcommitted
Fix ABI issues in calloc implementation
1 parent 81b9a3d commit b5e6b8d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libc/allocator.src

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ _calloc:
1212
push de
1313
call __imulu
1414
push hl
15+
push hl
1516
call _malloc
17+
pop de
1618
add hl,de
1719
xor a,a
1820
sbc hl,de
1921
ld e,a
2022
push de
2123
push hl
2224
call nz,_memset
23-
pop hl
2425
pop de
25-
pop bc
26+
pop de
27+
pop de
2628
ret
2729

2830
if defined ALLOCATOR_SIMPLE

0 commit comments

Comments
 (0)