[ox/std] Fix macOS build

This commit is contained in:
Gary Talent 2020-06-05 19:47:29 -05:00
parent f86d0e697a
commit c178a2273b
2 changed files with 4 additions and 6 deletions

View File

@ -35,7 +35,7 @@ T *HeapSegment::data() {
return ox::bit_cast<T*>(ox::bit_cast<uint8_t*>(this) + alignedSize(this)); return ox::bit_cast<T*>(ox::bit_cast<uint8_t*>(this) + alignedSize(this));
} }
template<typename T = uint8_t> template<typename T>
T *HeapSegment::end() { T *HeapSegment::end() {
const auto size = alignedSize(this) + alignedSize(this->size); const auto size = alignedSize(this) + alignedSize(this->size);
auto e = ox::bit_cast<uintptr_t>(ox::bit_cast<uint8_t*>(this) + size); auto e = ox::bit_cast<uintptr_t>(ox::bit_cast<uint8_t*>(this) + size);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2015 - 2018 gtalent2@gmail.com * Copyright 2015 - 2020 gtalent2@gmail.com
* *
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
@ -11,13 +11,11 @@
#include <functional> #include <functional>
#include <ox/std/std.hpp> #include <ox/std/std.hpp>
using namespace std; std::map<std::string, std::function<int()>> tests = {
map<string, function<int()>> tests = {
{ {
"malloc", "malloc",
[] { [] {
std::vector<char> buff(ox::units::MB); ox::Vector<char> buff(ox::units::MB);
ox::heapmgr::initHeap(&buff.front(), &buff.back()); ox::heapmgr::initHeap(&buff.front(), &buff.back());
oxAssert(ox::heapmgr::malloc(5) != nullptr, "malloc is broken"); oxAssert(ox::heapmgr::malloc(5) != nullptr, "malloc is broken");
oxAssert(ox::heapmgr::malloc(5) != nullptr, "malloc is broken"); oxAssert(ox::heapmgr::malloc(5) != nullptr, "malloc is broken");