Add macro trick to use libc malloc instead of calloc.
This commit is contained in:
10
kolibri.asm
10
kolibri.asm
@@ -3,6 +3,9 @@ format ELF
|
||||
__DEBUG__ = 1
|
||||
__DEBUG_LEVEL__ = 1
|
||||
|
||||
extrn malloc
|
||||
malloc fix __malloc
|
||||
_malloc fix malloc
|
||||
include 'macros.inc'
|
||||
include 'proc32.inc'
|
||||
include 'struct.inc'
|
||||
@@ -20,8 +23,6 @@ struct FILE_DISK
|
||||
Logical dd ? ; sector size
|
||||
ends
|
||||
|
||||
extrn calloc
|
||||
|
||||
purge section,mov,add,sub
|
||||
section '.text' executable align 16
|
||||
|
||||
@@ -162,12 +163,13 @@ proc disk_querymedia stdcall, hd_data, mediainfo
|
||||
endp
|
||||
|
||||
|
||||
malloc:
|
||||
__malloc:
|
||||
push ecx edx
|
||||
ccall calloc, 1, eax
|
||||
ccall _malloc, eax
|
||||
pop edx ecx
|
||||
ret
|
||||
|
||||
|
||||
proc kernel_alloc _size
|
||||
mov eax, [_size]
|
||||
call malloc
|
||||
|
Reference in New Issue
Block a user