 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
JiYuan Xie Guest
|
Posted: Mon Oct 31, 2005 3:53 am Post subject: Re: FastObj update |
|
|
Hi, Gabriel:
It seems that the memory of FFinalizeArray is not freed in
TObjectAccelerator.Destroy.
BTW, the value of FTemplateVMT is the same as the value of FClass
actually.
Regards,
JiYuan Xie
|
|
| Back to top |
|
 |
JiYuan Xie Guest
|
Posted: Mon Oct 31, 2005 5:46 am Post subject: Re: FastObj update |
|
|
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
|
|
| Back to top |
|
 |
Gabriel Corneanu Guest
|
Posted: Mon Oct 31, 2005 6:31 am Post subject: Re: FastObj update |
|
|
"JiYuan Xie" <gdxjy (AT) hotmail (DOT) com> wrote
| Quote: | Hi, Gabriel:
It seems that the memory of FFinalizeArray is not freed in
TObjectAccelerator.Destroy.
BTW, the value of FTemplateVMT is the same as the value of FClass
actually.
Regards,
JiYuan Xie
|
Hi,
You're completely right.
I wanted to finish it on Sunday and I hurried up too much.
Now it's reposted.
Thanks,
Gabriel
|
|
| Back to top |
|
 |
Gabriel Corneanu Guest
|
Posted: Mon Oct 31, 2005 6:42 am Post subject: Re: FastObj update |
|
|
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 (AT) hotmail (DOT) com> wrote
| Quote: | 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
|
|
|
| Back to top |
|
 |
Dennis Guest
|
Posted: Mon Oct 31, 2005 10:32 am Post subject: Re: FastObj update |
|
|
Hi Fastcode Community
| Quote: | Posted to .attachments (as well as sourceforge:
[url]http://sourceforge.net/projects/fastcode)[/url].
Comments welcome.
|
Why is it uploaded under Fastcode?
I think that it is not a Fastcode project. It has not been benchmark or
validated as a Fastcode function is. There is no challenge for it and no
B&V.
Best regards
Dennis Kjaer Christensen
|
|
| Back to top |
|
 |
Gabriel gabrielcorneanuAT Guest
|
Posted: Mon Oct 31, 2005 11:29 am Post subject: Re: FastObj update |
|
|
"Dennis" <marianndkc (AT) home3 (DOT) gvdnet.dk> wrote:
| Quote: | Hi Fastcode Community
Posted to .attachments (as well as sourceforge:
[url]http://sourceforge.net/projects/fastcode)[/url].
Comments welcome.
Why is it uploaded under Fastcode?
I think that it is not a Fastcode project. It has not been benchmark or
validated as a Fastcode function is. There is no challenge for it and no
B&V.
Best regards
Dennis Kjaer Christensen
|
Hi,
Sorry for misleading words.
It is just part of the CVS repository. Eric proposed to use a folder in the repository.
Regards,
Gabriel
|
|
| Back to top |
|
 |
Eric Grange Guest
|
Posted: Wed Nov 02, 2005 10:01 am Post subject: Re: FastObj update |
|
|
| Quote: | Why is it uploaded under Fastcode?
|
Is there another CVS or shared code repository for fastcode or
fastcode-related projects available?
It's there under an "experimental" subdirectory.
Eric
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|