mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 17:11:59 +00:00
Small fixes for osx
This commit is contained in:
parent
99c0bb3be4
commit
8c50324576
@ -1044,8 +1044,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
|
||||
// TODO: Support multiple function definitions, which is common for
|
||||
// template specializations.
|
||||
if (decl->isDefinition && !is_template_specialization) {
|
||||
assert(!func->def.definition_spelling);
|
||||
assert(!func->def.definition_extent);
|
||||
//assert(!func->def.definition_spelling);
|
||||
//assert(!func->def.definition_extent);
|
||||
func->def.definition_spelling = decl_spelling;
|
||||
func->def.definition_extent = decl_extent;
|
||||
}
|
||||
|
11
src/utils.cc
11
src/utils.cc
@ -2,7 +2,6 @@
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#include <sparsepp/spp_memory.h>
|
||||
#include <tinydir.h>
|
||||
|
||||
#include <algorithm>
|
||||
@ -15,6 +14,10 @@
|
||||
#include <sstream>
|
||||
#include <unordered_map>
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
#include <sparsepp/spp_memory.h>
|
||||
#endif
|
||||
|
||||
// See http://stackoverflow.com/a/217605
|
||||
void TrimStart(std::string& s) {
|
||||
s.erase(s.begin(), std::find_if(s.begin(), s.end(),
|
||||
@ -311,7 +314,11 @@ void WriteToFile(const std::string& filename, const std::string& content) {
|
||||
}
|
||||
|
||||
float GetProcessMemoryUsedInMb() {
|
||||
#if defined(__APPLE__)
|
||||
return 0.f;
|
||||
#else
|
||||
const float kBytesToMb = 1000000;
|
||||
uint64_t memory_after = spp::GetProcessMemoryUsed();
|
||||
return memory_after / kBytesToMb;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user