mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix importByteBufferAllocateDirect method
Summary: This diff fixes the importByteBufferAllocateDirect method. This was tested enabling importByteBufferAllocateDirect in ReadableMapBuffer.java changelog: [internal] internal Reviewed By: sammy-SC Differential Revision: D27867055 fbshipit-source-id: 9ef5e93ff6c7903782598dde1c499daa82cd467b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c9a69de962
commit
69a48ec9d4
+4
-1
@@ -26,7 +26,10 @@ ReadableMapBuffer::importByteBufferAllocateDirect() {
|
||||
// steps:
|
||||
// - Validate perf of this method vs importByteBuffer
|
||||
// - Validate that there's no leaking of memory
|
||||
return jni::JByteBuffer::allocateDirect(_serializedDataSize);
|
||||
auto ret = jni::JByteBuffer::allocateDirect(_serializedDataSize);
|
||||
std::memcpy(
|
||||
ret->getDirectBytes(), (void *)_serializedData, _serializedDataSize);
|
||||
return ret;
|
||||
}
|
||||
|
||||
jni::JByteBuffer::javaobject ReadableMapBuffer::importByteBuffer() {
|
||||
|
||||
Reference in New Issue
Block a user