45 ms·
"A correctly-specified ABI should pass large structures by immutable reference" There is no such thing at the level that the ABI works, especially at a kernel-
by foobiekr 6y ago
"A correctly-specified ABI should pass large structures by immutable reference"
There is no such thing at the level that the ABI works, especially at a kernel-userland boundary (where the choice is to fully marshal the arguments or accept that you have a TOCTOU issue).
- legulere 6y agoCallee saved registers kind of work like that. You either don't touch those registers, or you restore them before returning.
- user-the-name 6y agoAn ABI is a contract. If it wants to say that a pointer is an immutable reference, all it needs to do is to say "this pointer is an immutable reference", and specify what that means. It is up to those who follow that contract to follow those rules. You ABI could say a pointer may only be accessed on Wednesdays if it really wanted to.
- omnicognate 6y agoWednesdays in what timezone and by what clock?
- varajelle 6y agoEven if we assume the computer's own internal clock, we would have a race condition if the computer goes to sleep on Wednesday afternoon just after a call to that function is done, and woken up in the next day. Sounds like a really impractical ABI.
- user-the-name 6y agoThat's a shame, because imagine how useful it would be to have pointers you can only access on Wednesdays.