Re:Git's list of banned C functions
by kevin_thibedeau on Thursday March 04, 2021 @08:12PM
(#26351084)
On platforms with limited register sets, keeping length around burns a register that could be used for something else. From the mindset of assembler programmers wanting a high level language that suits them, a sentinel that doesn't consume extra machine resources was preferable. Not to mention all the precious RAM those multi-byte lengths squander.
[ Parent
| on HN ]
Ok, I hadn't considered the registers thing. That almost makes sense. Almost. But variable length arrays are so useful I think it warrants adding a register just for dealing with fat pointers.
Like I get why it happened. It is just crazy how long it has stuck around.