mPtr is assigned to the pointer returned by enqueue and it is then wrapped into a buffer. The buffer is returned. If the user does an enqueueUnmap*, mPtr is freed, but the buffer object might still be around, and accessing that is bad news.
To make matters worse, ArrayBuffers can be sliced and TypedArray views can be wrapped around them, and all those instances become unsafe.
No trivial fix for this, except copying, which would suck.
mPtr is assigned to the pointer returned by enqueue and it is then wrapped into a buffer. The buffer is returned. If the user does an enqueueUnmap*, mPtr is freed, but the buffer object might still be around, and accessing that is bad news.
To make matters worse, ArrayBuffers can be sliced and TypedArray views can be wrapped around them, and all those instances become unsafe.
No trivial fix for this, except copying, which would suck.