mirror of https://gitee.com/bigwinds/arangodb
removed some of those "using namespace" directives
This commit is contained in:
parent
ae9147ef68
commit
2ae325fd4e
|
@ -26,7 +26,6 @@
|
|||
#include "Basics/Exceptions.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
|
|
@ -29,13 +29,11 @@
|
|||
#include "V8/v8-globals.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
using Json = triagens::basics::Json;
|
||||
|
||||
|
||||
CalculationBlock::CalculationBlock(ExecutionEngine* engine,
|
||||
CalculationNode const* en)
|
||||
: ExecutionBlock(engine, en),
|
||||
|
|
|
@ -21,19 +21,18 @@
|
|||
/// @author Max Neunhoeffer
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Aql/ClusterBlocks.h"
|
||||
#include "ClusterBlocks.h"
|
||||
#include "Aql/ExecutionEngine.h"
|
||||
#include "Basics/Exceptions.h"
|
||||
#include "Basics/json-utilities.h"
|
||||
#include "Basics/StringUtils.h"
|
||||
#include "Basics/StringBuffer.h"
|
||||
#include "Basics/json-utilities.h"
|
||||
#include "Basics/Exceptions.h"
|
||||
#include "Cluster/ClusterMethods.h"
|
||||
#include "Dispatcher/DispatcherThread.h"
|
||||
#include "V8/v8-globals.h"
|
||||
#include "VocBase/server.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
@ -70,7 +69,7 @@ GatherBlock::GatherBlock(ExecutionEngine* engine, GatherNode const* en)
|
|||
auto it = en->getRegisterPlan()->varInfo.find(p.first->id);
|
||||
TRI_ASSERT(it != en->getRegisterPlan()->varInfo.end());
|
||||
TRI_ASSERT(it->second.registerId < ExecutionNode::MaxRegisterId);
|
||||
_sortRegisters.emplace_back(make_pair(it->second.registerId, p.second));
|
||||
_sortRegisters.emplace_back(std::make_pair(it->second.registerId, p.second));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +163,7 @@ int GatherBlock::initializeCursor(AqlItemBlock* items, size_t pos) {
|
|||
_gatherBlockPos.reserve(_dependencies.size());
|
||||
for (size_t i = 0; i < _dependencies.size(); i++) {
|
||||
_gatherBlockBuffer.emplace_back();
|
||||
_gatherBlockPos.emplace_back(make_pair(i, 0));
|
||||
_gatherBlockPos.emplace_back(std::make_pair(i, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,7 +230,7 @@ bool GatherBlock::hasMore() {
|
|||
if (!_gatherBlockBuffer.at(i).empty()) {
|
||||
return true;
|
||||
} else if (getBlock(i, DefaultBatchSize, DefaultBatchSize)) {
|
||||
_gatherBlockPos.at(i) = make_pair(i, 0);
|
||||
_gatherBlockPos.at(i) = std::make_pair(i, 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +272,7 @@ AqlItemBlock* GatherBlock::getSome(size_t atLeast, size_t atMost) {
|
|||
if (_gatherBlockBuffer.at(i).empty()) {
|
||||
if (getBlock(i, atLeast, atMost)) {
|
||||
index = i;
|
||||
_gatherBlockPos.at(i) = make_pair(i, 0);
|
||||
_gatherBlockPos.at(i) = std::make_pair(i, 0);
|
||||
}
|
||||
} else {
|
||||
index = i;
|
||||
|
@ -352,7 +351,7 @@ AqlItemBlock* GatherBlock::getSome(size_t atLeast, size_t atMost) {
|
|||
AqlItemBlock* cur = _gatherBlockBuffer.at(val.first).front();
|
||||
delete cur;
|
||||
_gatherBlockBuffer.at(val.first).pop_front();
|
||||
_gatherBlockPos.at(val.first) = make_pair(val.first, 0);
|
||||
_gatherBlockPos.at(val.first) = std::make_pair(val.first, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -393,7 +392,7 @@ size_t GatherBlock::skipSome(size_t atLeast, size_t atMost) {
|
|||
if (_gatherBlockBuffer.at(i).empty()) {
|
||||
if (getBlock(i, atLeast, atMost)) {
|
||||
index = i;
|
||||
_gatherBlockPos.at(i) = make_pair(i, 0);
|
||||
_gatherBlockPos.at(i) = std::make_pair(i, 0);
|
||||
}
|
||||
} else {
|
||||
index = i;
|
||||
|
@ -438,7 +437,7 @@ size_t GatherBlock::skipSome(size_t atLeast, size_t atMost) {
|
|||
AqlItemBlock* cur = _gatherBlockBuffer.at(val.first).front();
|
||||
delete cur;
|
||||
_gatherBlockBuffer.at(val.first).pop_front();
|
||||
_gatherBlockPos.at(val.first) = make_pair(val.first, 0);
|
||||
_gatherBlockPos.at(val.first) = std::make_pair(val.first, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1032,7 +1031,7 @@ bool DistributeBlock::getBlockForClient(size_t atLeast, size_t atMost,
|
|||
// this may modify the input item buffer in place
|
||||
size_t id = sendToClient(cur);
|
||||
|
||||
buf.at(id).emplace_back(make_pair(_index, _pos++));
|
||||
buf.at(id).emplace_back(std::make_pair(_index, _pos++));
|
||||
}
|
||||
|
||||
if (_pos == cur->size()) {
|
||||
|
|
|
@ -21,16 +21,14 @@
|
|||
/// @author Max Neunhoeffer
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Aql/ClusterNodes.h"
|
||||
#include "ClusterNodes.h"
|
||||
#include "Aql/Ast.h"
|
||||
#include "Aql/Collection.h"
|
||||
#include "Aql/ExecutionPlan.h"
|
||||
#include "Aql/Ast.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief constructor for RemoteNode from Json
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "Basics/Exceptions.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
#include "Aql/ExecutionPlan.h"
|
||||
#include "Aql/WalkerWorker.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::aql;
|
||||
|
||||
CollectNode::CollectNode(
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
/// @author Max Neunhoeffer
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Aql/EnumerateCollectionBlock.h"
|
||||
#include "EnumerateCollectionBlock.h"
|
||||
#include "Aql/AqlItemBlock.h"
|
||||
#include "Aql/Collection.h"
|
||||
#include "Aql/CollectionScanner.h"
|
||||
|
@ -29,7 +29,6 @@
|
|||
#include "Basics/Exceptions.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
|
|
@ -26,13 +26,10 @@
|
|||
#include "Basics/Exceptions.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
using Json = triagens::basics::Json;
|
||||
|
||||
|
||||
EnumerateListBlock::EnumerateListBlock(ExecutionEngine* engine,
|
||||
EnumerateListNode const* en)
|
||||
: ExecutionBlock(engine, en),
|
||||
|
|
|
@ -26,12 +26,9 @@
|
|||
#include "Aql/ExecutionEngine.h"
|
||||
#include "Basics/json-utilities.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief batch size value
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "Aql/WalkerWorker.h"
|
||||
#include "Basics/StringBuffer.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
|
|
@ -27,11 +27,8 @@
|
|||
#include "Aql/SortCondition.h"
|
||||
#include "Aql/Variable.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief destroy the index
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "V8/v8-globals.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
|
|
@ -29,10 +29,9 @@
|
|||
#include "Aql/ExecutionPlan.h"
|
||||
#include "Aql/Index.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::aql;
|
||||
|
||||
using JsonHelper = triagens::basics::JsonHelper;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief toJson, for IndexNode
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "V8/v8-globals.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
|
|
@ -26,11 +26,10 @@
|
|||
#include "Aql/Collection.h"
|
||||
#include "Aql/ExecutionPlan.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::aql;
|
||||
using JsonHelper = triagens::basics::JsonHelper;
|
||||
|
||||
const static bool Optional = true;
|
||||
static bool const Optional = true;
|
||||
|
||||
|
||||
ModificationNode::ModificationNode(ExecutionPlan* plan,
|
||||
|
|
|
@ -34,13 +34,12 @@
|
|||
#include "Rest/HttpResponse.h"
|
||||
#include "VocBase/server.h"
|
||||
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::rest;
|
||||
using namespace triagens::aql;
|
||||
using namespace std;
|
||||
|
||||
|
||||
using Json = triagens::basics::Json;
|
||||
using JsonHelper = triagens::basics::JsonHelper;
|
||||
|
||||
RestAqlHandler::RestAqlHandler(triagens::rest::HttpRequest* request,
|
||||
std::pair<ApplicationV8*, QueryRegistry*>* pair)
|
||||
|
@ -54,7 +53,6 @@ RestAqlHandler::RestAqlHandler(triagens::rest::HttpRequest* request,
|
|||
TRI_ASSERT(_queryRegistry != nullptr);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief returns the queue name
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -113,7 +111,7 @@ void RestAqlHandler::createQueryFromJson() {
|
|||
bool found;
|
||||
char const* ttlstring = _request->header("ttl", found);
|
||||
if (found) {
|
||||
ttl = StringUtils::doubleDecimal(ttlstring);
|
||||
ttl = triagens::basics::StringUtils::doubleDecimal(ttlstring);
|
||||
}
|
||||
|
||||
// query id not set, now generate a new one
|
||||
|
@ -133,7 +131,7 @@ void RestAqlHandler::createQueryFromJson() {
|
|||
createResponse(triagens::rest::HttpResponse::ACCEPTED);
|
||||
_response->setContentType("application/json; charset=utf-8");
|
||||
triagens::basics::Json answerBody(triagens::basics::Json::Object, 2);
|
||||
answerBody("queryId", triagens::basics::Json(StringUtils::itoa(_qId)))(
|
||||
answerBody("queryId", triagens::basics::Json(triagens::basics::StringUtils::itoa(_qId)))(
|
||||
"ttl", triagens::basics::Json(ttl));
|
||||
|
||||
_response->body().appendText(answerBody.toString());
|
||||
|
@ -307,7 +305,7 @@ void RestAqlHandler::createQueryFromString() {
|
|||
bool found;
|
||||
char const* ttlstring = _request->header("ttl", found);
|
||||
if (found) {
|
||||
ttl = StringUtils::doubleDecimal(ttlstring);
|
||||
ttl = triagens::basics::StringUtils::doubleDecimal(ttlstring);
|
||||
}
|
||||
|
||||
_qId = TRI_NewTickServer();
|
||||
|
@ -324,7 +322,7 @@ void RestAqlHandler::createQueryFromString() {
|
|||
createResponse(triagens::rest::HttpResponse::ACCEPTED);
|
||||
_response->setContentType("application/json; charset=utf-8");
|
||||
triagens::basics::Json answerBody(triagens::basics::Json::Object, 2);
|
||||
answerBody("queryId", triagens::basics::Json(StringUtils::itoa(_qId)))(
|
||||
answerBody("queryId", triagens::basics::Json(triagens::basics::StringUtils::itoa(_qId)))(
|
||||
"ttl", triagens::basics::Json(ttl));
|
||||
_response->body().appendText(answerBody.toString());
|
||||
}
|
||||
|
@ -616,7 +614,7 @@ triagens::rest::HttpHandler::status_t RestAqlHandler::execute() {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool RestAqlHandler::findQuery(std::string const& idString, Query*& query) {
|
||||
_qId = StringUtils::uint64(idString);
|
||||
_qId = triagens::basics::StringUtils::uint64(idString);
|
||||
query = nullptr;
|
||||
|
||||
// sleep for 10ms each time, wait for at most 30 seconds...
|
||||
|
|
|
@ -21,12 +21,11 @@
|
|||
/// @author Max Neunhoeffer
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Aql/SortBlock.h"
|
||||
#include "SortBlock.h"
|
||||
#include "Aql/ExecutionEngine.h"
|
||||
#include "Basics/Exceptions.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
@ -40,7 +39,7 @@ SortBlock::SortBlock(ExecutionEngine* engine, SortNode const* en)
|
|||
auto it = en->getRegisterPlan()->varInfo.find(p.first->id);
|
||||
TRI_ASSERT(it != en->getRegisterPlan()->varInfo.end());
|
||||
TRI_ASSERT(it->second.registerId < ExecutionNode::MaxRegisterId);
|
||||
_sortRegisters.emplace_back(make_pair(it->second.registerId, p.second));
|
||||
_sortRegisters.emplace_back(std::make_pair(it->second.registerId, p.second));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,11 +27,9 @@
|
|||
#include "Aql/WalkerWorker.h"
|
||||
#include "Basics/StringBuffer.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
||||
SortNode::SortNode(ExecutionPlan* plan, triagens::basics::Json const& base,
|
||||
SortElementVector const& elements, bool stable)
|
||||
: ExecutionNode(plan, base), _elements(elements), _stable(stable) {}
|
||||
|
|
|
@ -26,11 +26,9 @@
|
|||
#include "Basics/Exceptions.h"
|
||||
#include "VocBase/vocbase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
||||
SubqueryBlock::SubqueryBlock(ExecutionEngine* engine, SubqueryNode const* en,
|
||||
ExecutionBlock* subquery)
|
||||
: ExecutionBlock(engine, en),
|
||||
|
|
|
@ -21,22 +21,21 @@
|
|||
/// @author Michael Hackstein
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "TraversalBlock.h"
|
||||
#include "Aql/Ast.h"
|
||||
#include "Aql/ExecutionEngine.h"
|
||||
#include "Aql/ExecutionNode.h"
|
||||
#include "Aql/ExecutionPlan.h"
|
||||
#include "Aql/Functions.h"
|
||||
#include "Aql/TraversalBlock.h"
|
||||
#include "Basics/ScopeGuard.h"
|
||||
#include "Cluster/ClusterTraverser.h"
|
||||
#include "V8/v8-globals.h"
|
||||
#include "V8Server/V8Traverser.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::arango;
|
||||
using namespace triagens::aql;
|
||||
|
||||
using Json = triagens::basics::Json;
|
||||
using VertexId = triagens::arango::traverser::VertexId;
|
||||
|
||||
|
||||
|
@ -350,7 +349,7 @@ void TraversalBlock::initializePaths(AqlItemBlock const* items) {
|
|||
if (input.has(TRI_VOC_ATTRIBUTE_ID)) {
|
||||
Json _idJson = input.get(TRI_VOC_ATTRIBUTE_ID);
|
||||
if (_idJson.isString()) {
|
||||
_vertexId = JsonHelper::getStringValue(_idJson.json(), "");
|
||||
_vertexId = triagens::basics::JsonHelper::getStringValue(_idJson.json(), "");
|
||||
VertexId v = triagens::arango::traverser::IdStringToVertexId(
|
||||
_resolver, _vertexId);
|
||||
_traverser->setStartVertex(v);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "Aql/Ast.h"
|
||||
#include "Aql/Index.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::aql;
|
||||
|
||||
|
|
|
@ -21,12 +21,11 @@
|
|||
/// @author Jan Steemann
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "Aql/Variable.h"
|
||||
#include "Variable.h"
|
||||
#include "Basics/JsonHelper.h"
|
||||
|
||||
using namespace triagens::aql;
|
||||
using namespace triagens::basics;
|
||||
|
||||
using JsonHelper = triagens::basics::JsonHelper;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief name of $OLD variable
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
#include "index-operator.h"
|
||||
#include "VocBase/VocShaper.h"
|
||||
|
||||
|
||||
|
||||
TRI_relation_index_operator_t::~TRI_relation_index_operator_t() {
|
||||
if (_parameters != nullptr) {
|
||||
TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, _parameters);
|
||||
|
|
|
@ -63,18 +63,22 @@ triagens::basics::ReadWriteLock FailurePointsLock;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static char* MakeValue(char const* value) {
|
||||
if (value == nullptr || strlen(value) == 0) {
|
||||
if (value == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
size_t const len = strlen(value);
|
||||
if (len == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
char* delimited = static_cast<char*>(
|
||||
TRI_Allocate(TRI_CORE_MEM_ZONE, strlen(value) + 3, false));
|
||||
TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, len + 3, false));
|
||||
|
||||
if (delimited != nullptr) {
|
||||
memcpy(delimited + 1, value, strlen(value));
|
||||
memcpy(delimited + 1, value, len);
|
||||
delimited[0] = ',';
|
||||
delimited[strlen(value) + 1] = ',';
|
||||
delimited[strlen(value) + 2] = '\0';
|
||||
delimited[len + 1] = ',';
|
||||
delimited[len + 2] = '\0';
|
||||
}
|
||||
|
||||
return delimited;
|
||||
|
@ -120,7 +124,7 @@ bool TRI_ShouldFailDebugging(char const* value) {
|
|||
|
||||
if (checkValue != nullptr) {
|
||||
found = strstr(FailurePoints, checkValue);
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, checkValue);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, checkValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,7 +136,6 @@ bool TRI_ShouldFailDebugging(char const* value) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_AddFailurePointDebugging(char const* value) {
|
||||
char* found;
|
||||
char* checkValue = MakeValue(value);
|
||||
|
||||
if (checkValue == nullptr) {
|
||||
|
@ -141,6 +144,7 @@ void TRI_AddFailurePointDebugging(char const* value) {
|
|||
|
||||
WRITE_LOCKER(FailurePointsLock);
|
||||
|
||||
char* found;
|
||||
if (FailurePoints == nullptr) {
|
||||
found = nullptr;
|
||||
} else {
|
||||
|
@ -157,10 +161,10 @@ void TRI_AddFailurePointDebugging(char const* value) {
|
|||
size_t n = strlen(checkValue);
|
||||
|
||||
if (FailurePoints == nullptr) {
|
||||
copy = static_cast<char*>(TRI_Allocate(TRI_CORE_MEM_ZONE, n + 1, false));
|
||||
copy = static_cast<char*>(TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, n + 1, false));
|
||||
|
||||
if (copy == nullptr) {
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, checkValue);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, checkValue);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -168,10 +172,10 @@ void TRI_AddFailurePointDebugging(char const* value) {
|
|||
copy[n] = '\0';
|
||||
} else {
|
||||
copy = static_cast<char*>(
|
||||
TRI_Allocate(TRI_CORE_MEM_ZONE, n + strlen(FailurePoints), false));
|
||||
TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, n + strlen(FailurePoints), false));
|
||||
|
||||
if (copy == nullptr) {
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, checkValue);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, checkValue);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -179,17 +183,17 @@ void TRI_AddFailurePointDebugging(char const* value) {
|
|||
memcpy(copy + strlen(FailurePoints) - 1, checkValue, n);
|
||||
copy[strlen(FailurePoints) + n - 1] = '\0';
|
||||
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, FailurePoints);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, FailurePoints);
|
||||
}
|
||||
|
||||
FailurePoints = copy;
|
||||
}
|
||||
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, checkValue);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, checkValue);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief remove a failure points
|
||||
/// @brief remove a failure point
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_RemoveFailurePointDebugging(char const* value) {
|
||||
|
@ -209,24 +213,24 @@ void TRI_RemoveFailurePointDebugging(char const* value) {
|
|||
found = strstr(FailurePoints, checkValue);
|
||||
|
||||
if (found == nullptr) {
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, checkValue);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, checkValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen(FailurePoints) - strlen(checkValue) <= 2) {
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, FailurePoints);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, FailurePoints);
|
||||
FailurePoints = nullptr;
|
||||
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, checkValue);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, checkValue);
|
||||
return;
|
||||
}
|
||||
|
||||
copy = static_cast<char*>(
|
||||
TRI_Allocate(TRI_CORE_MEM_ZONE,
|
||||
TRI_Allocate(TRI_UNKNOWN_MEM_ZONE,
|
||||
strlen(FailurePoints) - strlen(checkValue) + 2, false));
|
||||
|
||||
if (copy == nullptr) {
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, checkValue);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, checkValue);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -239,10 +243,10 @@ void TRI_RemoveFailurePointDebugging(char const* value) {
|
|||
strlen(FailurePoints) - strlen(checkValue) - n + 1);
|
||||
|
||||
copy[strlen(FailurePoints) - strlen(checkValue) + 1] = '\0';
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, FailurePoints);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, FailurePoints);
|
||||
FailurePoints = copy;
|
||||
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, checkValue);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, checkValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,7 +258,7 @@ void TRI_ClearFailurePointsDebugging() {
|
|||
WRITE_LOCKER(FailurePointsLock);
|
||||
|
||||
if (FailurePoints != nullptr) {
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, FailurePoints);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, FailurePoints);
|
||||
}
|
||||
|
||||
FailurePoints = nullptr;
|
||||
|
@ -274,7 +278,7 @@ void TRI_InitializeDebugging() {}
|
|||
|
||||
void TRI_ShutdownDebugging() {
|
||||
if (FailurePoints != nullptr) {
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, FailurePoints);
|
||||
TRI_Free(TRI_UNKNOWN_MEM_ZONE, FailurePoints);
|
||||
}
|
||||
|
||||
FailurePoints = nullptr;
|
||||
|
|
Loading…
Reference in New Issue