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

Commit cd652f21 authored by Colin Cross's avatar Colin Cross Committed by android-build-merger
Browse files

Merge "Move libmemunreachable into namespace android"

am: ae38b373

Change-Id: Idb89390ff1d4e47199dcdaa7ac079553534caf62
parents 8f596198 ae38b373
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