Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9939e9a authored by Colin Cross's avatar Colin Cross
Browse files

Move libmemunreachable into namespace android

Putting libmemunreachable in the global C++ namespace was an oversight,
move it into namespace android.

Test: m -j checkbuild
Change-Id: I0799906f6463178cb04a719bb4054cad33a50dbe
parent a83881e3
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -37,6 +37,8 @@
#include "LinkedList.h"
#include "LinkedList.h"
#include "anon_vma_naming.h"
#include "anon_vma_naming.h"


namespace android {

// runtime interfaces used:
// runtime interfaces used:
// abort
// abort
// assert - fprintf + mmap
// assert - fprintf + mmap
@@ -462,3 +464,5 @@ void Heap::deallocate(HeapImpl* impl, void* ptr) {
bool Heap::empty() {
bool Heap::empty() {
  return impl_->Empty();
  return impl_->Empty();
}
}

}  // namespace android
+5 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,9 @@
#include <unordered_map>
#include <unordered_map>
#include <unordered_set>
#include <unordered_set>
#include <vector>
#include <vector>

namespace android {

extern std::atomic<int> heap_count;
extern std::atomic<int> heap_count;


class HeapImpl;
class HeapImpl;
@@ -210,4 +213,6 @@ using set = std::set<Key, Compare, Allocator<Key>>;
using string = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
using string = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
}
}


}  // namespace android

#endif
#endif
+4 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,8 @@
#include "ScopedSignalHandler.h"
#include "ScopedSignalHandler.h"
#include "log.h"
#include "log.h"


namespace android {

bool HeapWalker::Allocation(uintptr_t begin, uintptr_t end) {
bool HeapWalker::Allocation(uintptr_t begin, uintptr_t end) {
  if (end == begin) {
  if (end == begin) {
    end = begin + 1;
    end = begin + 1;
@@ -173,3 +175,5 @@ void HeapWalker::HandleSegFault(ScopedSignalHandler& handler, int signal, siginf
}
}


ScopedSignalHandler::SignalFn ScopedSignalHandler::handler_;
ScopedSignalHandler::SignalFn ScopedSignalHandler::handler_;

}  // namespace android
+4 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,8 @@
#include "ScopedSignalHandler.h"
#include "ScopedSignalHandler.h"
#include "Tarjan.h"
#include "Tarjan.h"


namespace android {

// A range [begin, end)
// A range [begin, end)
struct Range {
struct Range {
  uintptr_t begin;
  uintptr_t begin;
@@ -125,4 +127,6 @@ inline void HeapWalker::ForEachAllocation(F&& f) {
  }
  }
}
}


}  // namespace android

#endif
#endif
+5 −2
Original line number Original line Diff line number Diff line
@@ -27,8 +27,8 @@
namespace std {
namespace std {


template <>
template <>
struct hash<Leak::Backtrace> {
struct hash<android::Leak::Backtrace> {
  std::size_t operator()(const Leak::Backtrace& key) const {
  std::size_t operator()(const android::Leak::Backtrace& key) const {
    std::size_t seed = 0;
    std::size_t seed = 0;


    hash_combine(seed, key.num_frames);
    hash_combine(seed, key.num_frames);
@@ -49,9 +49,12 @@ struct hash<Leak::Backtrace> {


}  // namespace std
}  // namespace std


namespace android {

static bool operator==(const Leak::Backtrace& lhs, const Leak::Backtrace& rhs) {
static bool operator==(const Leak::Backtrace& lhs, const Leak::Backtrace& rhs) {
  return (lhs.num_frames == rhs.num_frames) &&
  return (lhs.num_frames == rhs.num_frames) &&
         memcmp(lhs.frames, rhs.frames, lhs.num_frames * sizeof(lhs.frames[0])) == 0;
         memcmp(lhs.frames, rhs.frames, lhs.num_frames * sizeof(lhs.frames[0])) == 0;
}
}
}


#endif
#endif
Loading