From 2e14ef3302ad597bd3fa5e6628a6afb703af47a1 Mon Sep 17 00:00:00 2001 From: "Marat Zakiyanov (Mario79)" Date: Fri, 29 Nov 2013 18:31:49 +0000 Subject: [PATCH] A patch for f.64 - now you can not ask for more memory than available of free memory. git-svn-id: svn://kolibrios.org@4313 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/sys32.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/trunk/core/sys32.inc b/kernel/trunk/core/sys32.inc index 849835afb7..8adfd99a1d 100644 --- a/kernel/trunk/core/sys32.inc +++ b/kernel/trunk/core/sys32.inc @@ -386,7 +386,18 @@ sys_resize_app_memory: ; cmp eax,1 dec ebx jnz .no_application_mem_resize + + mov eax, [pg_data.pages_free] + shl eax, 12 + cmp eax, ecx + jae @f + + xor eax, eax + inc eax + jmp .store_result +@@: stdcall new_mem_resize, ecx +.store_result: mov [esp+32], eax .no_application_mem_resize: ret