mirror of https://gitee.com/bigwinds/arangodb
Bug fix/31012019 (#8078)
This commit is contained in:
parent
f466cdda6a
commit
d45906e569
|
@ -87,7 +87,7 @@ class AqlItemBlock {
|
|||
|
||||
public:
|
||||
/// @brief getValue, get the value of a register
|
||||
AqlValue getValue(size_t index, RegisterId varNr) const {
|
||||
inline AqlValue getValue(size_t index, RegisterId varNr) const {
|
||||
TRI_ASSERT(_data.capacity() > index * _nrRegs + varNr);
|
||||
return _data[index * _nrRegs + varNr];
|
||||
}
|
||||
|
@ -99,26 +99,19 @@ class AqlItemBlock {
|
|||
}
|
||||
|
||||
/// @brief setValue, set the current value of a register
|
||||
void setValue(size_t index, RegisterId varNr, AqlValue const& value) {
|
||||
inline void setValue(size_t index, RegisterId varNr, AqlValue const& value) {
|
||||
TRI_ASSERT(_data.capacity() > index * _nrRegs + varNr);
|
||||
TRI_ASSERT(_data[index * _nrRegs + varNr].isEmpty());
|
||||
|
||||
size_t mem = 0;
|
||||
|
||||
// First update the reference count, if this fails, the value is empty
|
||||
if (value.requiresDestruction()) {
|
||||
if (++_valueCount[value] == 1) {
|
||||
mem = value.memoryUsage();
|
||||
size_t mem = value.memoryUsage();
|
||||
increaseMemoryUsage(mem);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
_data[index * _nrRegs + varNr] = value;
|
||||
} catch (...) {
|
||||
decreaseMemoryUsage(mem);
|
||||
throw;
|
||||
}
|
||||
_data[index * _nrRegs + varNr] = value;
|
||||
}
|
||||
|
||||
/// @brief emplaceValue, set the current value of a register, constructing
|
||||
|
@ -168,12 +161,9 @@ class AqlItemBlock {
|
|||
if (it != _valueCount.end()) {
|
||||
if (--(it->second) == 0) {
|
||||
decreaseMemoryUsage(element.memoryUsage());
|
||||
try {
|
||||
_valueCount.erase(it);
|
||||
element.destroy();
|
||||
return; // no need for an extra element.erase() in this case
|
||||
} catch (...) {
|
||||
}
|
||||
_valueCount.erase(it);
|
||||
element.destroy();
|
||||
return; // no need for an extra element.erase() in this case
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -546,7 +546,7 @@ struct AqlValue final {
|
|||
AqlValue clone() const;
|
||||
|
||||
/// @brief invalidates/resets a value to None, not freeing any memory
|
||||
void erase() noexcept {
|
||||
inline void erase() noexcept {
|
||||
_data.internal[0] = '\x00';
|
||||
setType(AqlValueType::VPACK_INLINE);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ class RocksDBBuilderIndex final : public arangodb::RocksDBIndex {
|
|||
Result remove(transaction::Methods& trx, RocksDBMethods*, LocalDocumentId const& documentId,
|
||||
arangodb::velocypack::Slice const&, OperationMode mode) override;
|
||||
|
||||
RocksDBBuilderIndex(std::shared_ptr<arangodb::RocksDBIndex> const&);
|
||||
explicit RocksDBBuilderIndex(std::shared_ptr<arangodb::RocksDBIndex> const&);
|
||||
|
||||
/// @brief get index estimator, optional
|
||||
RocksDBCuckooIndexEstimator<uint64_t>* estimator() override {
|
||||
|
@ -95,7 +95,7 @@ class RocksDBBuilderIndex final : public arangodb::RocksDBIndex {
|
|||
Result fillIndexForeground();
|
||||
|
||||
struct Locker {
|
||||
Locker(RocksDBCollection* c) : _collection(c), _locked(false) {}
|
||||
explicit Locker(RocksDBCollection* c) : _collection(c), _locked(false) {}
|
||||
~Locker() { unlock(); }
|
||||
bool lock();
|
||||
void unlock();
|
||||
|
|
|
@ -194,7 +194,6 @@ static bool LoadJavaScriptFile(v8::Isolate* isolate, char const* filename,
|
|||
char* contentWrapper = TRI_Concatenate3String(prologue, content + bangOffset, epilogue);
|
||||
|
||||
TRI_FreeString(content);
|
||||
content = nullptr;
|
||||
|
||||
length += strlen(prologue) + strlen(epilogue);
|
||||
content = contentWrapper;
|
||||
|
|
Loading…
Reference in New Issue