Why can a T* be passed in register, but a unique_ptr cannot?

Is this actually an ABI requirement, or maybe it’s just some pessimization in certain scenarios? One example is System V Application Binary Interface AMD64 Architecture Processor Supplement. This ABI is for 64-bit x86-compatible CPUs (Linux x86_64 architecure). It is followed on Solaris, Linux, FreeBSD, macOS, Windows Subsystem for Linux: If a C++ object has either … Read more

How exactly does the callstack work?

The call stack could also be called a frame stack. The things that are stacked after the LIFO principle are not the local variables but the entire stack frames (“calls”) of the functions being called. The local variables are pushed and popped together with those frames in the so-called function prologue and epilogue, respectively. Inside … Read more

Why does Windows64 use a different calling convention from all other OSes on x86-64?

Choosing four argument registers on x64 – common to UN*X / Win64 One of the things to keep in mind about x86 is that the register name to “reg number” encoding is not obvious; in terms of instruction encoding (the MOD R/M byte, see http://www.c-jump.com/CIS77/CPU/x86/X77_0060_mod_reg_r_m_byte.htm), register numbers 0…7 are – in that order – ?AX, … Read more

What is __stdcall?

__stdcall is the calling convention used for the function. This tells the compiler the rules that apply for setting up the stack, pushing arguments and getting a return value. There are a number of other calling conventions, __cdecl, __thiscall, __fastcall and the wonderfully named __declspec(naked). __stdcall is the standard calling convention for Win32 system calls. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)