fix osx compile

This commit is contained in:
Jeff 2019-05-10 12:18:26 -04:00
parent faacc86eb5
commit bae926d3d6
1 changed files with 5 additions and 7 deletions

View File

@ -1,7 +1,5 @@
#ifndef LLARP_UTIL_ALLOC_HPP
#define LLARP_UTIL_ALLOC_HPP
#include <memory>
#include <experimental/memory_resource>
#include <bitset>
#include <array>
@ -28,9 +26,9 @@ namespace llarp
Ptr_t
NewPtr()
{
void *ptr = mem->allocate();
Ptr_t ptr = mem->allocate();
::new(ptr) Value_t;
return static_cast<Ptr_t>(ptr);
return ptr;
}
void
@ -81,7 +79,7 @@ namespace llarp
_allocated.reset(_idx);
}
[[nodiscard]] void *
[[nodiscard]] Ptr_t
allocate()
{
const std::size_t _started = _pos;
@ -95,7 +93,7 @@ namespace llarp
}
}
_allocated.set(_pos);
return (Value_t *)&_buffer[_pos * sizeof(Value_t)];
return (Ptr_t)&_buffer[_pos * sizeof(Value_t)];
}
};
@ -105,4 +103,4 @@ namespace llarp
} // namespace util
} // namespace llarp
#endif
#endif