On Tue, 09 Jun 2009, Mindaugas Kavaliauskas wrote:

Hi,

> Oh, yes. I've confused myself. These frames are overlapping, but not the 
> same! I forgot about HB_EXECMSG symbol and NIL.
> But this approach
>    hb_itemCopy( hb_stackBaseItem(), pValue )
>    HB_VM_EXECUTE( pValue ); // Well, it lacks EG_NOFUNC check
> seems to hack for my without additional function redirection support from 
> HVM.

Yes, it will work and such method is already used in HVM. F.e. in classy
code for SYNC methods.

> Speed test for HashObject() class variable access:
>    FOR nI := 1 TO 10000000
>      nS += oObj:nNumber
>    NEXT
> PRG error handler:          25.907 s
> C error handler:            10.703 s
> C with hb_stackAllocItem():  9.797 s
> Native object variable:      5.366 s
> Loop overhead (nS+=1 loop):  1.875 s

For sure it's the fastest version and the speed difference will be
even bigger if you increase number of method parameters.

I plan to add to classy code such default error handler function so
it can be used in this class as:
   ERROR HANDLER FUNCTION <funcName>
and HB_HASHOBJECT() to RTL. It's very nice solution which cleanly
adds OOP interface to hash arrays without reducing other functionality
like user defined scalar class for hash arrays.

I hope that I can use your code covered by Harbour licence. Can I?

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to