mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Integrate react_native_asserts into mapbuffer
Summary: Integrate react_native_asserts into mapbuffer changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D27753092 fbshipit-source-id: dbeb7f140f3096c8153e2f6bced4e4d9d88b48b8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e57de5f32f
commit
aee07e1203
@@ -33,12 +33,9 @@ MapBufferBuilder::MapBufferBuilder(uint16_t initialSize) {
|
||||
|
||||
void MapBufferBuilder::ensureKeyValueSpace() {
|
||||
int oldKeyValuesSize = keyValuesSize_;
|
||||
if (keyValuesSize_ >= std::numeric_limits<uint16_t>::max() / 2) {
|
||||
LOG(ERROR)
|
||||
<< "Error: trying to assign a value beyond the capacity of uint16_t"
|
||||
<< static_cast<uint32_t>(keyValuesSize_) * 2;
|
||||
abort();
|
||||
}
|
||||
react_native_assert(
|
||||
(keyValuesSize_ >= std::numeric_limits<uint16_t>::max() / 2) &&
|
||||
"Error trying to assign a value beyond the capacity of uint16_t");
|
||||
keyValuesSize_ *= 2;
|
||||
uint8_t *newKeyValues = new Byte[keyValuesSize_];
|
||||
uint8_t *oldKeyValues = keyValues_;
|
||||
|
||||
Reference in New Issue
Block a user