Re: FastObj update
- From: "Gabriel Corneanu" <gabrielcorneanu@xxxxxxxxxxxxxxxx>
- Date: Mon, 31 Oct 2005 07:42:18 +0100
Hi,
This should obviously work, but it will introduce a new variable which must
be dereferenced. That's why I introduced "ifdef". A (true untyped) constant
would work by being replaced, not referenced (like a macro in C).
And I didn't retain your changes to have them everywhere because it doesn't
matter during initializing. All the ways go to the same MM. Only when speed
is important I tried to use less calls.
Gabriel
"JiYuan Xie" <gdxjy@xxxxxxxxxxx> wrote in message
news:4365af9a@xxxxxxxxxxxxxxxxxxxxxxxxx
> 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
>
>
>
.
- References:
- FastObj update
- From: Gabriel Corneanu
- Re: FastObj update
- From: JiYuan Xie
- FastObj update
- Prev by Date: Re: FastObj update
- Next by Date: FastMM4 bug?
- Previous by thread: Re: FastObj update
- Next by thread: Re: FastObj update
- Index(es):
Relevant Pages
|