http://pubs.opengroup.org/onlinepubs/7908799/xsh/realloc.htm...
http://pubs.opengroup.org/onlinepubs/7908799/xsh/realloc.htm...
You know, like Rust.
So do that then.
And dangling pointers result in use-after-free, which frequently results in remote code execution vulnerabilities. Do you have a practical alternative to eliminating those RCE vulnerabilities, or should we accept them?
To be clear, your position is an intellectually coherent one to take. But we should be clear about its implications.
- The reason why we use GC pointers in Servo is that JavaScript is garbage collected, and we can't do anything about that. If not for that, we probably wouldn't use GC at all.
- In fact, to prove this point, we don't use GC anywhere except the DOM. Most of my code is layout and rendering, which is GC-free, written in the safe language, and is very much not crippled in any way.
- GC pointers are designed to be safe. There are some known safety holes right now, mainly due to lack of time to plug them and wanting to balance the time spent to fix up the current system against the time needed to add proper GC support to Rust.
> The pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object in the space allocated (until the space is explicitly freed or reallocated).
(Emphasis added.) After realloc() succeeds, you can no longer use the original pointer.