Re: FastObj update
- From: "JiYuan Xie" <gdxjy@xxxxxxxxxxx>
- Date: Mon, 31 Oct 2005 13:46:29 +0800
Hi again:
Here is the way I came up with to eliminate the usage of the UseFastMM
define:
1,Add the following lines after the declaration of NeedRegisterModuleUnload:
var
GetMem: function (ASize: Integer): Pointer;
FreeMem: function (APointer: Pointer): Integer;
ReallocMem: function (APointer: Pointer; ANewSize: Integer): Pointer;
2,Insert the following lines just after the line of initializtion, before
the line of InitializeCriticalSection(vAcceleratorCS):
asm
sub esp, TYPE TMemoryManager
mov eax, esp
call System.GetMemoryManager
mov eax, [esp].TMemoryManager.GetMem
call GetActualAddress
mov [GetMem], eax
mov eax, [esp].TMemoryManager.FreeMem
call GetActualAddress
mov [FreeMem], eax
mov eax, [esp].TMemoryManager.ReallocMem
call GetActualAddress
mov [ReallocMem], eax
add esp, TYPE TMemoryManager
end;
3,
a,Replace all the references to FastGemMem, System@GetMem with GetMem
b,Replace all the references of FastFreeMem, System@FreeMem to FreeMem,
c,Replace all the references of FastReallocMem, System@ReallocMem to
ReallocMem
4,Modify all the {$ifdef UseFastMM}..{$else}..{$endif} wrapped statements
accorrdingly.
Regards,
JiYuan Xie
.
- Follow-Ups:
- Re: FastObj update
- From: Gabriel Corneanu
- Re: FastObj update
- References:
- FastObj update
- From: Gabriel Corneanu
- FastObj update
- Prev by Date: Re: FastObj update
- Next by Date: Re: FastObj update
- Previous by thread: Re: FastObj update
- Next by thread: Re: FastObj update
- Index(es):
Relevant Pages
|