10# if !defined(HPP_ALIB_BOXING_BOXING)
13# if ALIB_MONOMEM && !defined(HPP_ALIB_MONOMEM_MONOALLOCATOR)
20namespace alib {
namespace boxing {
22#if ALIB_DEBUG && !defined(ALIB_DOX)
26 extern long double dbgLongDoubleWriteTestMem[2];
27 long double dbgLongDoubleWriteTestMem[2];
28 extern void dbgLongDoubleTrueLengthSet();
29 void dbgLongDoubleTrueLengthSet()
33 extern bool dbgLongDoubleTrueLengthTest();
34 bool dbgLongDoubleTrueLengthTest()
36 const char* mem=
reinterpret_cast<const char*
>( dbgLongDoubleWriteTestMem );
48 return allocator.
Alloc( size, alignment );
58 for(
integer i= 0; i < length ; ++i )
60 const Box& box= boxArray[i];
65 qtyFlattened+= flattenCount( boxes->data(),
static_cast<integer>(boxes->size()) );
81void flattenInsert(Boxes::iterator& it,
const Box* boxArray,
integer length)
83 for(
integer i= 0; i < length ; ++i )
85 const Box& box= boxArray[i];
87 if( box.IsType<
Boxes*>() )
90 flattenInsert( it, boxes->data(),
static_cast<integer>(boxes->size()) );
94 if( box.IsArrayOf<
Box>() )
100 new( &*it )
Box( box );
115 for(
integer i= 0; i < length ; ++i )
117 const Box& box= boxArray[i];
119 if( box.IsType<
Boxes*>() )
122 qtyFlattened+= flattenCount( boxes->data(),
static_cast<integer>(boxes->size()) );
126 if( box.IsArrayOf<
Box>() )
128 qtyFlattened+= flattenCount( box.UnboxArray<
Box>(), box.
UnboxLength() );
136 auto it= insert(end(),
static_cast<size_t>(qtyFlattened),
Box() );
141 for(
integer i= 0; i < length ; ++i )
143 const Box& box= boxArray[i];
145 if( box.IsType<
Boxes*>() )
148 flattenInsert( it, boxes->data(),
static_cast<integer>(boxes->size()) );
152 if( box.IsArrayOf<
Box>() )
158 new( &*it )
Box( box );
TElementType * UnboxArray() const
integer UnboxLength() const
const TUnboxable Unbox() const
ALIB_API void AddArray(const Box *boxArray, integer length)
ALIB_FORCE_INLINE char * Alloc(size_t size, size_t alignment)
#define ALIB_WARNINGS_RESTORE
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
#define ALIB_ASSERT(cond)
#define ALIB_SIZEOF_LONGDOUBLE_REPORTED
#define ALIB_SIZEOF_LONGDOUBLE_WRITTEN
ALIB_API char * monoAlloc(monomem::MonoAllocator &allocator, size_t size, size_t alignment)
boxing::Boxes Boxes
Type alias in namespace alib.
boxing::Box Box
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.