From 44a74d9138a188c25045c9df963d4acdc10bc5b8 Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Fri, 17 Nov 2006 12:34:35 +0000 Subject: [PATCH] * 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 --- kernel/trunk/core/heap.inc | 5 ++++- kernel/trunk/proc32.inc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/trunk/core/heap.inc b/kernel/trunk/core/heap.inc index e02faf8ce3..090e6278ab 100644 --- a/kernel/trunk/core/heap.inc +++ b/kernel/trunk/core/heap.inc @@ -680,6 +680,7 @@ l_0: and eax, 0xFFFFF000 cmp eax, ecx ;alloc_size jb m_next + jz @f mov edx, esi add edx, ecx @@ -687,7 +688,7 @@ l_0: or eax, FREE_BLOCK shr edx, 12 mov [pages_tab+edx*4], eax - +@@: or ecx, USED_BLOCK mov [pages_tab+ebx*4], ecx shr ecx, 12 @@ -753,6 +754,8 @@ proc user_free stdcall, base:dword shl ebx, 8 mov esi, dword [ebx+PROC_BASE+APPDATA.heap_base]; heap_base 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 edi, 12 @@: diff --git a/kernel/trunk/proc32.inc b/kernel/trunk/proc32.inc index 23c56b03c1..98a1bd3342 100644 --- a/kernel/trunk/proc32.inc +++ b/kernel/trunk/proc32.inc @@ -71,7 +71,7 @@ macro epiloguedef procname,flag,parmbytes,localbytes,reglist if parmbytes | localbytes leave end if - if flag and 10000b + if (flag and 10000b) | (parmbytes=0) retn else retn parmbytes