Logo
BASIC: Where GOTOs roam free.
  • Home
  • Hot
  • Random
  • Search

Browse

  • AI AI
  • AWS AWS
  • Agile Agile
  • Algorithms Algorithms
  • Android Android
  • Apple Apple
  • Azure Azure
  • Backend Backend
  • Bash Bash
  • C++ C++
  • Cloud Cloud
  • All Categories
As an Amazon Associate ProgrammerHumor.io earns from qualifying purchases.

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

Name mangling Memes

Posts tagged with Name mangling

Hand-Written Mangled Symbols Save The Day

C++ Gamedev
6 hours ago 19.0K views 0 shares
Hand-Written Mangled Symbols Save The Day
The EA memory card library was compiled with a different C++ ABI than the game, so the linker couldn't find the symbols it needed. The fix was to skip the compiler's name mangling and type every mangled name by hand. Each one is declared inside an extern "C" block. Each also gets a wrapper that takes void* for everything and forwards to the real symbol. Look at the names. Save__Q211RealmcIface16MemcardInterfacePCcN21PCQ211RealmcIface8SaveInfo... is a C++ method that the compiler encoded as a string. The encoding holds the namespace, class, argument types, const-ness and pointer depth. Somebody had to get it character-perfect, and one wrong letter means a linker error. The void* parameters mean they gave up on types entirely. The linker only matches names, so the types didn't matter. It's ugly, and it shipped on a game that sold millions. That's a decent argument that "ugly but working" beats "elegant but late" in game dev. Somewhere a dev typed PCQ211RealmcIface9TitleInfo a few times and decided it was a problem for future them.

Today's picks

Poor Jensen

Poor Jensen

Hardware
131.1M views 23 days ago
NordVPN

NordVPN

Sponsored
VPN
Never Forget Shirt Vintage Media Retro Technology Graphic T-Shirt LT Charcoal

Never Forget Shirt Vintage Media Retro Technology Graphic T-Shirt LT Charcoal

Affiliate
$19.99