[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] Proposal for SLB extension



Hi Julian!

JW>The backdraw of your proposal is that you have to check wheter the 
JW>basepage pointer is needed at run time. So your code has to deal with 
JW>both possibilities.
JR>Not true. He could just simply supply two different function call
JR>handlers.
Which is one kind of dealing with this problem

JW>And if there are two different implementation of the same lib you will
JW>run into trouble.
JR>Why would this be a problem.
The (not clearly stated) context was that the application supports only one
kind of libraries

But think a little bit of the expense of supporting two handlers:
The fastest way I know is to decide which one to use an then saving the
address of the used one in an variable and then letting the stub called by
the application make a jump to the content of this variable.
In asm:

stub:
    move.l used_handler, a0
    jmp (a0)

Can someone tell me why this should be faster than

    move.l basepage, -(sp)
    
(as I don't know the interface for shared lib calls I assume the parameter is
passed on the stack, which is slower than the passing in a register)

AFAIK both need 28 cycles (on 68000), but the first one needs more memory
than the second and I haven't counted the memory for the second handler

So, where is the advantage of not passing the basepage address?

Bye

                Joerg