Function js::jsapi::JS_GetArrayBufferData
[−]
[src]
pub unsafe extern "C" fn JS_GetArrayBufferData(
obj: *mut JSObject,
isSharedMemory: *mut bool,
arg1: *const AutoCheckCannotGC
) -> *mut u8
Return a pointer to the start of the data referenced by a typed array. The data is still owned by the typed array, and should not be modified on another thread. Furthermore, the pointer can become invalid on GC (if the data is small and fits inside the array's GC header), so callers must take care not to hold on across anything that could GC.
|obj| must have passed a JS_IsArrayBufferObject test, or somehow be known that it would pass such a test: it is an ArrayBuffer or a wrapper of an ArrayBuffer, and the unwrapping will succeed.
*isSharedMemory will be set to false, the argument is present to simplify its use from code that also interacts with SharedArrayBuffer.