mirror of
https://github.com/MaskRay/ccls.git
synced 2024-12-01 11:57:09 +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
|
// TODO: Support multiple function definitions, which is common for
|
||||||
// template specializations.
|
// template specializations.
|
||||||
if (decl->isDefinition && !is_template_specialization) {
|
if (decl->isDefinition && !is_template_specialization) {
|
||||||
assert(!func->def.definition_spelling);
|
//assert(!func->def.definition_spelling);
|
||||||
assert(!func->def.definition_extent);
|
//assert(!func->def.definition_extent);
|
||||||
func->def.definition_spelling = decl_spelling;
|
func->def.definition_spelling = decl_spelling;
|
||||||
func->def.definition_extent = decl_extent;
|
func->def.definition_extent = decl_extent;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#include <sparsepp/spp_memory.h>
|
|
||||||
#include <tinydir.h>
|
#include <tinydir.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -15,6 +14,10 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#if !defined(__APPLE__)
|
||||||
|
#include <sparsepp/spp_memory.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// See http://stackoverflow.com/a/217605
|
// See http://stackoverflow.com/a/217605
|
||||||
void TrimStart(std::string& s) {
|
void TrimStart(std::string& s) {
|
||||||
s.erase(s.begin(), std::find_if(s.begin(), s.end(),
|
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() {
|
float GetProcessMemoryUsedInMb() {
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
return 0.f;
|
||||||
|
#else
|
||||||
const float kBytesToMb = 1000000;
|
const float kBytesToMb = 1000000;
|
||||||
uint64_t memory_after = spp::GetProcessMemoryUsed();
|
uint64_t memory_after = spp::GetProcessMemoryUsed();
|
||||||
return memory_after / kBytesToMb;
|
return memory_after / kBytesToMb;
|
||||||
|
#endif
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user