xo-alloc2: DX1CollectorIterator infra [WIP]
This commit is contained in:
parent
59c0311ed7
commit
bf27314688
30 changed files with 1041 additions and 176 deletions
43
src/alloc2/IAllocIterator_DArenaIterator.cpp
Normal file
43
src/alloc2/IAllocIterator_DArenaIterator.cpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/** @file IAllocIterator_DArenaIterator.cpp
|
||||
*
|
||||
* @author Roland Conybeare, Dec 2025
|
||||
**/
|
||||
|
||||
#include "arena/IAllocIterator_DArenaIterator.hpp"
|
||||
#include "AllocIterator.hpp"
|
||||
#include <cassert>
|
||||
|
||||
namespace xo {
|
||||
using std::byte;
|
||||
|
||||
namespace mm {
|
||||
AllocInfo
|
||||
IAllocIterator_DArenaIterator::deref(const DArenaIterator & ix) noexcept
|
||||
{
|
||||
return ix.deref();
|
||||
}
|
||||
|
||||
cmpresult
|
||||
IAllocIterator_DArenaIterator::compare(const DArenaIterator & ix,
|
||||
const obj<AAllocIterator> & other_arg) noexcept
|
||||
{
|
||||
/* downcast from variant */
|
||||
auto other = obj<AAllocIterator, DArenaIterator>::from(other_arg);
|
||||
|
||||
if (!other)
|
||||
return cmpresult::incomparable();
|
||||
|
||||
DArenaIterator & other_ix = *other;
|
||||
|
||||
return ix.compare(other_ix);
|
||||
}
|
||||
|
||||
void
|
||||
IAllocIterator_DArenaIterator::next(DArenaIterator & ix) noexcept
|
||||
{
|
||||
ix.next();
|
||||
}
|
||||
} /*namespace mm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IAllocIterator_DArenaIterator.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue