From 5aa81d7197043ec294fee7d628dbd09ca638317d Mon Sep 17 00:00:00 2001 From: "Mihail Semenyako (mike.dld)" Date: Sat, 15 Sep 2007 10:04:04 +0000 Subject: [PATCH] Revert back to old mem.ReAlloc implementation using 68.12 and 68.13 git-svn-id: svn://kolibrios.org@626 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/tinypad/trunk/tp-common.asm | 40 ++++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/programs/develop/tinypad/trunk/tp-common.asm b/programs/develop/tinypad/trunk/tp-common.asm index 6ec9a16dfc..7d5369b53d 100644 --- a/programs/develop/tinypad/trunk/tp-common.asm +++ b/programs/develop/tinypad/trunk/tp-common.asm @@ -586,8 +586,8 @@ endp proc mem.Alloc,size ;///////////////////////////////////////////////////////// ;----------------------------------------------------------------------------- push ebx ecx - mov eax,[size] - lea ecx,[eax+4+4095] + mov ecx,[size] + add ecx,4+4095 and ecx,not 4095 mcall 68,12 add ecx,-4 @@ -597,7 +597,13 @@ proc mem.Alloc,size ;///////////////////////////////////////////////////////// ret @^ push ebx ecx - mcall 68,12,[size] + mov eax,[size] + lea ecx,[eax+4+4095] + and ecx,not 4095 + mcall 68,12 + add ecx,-4 + mov [eax],ecx + add eax,4 pop ecx ebx ret ^@ @@ -606,6 +612,20 @@ endp ;----------------------------------------------------------------------------- proc mem.ReAlloc,mptr,size ;////////////////////////////////////////////////// ;----------------------------------------------------------------------------- +@^ + push ebx ecx edx + mov ecx,[size] + add ecx,4+4095 + and ecx,not 4095 + mov edx,[mptr] + add edx,-4 + mcall 68,20 + add ecx,-4 + mov [eax],ecx + add eax,4 + pop edx ecx ebx + ret +^@ push ebx ecx esi edi eax mov eax,[mptr] mov ebx,[size] @@ -636,26 +656,22 @@ proc mem.ReAlloc,mptr,size ;////////////////////////////////////////////////// .exit: pop eax edi esi ecx ebx ret -@^ - push ebx ecx edx - mcall 68,20,[size],[mptr] - pop edx ecx ebx - ret -^@ endp ;----------------------------------------------------------------------------- proc mem.Free,mptr ;////////////////////////////////////////////////////////// ;----------------------------------------------------------------------------- push ebx ecx - mov eax,[mptr] - lea ecx,[eax-4] + mov ecx,[mptr] + add ecx,-4 mcall 68,13 pop ecx ebx ret @^ push ebx ecx - mcall 68,13,[mptr] + mov eax,[mptr] + lea ecx,[eax-4] + mcall 68,13 pop ecx ebx ret ^@