mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 11:18:51 +02:00
ircd::allocator: Ensure consistent conversion here.
This commit is contained in:
parent
92ebdd83a4
commit
9dac813278
1 changed files with 2 additions and 2 deletions
|
@ -222,7 +222,7 @@ struct ircd::allocator::fixed<T, SIZE>::allocator
|
|||
allocate(std::nothrow_t, const size_type &n, const const_pointer &hint = nullptr)
|
||||
{
|
||||
const auto base(reinterpret_cast<pointer>(s->buf.data()));
|
||||
const uint hintpos(hint? hint - base : -1);
|
||||
const uint hintpos(hint? uintptr_t(hint - base) : uintptr_t(-1));
|
||||
const pointer ret(base + s->state::allocate(std::nothrow, n, hintpos));
|
||||
return s->in_range(ret)? ret : nullptr;
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ struct ircd::allocator::fixed<T, SIZE>::allocator
|
|||
allocate(const size_type &n, const const_pointer &hint = nullptr)
|
||||
{
|
||||
const auto base(reinterpret_cast<pointer>(s->buf.data()));
|
||||
const uint hintpos(hint? hint - base : -1);
|
||||
const uint hintpos(hint? uintptr_t(hint - base) : uintptr_t(-1));
|
||||
return base + s->state::allocate(n, hintpos);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue