BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: FastObj update

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM
View previous topic :: View next topic  
Author Message
JiYuan Xie
Guest





PostPosted: Mon Oct 31, 2005 3:53 am    Post subject: Re: FastObj update Reply with 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


Back to top
JiYuan Xie
Guest





PostPosted: Mon Oct 31, 2005 5:46 am    Post subject: Re: FastObj update Reply with 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
Gabriel Corneanu
Guest





PostPosted: Mon Oct 31, 2005 6:31 am    Post subject: Re: FastObj update Reply with quote




"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





PostPosted: Mon Oct 31, 2005 6:42 am    Post subject: Re: FastObj update Reply with quote

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





PostPosted: Mon Oct 31, 2005 10:32 am    Post subject: Re: FastObj update Reply with quote

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





PostPosted: Mon Oct 31, 2005 11:29 am    Post subject: Re: FastObj update Reply with quote


"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





PostPosted: Wed Nov 02, 2005 10:01 am    Post subject: Re: FastObj update Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.