Hacker News new | ask | show | jobs
by microcolonel 3307 days ago
I regularly allocate buffers in excess of 40GiB on my workstation. Linux on x86-64 currently uses 47 out of 64 physical address bits to support up to 128TiB of physical addresses. This leaves 17 bits in a pointer for your size field. (2 ^ 47) / (2 ^ 17) is 1GiB, so the granularity of your bounds checking system would be 1GiB unless you made the userspace ABI dependent on the number of physical address bits.

If you store the bounds separately (full runtime bounds checking) you lose efficiency on code which inherently can not overflow the bounds, and code where you have a large number of small objects (let's say you have 400GiB of 64-byte objects) with a known size. If you switch to a new language, great! But you obviously lose access to your existing code, which is a non-starter.