calling-convention

Is fastcall really faster?

Hi, Is the fastcall calling convention really faster than other calling conventions, such as cdecl? Are there any benchmarks out there that show how performance is affected by calling convention? ...

Pass the current state of a function into another function in C/C++

Is there a way to pass the current state of a function into another function in C/C++? I mean all the parameters and local variables by current state. For example: void funcA (int a, int b) { char c; int d, e; // Do something with the variables. // ... funcB(); // Do something more. } void funcB() { // funcB...

Can I programatically deduce the calling convention used by a C++ dll?

Imagine you'd like to write a program that tests functions in a c++ dll file. You should enable the user to select a dll (we assume we are talking about c++ dlls). He should be able to obtain a list of all functions exported by the dll. Then, the user should be able to select a function name from the list, manually input a list of argume...

What are custom calling conventions?

Possible Duplicate: What are the different calling conventions in C/C++ and what do each mean? What are these? And how am I affected by these as a developer? ...

Question about Objective C calling convention and argument passing on ARM

I want to know how objective C runtime handle arguments when I call a objective C method like [NSString stringWithFomat:@"%@, %@", @"Hello", @"World"] There are three arguments for this objective C call, how does it work compared to typical way on a ARM system. I have known register r0, r1, r2, r3 will hold first 4 arguments, how abou...

How is return address specified in stack?

This is what I see by disassemble for the statement function(1,2,3);: movl $0x3,0x8(%esp) movl $0x2,0x4(%esp) movl $0x1,(%esp) call 0x4012d0 <_Z8functioniii> It seems the ret address is not pushed into stack at all,then how does ret work? ...

Pass a Delphi class to a C++ function/method that expects a class with __thiscall methods.

I have some MSVC++ compiled DLL's for which I have created COM-like (lite) interfaces (abstract Delphi classes). Some of those classes have methods that need pointers to objects. These C++ methods are declared with the __thiscall calling convention (which I cannot change), which is just like __stdcall, except a this pointer is passed o...

How do I compile boost using __cdecl calling convention?

I have a project compiled using __cdecl calling convention (msvc2010) and I compiled boost using the same compiler using the default settings. The project linked with boost but I at runtime I got an assert message like this: File: ...\boost\boost\program_options\detail\parsers.hpp Line: 79 Run-Time Check Failure #0 - The value of ESP w...

What is on the 68000 stack when classic MacOS enters a program?

I'm trying to understand an old classic Mac application's entry point. I've disassembled the first CODE resource (not CODE#0, which is the jump table). The code refers to some variables off the stack: a word at 0004(A7), an array of long words of starting at 000C(A7) whose length is the value at 0004(A7), and a final long word beyond tha...

JAVE function call form JSP page is not returning value

I am calling a java function from JSP page which returns file name after creationg a XML file. In some cases where size of file is large(Java function execution takes much time due to large data) it is returning blank where as XML file is genertaed after some time. Can any one help me to get the file name in this case so that user can kn...

iPhone/ARM calling convention

Hi all, on iPhone/ARM, which CPU registers are functions supposed to preserve, if any? ...

C callback functions defined in an unnamed namespace?

Hi all. I have a C++ project that uses a C bison parser. The C parser uses a struct of function pointers to call functions that create proper AST nodes when productions are reduced by bison: typedef void Node; struct Actions { Node *(*newIntLit)(int val); Node *(*newAsgnExpr)(Node *left, Node *right); /* ... */ }; Now, in the C+...

How to get calling convension of a function from type library?

Hello, how can I get calling convention at run time using type library ? whether stdcall,cdecl or winapi or any other? Regards Usman ...

Any real use case for using the calling convention fastcall?

Hi, Have you had any real use case for using the calling convention fastcall? Thanks. ...

Could someone explain __declspec(naked) please?

I'm looking into porting a script engine written for Windows to Linux; it's for Winamp's visualization platform AVS. I'm not sure if it's even possible at the moment. From what I can tell the code is taking the addresses of the C functions nseel_asm_atan and nseel_asm_atan_end and storing them inside a table that it can reference during ...

Calling SDL/OpenGL from Assembly code on Linux

I'm write a simple graphic-based program in Assembly for learning purpose; for this, I intended to use either OpenGL or SDL. I'm trying to call OpenGL/SDL's function from assembly. The problem is, unlike many assembly and OpenGL/SDL tutorials I found in the internet, the OpenGL/SDL in my machine apparently doesn't use C calling conventi...

How to pass a pointer to a member function to a C function?

Possible Duplicate: Using a C++ class member function as a C callback function I'm writing an object-oriented library using a C library (winpcap). I need to pass the callback function that is called when a network packet arrives as a function pointer. I would like to pass a member function pointer to winpcap, to keep my design...

What is mean by epilog and prolog?

hi , While reading some calling convention in some CPU architecture i read something like "epilog and prolog" , when a function is called from another function. Can anybody give more inputs on this? /renjith_g ...

ARM calling conventions on WinCE and Linux?

Do WinCE and Linux use the same calling convention on ARM? What are the differences? The documents I've found so far do not explain very well. For example on http://msdn.microsoft.com/en-us/library/ms864497.aspx, it says "Windows CE .NET Compiler" on one line, but "the ARM compiler" on the next line, and "CLARM" at the bottom, and it's ...

Including a PHP class file only once

I'm using methods from a PHP class all over my code and I don't want to do "require_once" in every file I'm using that class. Is there a way to include the class in a single file, and then access it from everywhere in the code? Thanks! ...