Small fixes for osx

This commit is contained in:
Jacob Dufault 2017-05-30 17:54:19 -07:00
parent 99c0bb3be4
commit 8c50324576
2 changed files with 11 additions and 4 deletions

View File

@ -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;
} }

View File

@ -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
} }