forked from KolibriOS/kolibrios
* Fixed bugs in user_alloc and user_free.
* 'stdcall' procedures now do not generate stupid 'ret 0' (useful when compiling with FASM before 1.66) git-svn-id: svn://kolibrios.org@213 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
f96c2c867c
commit
44a74d9138
@ -680,6 +680,7 @@ l_0:
|
|||||||
and eax, 0xFFFFF000
|
and eax, 0xFFFFF000
|
||||||
cmp eax, ecx ;alloc_size
|
cmp eax, ecx ;alloc_size
|
||||||
jb m_next
|
jb m_next
|
||||||
|
jz @f
|
||||||
|
|
||||||
mov edx, esi
|
mov edx, esi
|
||||||
add edx, ecx
|
add edx, ecx
|
||||||
@ -687,7 +688,7 @@ l_0:
|
|||||||
or eax, FREE_BLOCK
|
or eax, FREE_BLOCK
|
||||||
shr edx, 12
|
shr edx, 12
|
||||||
mov [pages_tab+edx*4], eax
|
mov [pages_tab+edx*4], eax
|
||||||
|
@@:
|
||||||
or ecx, USED_BLOCK
|
or ecx, USED_BLOCK
|
||||||
mov [pages_tab+ebx*4], ecx
|
mov [pages_tab+ebx*4], ecx
|
||||||
shr ecx, 12
|
shr ecx, 12
|
||||||
@ -753,6 +754,8 @@ proc user_free stdcall, base:dword
|
|||||||
shl ebx, 8
|
shl ebx, 8
|
||||||
mov esi, dword [ebx+PROC_BASE+APPDATA.heap_base]; heap_base
|
mov esi, dword [ebx+PROC_BASE+APPDATA.heap_base]; heap_base
|
||||||
mov edi, dword [ebx+PROC_BASE+APPDATA.heap_top]; heap_top
|
mov edi, dword [ebx+PROC_BASE+APPDATA.heap_top]; heap_top
|
||||||
|
add esi, new_app_base
|
||||||
|
add edi, new_app_base
|
||||||
shr esi, 12
|
shr esi, 12
|
||||||
shr edi, 12
|
shr edi, 12
|
||||||
@@:
|
@@:
|
||||||
|
@ -71,7 +71,7 @@ macro epiloguedef procname,flag,parmbytes,localbytes,reglist
|
|||||||
if parmbytes | localbytes
|
if parmbytes | localbytes
|
||||||
leave
|
leave
|
||||||
end if
|
end if
|
||||||
if flag and 10000b
|
if (flag and 10000b) | (parmbytes=0)
|
||||||
retn
|
retn
|
||||||
else
|
else
|
||||||
retn parmbytes
|
retn parmbytes
|
||||||
|
Loading…
Reference in New Issue
Block a user