(no title)
mahkoh | 1 year ago
IIRC, one justification for this was to account for systems with non-flat memory where inspecting the value of the old pointer might cause a processor exception.
mahkoh | 1 year ago
IIRC, one justification for this was to account for systems with non-flat memory where inspecting the value of the old pointer might cause a processor exception.
nine_k|1 year ago
RustyRussell|1 year ago
This is legal. But dereferencing old_pointer even after this check had passed is undefined.
anttihaapala|1 year ago
C89 says that "The value of a pointer that refers to freed space is indeterminate." and that behavior is undefined "upon use ... of indeterminately-valued objects", hence a compiled program can e.g. behave as if `new_pointer == old_pointer` even though the object was relocated in memory.
teo_zero|1 year ago
saagarjha|1 year ago
matheusmoreira|1 year ago
That wheel is certainly in need of some serious reinvention anyway. This seems like a good starting point:
https://nullprogram.com/blog/2023/12/17/
Scaevolus|1 year ago