2 ms·
Probably only useful for a non precise GC with ffi calls, when you don't know if the value on the stack is a large integer or a pointer. (For tagged values you
by rurban 6y ago
Probably only useful for a non precise GC with ffi calls, when you don't know if the value on the stack is a large integer or a pointer. (For tagged values you know it, but for ffi callbacks the stack can have non-tagged ptrs). But for this it would need more validations, if we own the vma region of not. Like inspecting the /proc/<pid>/map_files
Windows has a similar hack via IsBadreadPtr()
https://stackoverflow.com/questions/4595675/determining-whether-pointer-is-valid https://stackoverflow.com/questions/4595675/determining-whet... has some other answers for this problem.