ams: support building unit test programs on windows/linux/macos
This commit is contained in:
@@ -41,19 +41,19 @@ namespace ams::lmem::impl {
|
||||
}
|
||||
};
|
||||
|
||||
constexpr inline MemoryRange MakeMemoryRange(void *address, size_t size) {
|
||||
ALWAYS_INLINE MemoryRange MakeMemoryRange(void *address, size_t size) {
|
||||
return MemoryRange{ .address = reinterpret_cast<uintptr_t>(address), .size = size };
|
||||
}
|
||||
|
||||
constexpr inline void *GetHeapStartAddress(HeapHandle handle) {
|
||||
ALWAYS_INLINE void *GetHeapStartAddress(HeapHandle handle) {
|
||||
return handle->heap_start;
|
||||
}
|
||||
|
||||
constexpr inline size_t GetPointerDifference(const void *start, const void *end) {
|
||||
ALWAYS_INLINE size_t GetPointerDifference(const void *start, const void *end) {
|
||||
return reinterpret_cast<uintptr_t>(end) - reinterpret_cast<uintptr_t>(start);
|
||||
}
|
||||
|
||||
constexpr inline size_t GetPointerDifference(uintptr_t start, uintptr_t end) {
|
||||
constexpr ALWAYS_INLINE size_t GetPointerDifference(uintptr_t start, uintptr_t end) {
|
||||
return end - start;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,19 +42,19 @@ namespace ams::lmem::impl {
|
||||
return handle->magic == ExpHeapMagic;
|
||||
}
|
||||
|
||||
inline ExpHeapHead *GetExpHeapHead(HeapHead *heap_head) {
|
||||
[[maybe_unused]] inline ExpHeapHead *GetExpHeapHead(HeapHead *heap_head) {
|
||||
return std::addressof(heap_head->impl_head.exp_heap_head);
|
||||
}
|
||||
|
||||
inline const ExpHeapHead *GetExpHeapHead(const HeapHead *heap_head) {
|
||||
[[maybe_unused]] inline const ExpHeapHead *GetExpHeapHead(const HeapHead *heap_head) {
|
||||
return std::addressof(heap_head->impl_head.exp_heap_head);
|
||||
}
|
||||
|
||||
inline HeapHead *GetHeapHead(ExpHeapHead *exp_heap_head) {
|
||||
[[maybe_unused]] inline HeapHead *GetHeapHead(ExpHeapHead *exp_heap_head) {
|
||||
return util::GetParentPointer<&HeapHead::impl_head>(util::GetParentPointer<&ImplementationHeapHead::exp_heap_head>(exp_heap_head));
|
||||
}
|
||||
|
||||
inline const HeapHead *GetHeapHead(const ExpHeapHead *exp_heap_head) {
|
||||
[[maybe_unused]] inline const HeapHead *GetHeapHead(const ExpHeapHead *exp_heap_head) {
|
||||
return util::GetParentPointer<&HeapHead::impl_head>(util::GetParentPointer<&ImplementationHeapHead::exp_heap_head>(exp_heap_head));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace ams::lmem::impl {
|
||||
return std::addressof(heap_head->impl_head.unit_heap_head);
|
||||
}
|
||||
|
||||
constexpr inline const UnitHeapHead *GetUnitHeapHead(const HeapHead *heap_head) {
|
||||
[[maybe_unused]] constexpr inline const UnitHeapHead *GetUnitHeapHead(const HeapHead *heap_head) {
|
||||
return std::addressof(heap_head->impl_head.unit_heap_head);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user