From 1827396bccd04b1a84e13299528bd2c73aadeead Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Fri, 11 Jul 2008 10:49:21 +0000 Subject: [PATCH] bugfixes in 68.20 for decreasing allocated memory size git-svn-id: svn://kolibrios.org@823 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/heap.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel/trunk/core/heap.inc b/kernel/trunk/core/heap.inc index 89933a3e8b..b6a9f3bb13 100644 --- a/kernel/trunk/core/heap.inc +++ b/kernel/trunk/core/heap.inc @@ -949,8 +949,8 @@ user_realloc: lea eax, [ecx+1] shl eax, 12 push eax - add ecx, ebx - add edx, ecx + add ecx, edx + lea edx, [ecx+ebx] shl ebx, 12 jz .ret push esi @@ -962,11 +962,12 @@ user_realloc: jae .merge_done mov eax, [page_tabs+edx*4] test al, USED_BLOCK - jz .merge_done + jnz .merge_done and dword [page_tabs+edx*4], 0 - and eax, not 0xFFF - add ebx, eax + shr eax, 12 add edx, eax + shl eax, 12 + add ebx, eax jmp @b .merge_done: pop esi