mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
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:
parent
0baa66f01b
commit
4aefa55c19
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user