5 ms·
Understanding the x64 code models (2012)
- eqvinox 4y agoThis article might benefit from a (reasonably visible) note somewhere that none of this is relevant to dynamically allocated memory. While it may be obvious/known to most of the target audience, it could easily be misunderstood by intermediate-level readers.
- layer8 4y agoThe article doesn’t address what happens if you pick the wrong (too small) model. I guess the static linker will catch certain cases, and the dynamic linker/loader will catch certain other cases, but will all cases be caught by one of those two, or can the compiled instructions end up being executed, leading to incorrect memory accesses?
- duskwuff 4y ago> The article doesn’t address what happens if you pick the wrong (too small) model. The (static) linker will realize that an address won't fit, or that it can't generate a required relocation, and will fail to generate an executable.
- kccqzy 4y agoI've never seen any real-world example where the large code model is being used on x64. Perhaps it's because I've seen programs where that's necessary. Perhaps the mythical 1.5GB Facebook binary (in 2012) that requires BitTorrent would use a non-small code model?
- jamesfinlayson 4y agoInteresting (https://arstechnica.com/information-technology/2012/04/exclusive-a-behind-the-scenes-look-at-facebook-release-engineering/ https://arstechnica.com/information-technology/2012/04/exclu...).
- johnklos 4y agoMinor nitpick: the author uses "Linux" as a keyword and uses gcc for examples but refers to the architecture as x64, which is a very Microsoft thing and a bit of a misnomer.
- chrisseaton 4y ago> but refers to the architecture as x64 What do you think the correct name is? I call it AMD64, as that's the name the authors gave it. But they also previously called it x86-64, so maybe that's valid. x86_64, x64, etc, no idea why people had to come up with their own names beyond AMD64 or x86-64!
- Joker_vD 4y agoWhat are you talking about? It's either Intel 64 or IA-32e, anything else is a misnomer! /s
- moonchild 4y agoDon't forget EM64T!
- chasil 4y agoWhile I default to AMD64, Intel 64 is the latest variant from the eponymous manufacturer. There is some justification for Intel 64, as AMD suffered a series of mistakes and bad decisions, starting with the "Barcelona" Opterons, only recently emerging from these problems. Intel has been the best-performing AMD64 implementation for much of this standard's time on the market, so a little revisionism must be excused.
- hulitu 4y agoIntel 64 ? You mean the Itanic ?
- chrisseaton 4y agoNo that's IA-64 - that's something else entirely. Intel 64 != IA-64.
- shadowofneptune 4y agoReminds me of the various models for the original 8086. Far pointers are gone, but having to use registers is a similar tradeoff.
- aicez 4y agoชวน3ผม