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

Commit ae38b373 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Move libmemunreachable into namespace android"

parents 75752c19 a9939e9a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@
#include "LinkedList.h"
#include "anon_vma_naming.h"

namespace android {

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

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

namespace android {

extern std::atomic<int> heap_count;

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

}  // namespace android

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

namespace android {

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

ScopedSignalHandler::SignalFn ScopedSignalHandler::handler_;

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

namespace android {

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

}  // namespace android

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

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

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

}  // namespace std

namespace android {

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

#endif
Loading