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__ = 1
|
||||||
__DEBUG_LEVEL__ = 1
|
__DEBUG_LEVEL__ = 1
|
||||||
|
|
||||||
|
extrn malloc
|
||||||
|
malloc fix __malloc
|
||||||
|
_malloc fix malloc
|
||||||
include 'macros.inc'
|
include 'macros.inc'
|
||||||
include 'proc32.inc'
|
include 'proc32.inc'
|
||||||
include 'struct.inc'
|
include 'struct.inc'
|
||||||
@@ -20,8 +23,6 @@ struct FILE_DISK
|
|||||||
Logical dd ? ; sector size
|
Logical dd ? ; sector size
|
||||||
ends
|
ends
|
||||||
|
|
||||||
extrn calloc
|
|
||||||
|
|
||||||
purge section,mov,add,sub
|
purge section,mov,add,sub
|
||||||
section '.text' executable align 16
|
section '.text' executable align 16
|
||||||
|
|
||||||
@@ -162,12 +163,13 @@ proc disk_querymedia stdcall, hd_data, mediainfo
|
|||||||
endp
|
endp
|
||||||
|
|
||||||
|
|
||||||
malloc:
|
__malloc:
|
||||||
push ecx edx
|
push ecx edx
|
||||||
ccall calloc, 1, eax
|
ccall _malloc, eax
|
||||||
pop edx ecx
|
pop edx ecx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
proc kernel_alloc _size
|
proc kernel_alloc _size
|
||||||
mov eax, [_size]
|
mov eax, [_size]
|
||||||
call malloc
|
call malloc
|
||||||
|
Reference in New Issue
Block a user