Fix the Windows build of RocksDB Java. Similar to https://github.com/facebook/rocksdb/issues/1220 (#1284)

This commit is contained in:
Adam Retter 2016-08-25 18:16:26 +01:00 committed by Yueh-Hsuan Chiang
parent 7b81095171
commit f85f99bf69

View File

@ -2170,7 +2170,7 @@ jintArray Java_org_rocksdb_Options_maxBytesForLevelMultiplierAdditional(
const size_t size = mbflma.size();
jint additionals[size];
jint* additionals = new jint[size];
for (size_t i = 0; i < size; i++) {
additionals[i] = reinterpret_cast<jint>(mbflma[i]);
}
@ -2178,6 +2178,9 @@ jintArray Java_org_rocksdb_Options_maxBytesForLevelMultiplierAdditional(
jsize jlen = static_cast<jsize>(size);
jintArray result = env->NewIntArray(jlen);
env->SetIntArrayRegion(result, 0, jlen, additionals);
delete [] additionals;
return result;
}
@ -3477,7 +3480,7 @@ jintArray Java_org_rocksdb_ColumnFamilyOptions_maxBytesForLevelMultiplierAdditio
const size_t size = mbflma.size();
jint additionals[size];
jint* additionals = new jint[size];
for (size_t i = 0; i < size; i++) {
additionals[i] = reinterpret_cast<jint>(mbflma[i]);
}
@ -3486,6 +3489,9 @@ jintArray Java_org_rocksdb_ColumnFamilyOptions_maxBytesForLevelMultiplierAdditio
jintArray result;
result = env->NewIntArray(jlen);
env->SetIntArrayRegion(result, 0, jlen, additionals);
delete [] additionals;
return result;
}