On 20-Jan-07, at 7:38 AM, Samuel Tardieu wrote:

> I also have a question regarding native_stack_pointer(). Would not the
> following version (in cpu-x86.h) be cleaner and more efficient?
>
> INLINE void *native_stack_pointer(void)
> {
>   register CELL esp asm("esp");
>   return (void*)esp+4;
> }
>
> (the +4 makes it an equivalent of the previous version with the x86
> ABI, as the 32 bits return value was pushed on the stack)

I guess it is a matter of taste. I prefer to be explicit with what's  
going on by putting this type of thing in an assembly file.

Note that efficiency is not a concern here, since native_stack_pointer 
() is called relatively rarely (when Factor starts, and when a  
callback is entered).

Slava


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to