Bug 1565396 - Annotate use of memcpy instead of memcpySafeWhenRacy in WebGLBuffer. r=hsivonen

Differential Revision: https://phabricator.services.mozilla.com/D37802

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jeff Gilbert 2019-08-05 06:26:56 +00:00
parent 0baa66f01b
commit 4aefa55c19

View File

@ -105,6 +105,12 @@ void WebGLBuffer::BufferData(GLenum target, uint64_t size, const void* data,
mContext->ErrorOutOfMemory("Failed to alloc index cache.");
return;
}
// memcpy out of SharedArrayBuffers can be racey, and should generally use
// memcpySafeWhenRacy. But it's safe here:
// * We only memcpy in one place.
// * We only read out of the single copy, and only after copying.
// * If we get data value corruption from racing read-during-write, that's
// fine.
memcpy(newIndexCache.get(), data, size);
uploadData = newIndexCache.get();
}