xo-object2: utest: ++ allocation in collector utest
This commit is contained in:
parent
6bd33bd900
commit
3f1470f938
18 changed files with 196 additions and 26 deletions
|
|
@ -5,10 +5,29 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <xo/alloc2/Allocator.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
using DFloat = double;
|
||||
} /*nmaespace obj*/
|
||||
struct DFloat {
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
||||
explicit DFloat(double x) : value_{x} {}
|
||||
|
||||
/** allocate boxed value @p x using memory from @p mm **/
|
||||
static DFloat * make(obj<AAllocator> mm,
|
||||
double x);
|
||||
|
||||
double value() const noexcept { return value_; }
|
||||
|
||||
operator double() const noexcept { return value_; }
|
||||
|
||||
private:
|
||||
|
||||
/** boxed floating-oint value **/
|
||||
double value_;
|
||||
};
|
||||
} /*nmaespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end DFloat.hpp */
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@
|
|||
* @author Roland Conybeare, Dec 2025
|
||||
**/
|
||||
|
||||
#include "xo/gc/GCObject.hpp"
|
||||
#pragma once
|
||||
|
||||
#include <xo/gc/GCObject.hpp>
|
||||
//#include "xo/alloc2/gcobject/RGCObject.hpp"
|
||||
#include "xo/facet/obj.hpp"
|
||||
#include <xo/facet/obj.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue