Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7964931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:01:35+00:00 2026-06-04T06:01:35+00:00

I have seen the fastcall notation appended before many functions. Why it is used?

  • 0

I have seen the fastcall notation appended before many functions. Why it is used?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:01:36+00:00Added an answer on June 4, 2026 at 6:01 am

    That notation before the function is called the “calling convention.” It specifies how (at a low level) the compiler will pass input parameters to the function and retrieve its results once it’s been executed.

    There are many different calling conventions, the most popular being stdcall and cdecl.

    You might think there’s only one way of doing it, but in reality, there are dozens of ways you could call a function and pass variables in and out. You could place the input parameters on a stack (push, push, push to call; pop, pop, pop to read input parameters). Or perhaps you would rather stick them in registers (this is fastcall – it tries to fit some of the input params in registers for speed).

    But then what about the order? Do you push them from left to right or right to left? What about the result – there’s always only one (assuming no reference parameters), so do you place the result on the stack, in a register, at a certain memory address?

    Also, let’s assume you’re using the stack for communication – who’s job is it to actually clear the stack after the function is called – the caller or the callee?

    What about backing up and then restoring the contents of (certain) CPU registers – should the caller do it, or will the callee guarantee that it’ll return everything the way it was?

    The most popular calling convention (by far) is cdecl, which is the standard calling convention in both C and C++. The WIN32 API uses stdcall, which means any code that calls the WIN32 API needs to use stdcall for those function calls (making it another popular choice).

    fastcall is a bit of an oddball – people realized for many functions with only one in/out parameter, pushing and popping from a memory-based stack is quite a bit of overhead and makes function calls a little bit heavy so the different compilers introduced (different) calling conventions that will place one or more parameters in registers before placing the rest in the stack for better performance. The problem is, not all compilers used the same rules for what goes where and who does what with fastcall, and as a result you have to be careful when using it because you’ll never know who does what. Finally, see Is fastcall really faster? for info on fastcall performance benefits.

    Complicated stuff.

    Something important to keep in mind: don’t add or change calling conventions if you don’t know exactly what you’re doing, because if both the caller and the callee do not agree on the calling convention, you’ll likely end up with stack corruption and a segfault. This usually happens when you have the function being called in a DLL/shared library and a program is written that depends on the DLL/SO/dylib being a certain calling convention (say, cdecl), then the library is recompiled with a different calling convention (say, fastcall). Now the old program can no longer communicate with the new library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen two commonly used techniques for adding the directory of the file
I have seen many articles about POCO. What is this?
I have seen both exit and exec used in bash script to stop script
I have seen many posts about when to use ViewBag/ViewData vs ViewModel but i
I have seen many people telling that you can set setContentView outside the oncreate
I have seen many questions asking how to validate the presence of an association,
I have seen many repository pattern implementations. Specifically of 2 types They expose the
I have seen many 64-bit applications come in two 64-bit versions. One is x86-64
I have seen many tutorials, but they're so confusing, and to do what I
I have seen simple example Ajax source codes in many online tutorials. What I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.