Tests show that Global / Local functions are more robust and catch invalid pointers, to the contrary to heap functions.
I'd like to relax a bit the heap quick pointer validation, in order to avoid looping over the heap regions on every call, and to reduce the locking requirements, though this would then break the globalmem invalid pointer tests, unless they validate the pointers beforehand.
They should maybe use exception handlers rather than pointer validation, but the result is the same. I can change that if it matters.