Library: reorganise test helpers and cover logging tracker object
...these features are now used quite regularly, and so a dedicated documentation test seems indicated. Actually my intention is to add a tracking allocator to these test helpers (and then to use that to verify the custom allocator usage of `lib::Several`)
This commit is contained in:
parent
d327094603
commit
e82dd86b39
19 changed files with 460 additions and 34 deletions
|
|
@ -49,6 +49,7 @@
|
|||
** @see allocation-cluster.hpp
|
||||
** @see steam::fixture::Segment
|
||||
** @see steam::engine::JobTicket
|
||||
** @see tracking-allocator.hpp
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
|
||||
#include "lib/test/test-helper.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
#include "lib/format-string.hpp"
|
||||
#include "lib/format-cout.hpp"
|
||||
#include "lib/unique-malloc-owner.hpp"
|
||||
|
|
|
|||
255
src/lib/test/tracking-allocator.hpp
Normal file
255
src/lib/test/tracking-allocator.hpp
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
/*
|
||||
TRACKING-ALLOCATOR.hpp - test dummy objects for tracking ctor/dtor calls
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2023, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
/** @file tracking-allocator.hpp
|
||||
** unittest helper code: a custom allocator to track memory usage.
|
||||
** By registering each allocation and deallocation, correct memory handling
|
||||
** can be verified and memory usage can be investigated in practice.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef LIB_TEST_TRACKING_ALLOCATOR_H
|
||||
#define LIB_TEST_TRACKING_ALLOCATOR_H
|
||||
|
||||
#include "lib/error.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
#include <list>
|
||||
|
||||
|
||||
|
||||
namespace lib {
|
||||
namespace allo {///< Concepts and Adaptors for custom memory management
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1366 : define Allocator Concepts here
|
||||
/// TODO the following Concepts can be expected here (with C++20)
|
||||
/// - Allocator : for the bare memory allocation
|
||||
/// - Factory : for object fabrication and disposal
|
||||
/// - Handle : a functor front-end to be dependency-injected
|
||||
|
||||
|
||||
/**
|
||||
* Adapter to implement the *Factory* concept based on a `std::allocator`
|
||||
* @tparam ALO a std::allocator instance or anything compliant to [Allocator]
|
||||
* [Allocator]: https://en.cppreference.com/w/cpp/named_req/Allocator
|
||||
* @note in addition to the abilities defined by the standard, this adapter
|
||||
* strives to provide some kind of _lateral leeway,_ attempting to
|
||||
* create dedicated allocators for other types than the BaseType
|
||||
* implied by the given \a ALO (standard-allocator).
|
||||
* - this is possible if the rebound allocator can be constructed
|
||||
* from the given base allocator
|
||||
* - alternatively, an attempt will be made to default-construct
|
||||
* the rebound allocator for the other type requested.
|
||||
* @warning Both avenues for adaptation may fail,
|
||||
* which could lead to compilation or runtime failure.
|
||||
* @remark deliberately this class inherits from the allocator,
|
||||
* allowing to exploit empty-base-optimisation, since
|
||||
* usage of monostate allocators is quite common.
|
||||
*/
|
||||
template<class ALO>
|
||||
class StdFactory
|
||||
: private ALO
|
||||
{
|
||||
using Allo = ALO;
|
||||
using AlloT = std::allocator_traits<Allo>;
|
||||
using BaseType = typename Allo::value_type;
|
||||
|
||||
Allo& baseAllocator() { return *this; }
|
||||
|
||||
template<typename X>
|
||||
auto
|
||||
adaptAllocator()
|
||||
{
|
||||
using XAllo = typename AlloT::template rebind_alloc<X>;
|
||||
if constexpr (std::is_constructible_v<XAllo, Allo>)
|
||||
return XAllo{baseAllocator()};
|
||||
else
|
||||
return XAllo{};
|
||||
}
|
||||
|
||||
template<class ALOT, typename...ARGS>
|
||||
typename ALOT::pointer
|
||||
construct (typename ALOT::allocator_type& allo, ARGS&& ...args)
|
||||
{
|
||||
auto loc = ALOT::allocate (allo, 1);
|
||||
try { ALOT::construct (allo, loc, std::forward<ARGS>(args)...); }
|
||||
catch(...)
|
||||
{
|
||||
ALOT::deallocate (allo, loc, 1);
|
||||
throw;
|
||||
}
|
||||
return loc;
|
||||
}
|
||||
|
||||
template<class ALOT>
|
||||
void
|
||||
destroy (typename ALOT::allocator_type& allo, typename ALOT::pointer elm)
|
||||
{
|
||||
ALOT::destroy (allo, elm);
|
||||
ALOT::deallocate (allo, elm, 1);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* Create an instance of the adapter factory,
|
||||
* forwarding to the embedded standard conforming allocator
|
||||
* for object creation and destruction and memory management.
|
||||
* @param allo (optional) instance of the C++ standard allocator
|
||||
* used for delegation, will be default constructed if omitted.
|
||||
* @remark the adapted standard allocator is assumed to be either a copyable
|
||||
* value object, or even a mono-state; in both cases, a dedicated
|
||||
* manager instance residing »elsewhere« is referred, rendering
|
||||
* all those front-end instances exchangeable.
|
||||
*/
|
||||
StdFactory (Allo allo = Allo{})
|
||||
: Allo{std::move (allo)}
|
||||
{ }
|
||||
|
||||
template<class XALO>
|
||||
bool constexpr operator== (StdFactory<XALO> const& o) const
|
||||
{
|
||||
return baseAllocator() == o.baseAllocator();
|
||||
}
|
||||
template<class XALO>
|
||||
bool constexpr operator!= (StdFactory<XALO> const& o) const
|
||||
{
|
||||
return not (*this == o);
|
||||
}
|
||||
|
||||
|
||||
/** create new element using the embedded allocator */
|
||||
template<class TY, typename...ARGS>
|
||||
TY*
|
||||
create (ARGS&& ...args)
|
||||
{
|
||||
if constexpr (std::is_same_v<TY, BaseType>)
|
||||
{
|
||||
return construct<AlloT> (baseAllocator(), std::forward<ARGS>(args)...);
|
||||
}
|
||||
else
|
||||
{
|
||||
using XAlloT = typename AlloT::template rebind_traits<TY>;
|
||||
auto xAllo = adaptAllocator<TY>();
|
||||
return construct<XAlloT> (xAllo, std::forward<ARGS>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
/** destroy the given element and discard the associated memory */
|
||||
template<class TY>
|
||||
void
|
||||
dispose (TY* elm)
|
||||
{
|
||||
if constexpr (std::is_same_v<TY, BaseType>)
|
||||
{
|
||||
destroy<AlloT> (baseAllocator(), elm);
|
||||
}
|
||||
else
|
||||
{
|
||||
using XAlloT = typename AlloT::template rebind_traits<TY>;
|
||||
auto xAllo = adaptAllocator<TY>();
|
||||
destroy<XAlloT> (xAllo, elm);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1366 : the following code becomes obsolete in the long term
|
||||
|
||||
/**
|
||||
* Placeholder implementation for a custom allocator
|
||||
* @todo shall be replaced by an AllocationCluster eventually
|
||||
* @todo 5/2024 to be reworked and aligned with a prospective C++20 Allocator Concept /////////////////////TICKET #1366
|
||||
* @remark using `std::list` container, since re-entrant allocation calls are possible,
|
||||
* meaning that further allocations will be requested recursively from a ctor.
|
||||
* Moreover, for the same reason we separate the allocation from the ctor call,
|
||||
* so we can capture the address of the new allocation prior to any possible
|
||||
* re-entrant call, and handle clean-up of allocation without requiring any
|
||||
* additional state flags.....
|
||||
*/
|
||||
template<typename TY>
|
||||
class AllocatorHandle
|
||||
{
|
||||
struct Allocation
|
||||
{
|
||||
alignas(TY)
|
||||
std::byte buf_[sizeof(TY)];
|
||||
|
||||
template<typename...ARGS>
|
||||
TY&
|
||||
create (ARGS&& ...args)
|
||||
{
|
||||
return *new(&buf_) TY {std::forward<ARGS> (args)...};
|
||||
}
|
||||
|
||||
TY&
|
||||
access()
|
||||
{
|
||||
return * std::launder (reinterpret_cast<TY*> (&buf_));
|
||||
}
|
||||
void
|
||||
discard() /// @warning strong assumption made here: Payload was created
|
||||
{
|
||||
access().~TY();
|
||||
}
|
||||
};
|
||||
|
||||
std::list<Allocation> storage_;
|
||||
|
||||
public:
|
||||
template<typename...ARGS>
|
||||
TY&
|
||||
operator() (ARGS&& ...args)
|
||||
{ // EX_STRONG
|
||||
auto pos = storage_.emplace (storage_.end()); ////////////////////////////////////////////////////TICKET #230 : real implementation should care for concurrency here
|
||||
try {
|
||||
return pos->create (std::forward<ARGS> (args)...);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
storage_.erase (pos); // EX_FREE
|
||||
|
||||
const char* errID = lumiera_error();
|
||||
ERROR (memory, "Allocation failed with unknown exception. "
|
||||
"Lumiera errorID=%s", errID?errID:"??");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/** @note need to do explicit clean-up, since a ctor-call might have been failed,
|
||||
* and we have no simple way to record this fact internally in Allocation,
|
||||
* short of wasting additional memory for a flag to mark this situation */
|
||||
~AllocatorHandle()
|
||||
try {
|
||||
for (auto& alloc : storage_)
|
||||
alloc.discard();
|
||||
}
|
||||
ERROR_LOG_AND_IGNORE (memory, "clean-up of custom AllocatorHandle")
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace lib
|
||||
#endif /*LIB_TEST_TRACKING_ALLOCATOR_H*/
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
TESTDUMMY.hpp - yet another test dummy for tracking ctor/dtor calls
|
||||
TRACKING-DUMMY.hpp - test dummy objects for tracking ctor/dtor calls
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
* *****************************************************/
|
||||
|
||||
|
||||
/** @file testdummy.hpp
|
||||
/** @file tracking-dummy.hpp
|
||||
** unittest helper code: test dummy objects to track instances.
|
||||
** These can be used to verify proper allocation handling, either by
|
||||
** watching the checksum of \ref Dummy, or by matching on the \ref EventLog
|
||||
|
|
@ -29,6 +29,10 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef LIB_TEST_TRACKING_DUMMY_H
|
||||
#define LIB_TEST_TRACKING_DUMMY_H
|
||||
|
||||
|
||||
#include "lib/nocopy.hpp"
|
||||
#include "lib/test/event-log.hpp"
|
||||
#include "lib/format-string.hpp"
|
||||
|
|
@ -229,4 +233,4 @@ namespace test{
|
|||
|
||||
|
||||
}} // namespace lib::test
|
||||
|
||||
#endif /*LIB_TEST_TRACKING_DUMMY_H*/
|
||||
|
|
@ -101,3 +101,7 @@ return: 0
|
|||
END
|
||||
|
||||
|
||||
TEST "Object and allocation tracking" TestTracking_test <<END
|
||||
return: 0
|
||||
END
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "lib/error.hpp"
|
||||
#include "lib/test/run.hpp"
|
||||
#include "lib/test/test-helper.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
#include "lib/util-foreach.hpp"
|
||||
#include "steam/engine/testframe.hpp"
|
||||
#include "steam/engine/diagnostic-buffer-provider.hpp"
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include "lib/allocation-cluster.hpp"
|
||||
#include "lib/linked-elements.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
#include "lib/iter-source.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include "lib/meta/function.hpp"
|
||||
#include "lib/meta/tuple-helper.hpp"
|
||||
#include "lib/test/test-helper.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
#include "lib/format-cout.hpp"
|
||||
#include "lib/format-util.hpp"
|
||||
#include "lib/util.hpp"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "lib/util.hpp"
|
||||
|
||||
#include "lib/scoped-collection.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
#include "lib/error.hpp"
|
||||
|
||||
#include "lib/scoped-holder.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
|
||||
#include <map>
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
#include "lib/scoped-holder.hpp"
|
||||
#include "lib/scoped-holder-transfer.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "lib/util.hpp"
|
||||
|
||||
#include "lib/scoped-ptrvect.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
|
||||
|
||||
namespace lib {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
|
||||
#include "lib/test/run.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
#include "lib/test/test-coll.hpp"
|
||||
#include "lib/test/test-helper.hpp"
|
||||
#include "lib/test/diagnostic-output.hpp"////////////////TODO
|
||||
|
|
|
|||
133
tests/library/test/test-tracking-test.cpp
Normal file
133
tests/library/test/test-tracking-test.cpp
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
/*
|
||||
TestTracking(Test) - demonstrate test helpers for tracking automated clean-up
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2024, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
/** @file test-tracking-test.cpp
|
||||
** unit test \ref TestTracking_test
|
||||
*/
|
||||
|
||||
|
||||
#include "lib/test/run.hpp"
|
||||
#include "lib/test/test-helper.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
#include "lib/test/tracking-allocator.hpp"
|
||||
#include "lib/format-cout.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
using std::string;
|
||||
using util::toString;
|
||||
|
||||
|
||||
namespace lib {
|
||||
namespace test{
|
||||
namespace test{
|
||||
|
||||
|
||||
/***************************************************//**
|
||||
* @test verify proper working of test helpers to track
|
||||
* automated clean-up and memory deallocation.
|
||||
* @see TestHelper_test
|
||||
* @see tracking-dummy.hpp
|
||||
* @see tracking-allocator.hpp
|
||||
*/
|
||||
class TestTracking_test : public Test
|
||||
{
|
||||
void
|
||||
run (Arg)
|
||||
{
|
||||
demonstrate_logObject();
|
||||
demonstrate_checkObject();
|
||||
demonstrate_checkAllocator();
|
||||
}
|
||||
|
||||
|
||||
/** @test capture object lifecycle events in the EventLog.
|
||||
* @see EventLog_test
|
||||
* @see LateBindInstance_test
|
||||
*/
|
||||
void
|
||||
demonstrate_logObject ()
|
||||
{
|
||||
auto& log = Tracker::log;
|
||||
log.clear (this);
|
||||
|
||||
Tracker alpha; // (1) create α
|
||||
auto randomAlpha = toString(alpha.val);
|
||||
|
||||
log.note("type=ID",alpha.val); // (2) α has an random ID
|
||||
{
|
||||
Tracker beta{55}; // (3) create β
|
||||
alpha = beta; // (4) assign α ≔ β
|
||||
}
|
||||
log.note("type=ID",alpha.val); // (5) thus α now also bears the ID 55 of β
|
||||
Tracker gamma = move(alpha); // (6) create γ by move-defuncting α
|
||||
{
|
||||
Tracker delta(23); // (7) create δ with ID 23
|
||||
delta = move(gamma); // (8) move-assign δ ⟵ γ
|
||||
log.note("type=ID",delta.val); // (9) thus δ now bears the ID 55 (moved α ⟶ γ ⟶ δ)
|
||||
}
|
||||
log.note("type=ID",alpha.val); // (X) and thus α is now a zombie object
|
||||
|
||||
cout << "____Tracker-Log_______________\n"
|
||||
<< util::join(Tracker::log, "\n")
|
||||
<< "\n───╼━━━━━━━━━━━╾──────────────"<<endl;
|
||||
|
||||
CHECK (log.verify("EventLogHeader").on("TestTracking_test")
|
||||
.beforeCall("ctor").on(&alpha) // (1) create α
|
||||
.beforeEvent("ID", randomAlpha) // (2) α has an random ID
|
||||
.beforeCall("ctor").arg(55) // (3) create β
|
||||
.beforeCall("assign-copy").on(&alpha).arg("Track{55}") // (4) assign α ≔ β
|
||||
.beforeCall("dtor").arg(55)
|
||||
.beforeEvent("ID", "55") // (5) thus α now also bears the ID 55 of β
|
||||
.beforeCall("ctor-move").on(&gamma).arg("Track{55}") // (6) create γ by move-defuncting α
|
||||
.beforeCall("ctor").arg(23) // (7) create δ with ID 23
|
||||
.beforeCall("assign-move").arg("Track{55}") // (8) move-assign δ ⟵ γ
|
||||
.beforeEvent("ID", "55") // (9) thus δ now bears the ID 55 (moved α ⟶ γ ⟶ δ)
|
||||
.beforeCall("dtor").arg(55)
|
||||
.beforeEvent("ID", toString(Tracker::DEFUNCT)) // (X) and thus α is now a zombie object
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/** @test dummy object with a tracking checksum.
|
||||
*/
|
||||
void
|
||||
demonstrate_checkObject ()
|
||||
{
|
||||
UNIMPLEMENTED ("dummy");
|
||||
}
|
||||
|
||||
|
||||
/** @test custom allocator to track memory handling.
|
||||
*/
|
||||
void
|
||||
demonstrate_checkAllocator ()
|
||||
{
|
||||
UNIMPLEMENTED ("allo");
|
||||
}
|
||||
};
|
||||
|
||||
LAUNCHER (TestTracking_test, "unit common");
|
||||
|
||||
|
||||
}}} // namespace lib::test::test
|
||||
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
|
||||
#include "lib/test/run.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
#include "lib/thread.hpp"
|
||||
|
||||
#include <atomic>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "lib/test/run.hpp"
|
||||
#include "lib/thread.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include "lib/test/run.hpp"
|
||||
|
||||
#include "lib/scoped-holder-transfer.hpp"
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#include "vault/gear/special-job-fun.hpp"
|
||||
#include "lib/format-cout.hpp" ////////////////////////////////////TODO Moo-oh
|
||||
#include "lib/test/diagnostic-output.hpp"//////////////////////////TODO TOD-oh
|
||||
#include "lib/test/testdummy.hpp"
|
||||
#include "lib/test/tracking-dummy.hpp"
|
||||
//#include "lib/util.hpp"
|
||||
|
||||
//#include <array>
|
||||
|
|
|
|||
|
|
@ -83354,8 +83354,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
enthält ein nested template / typedef: <font face="Monospaced" color="#731212">Policy</font>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<arrowlink COLOR="#fafdd6" DESTINATION="ID_23659239" ENDARROW="Default" ENDINCLINATION="-13;-151;" ID="Arrow_ID_579093827" STARTARROW="None" STARTINCLINATION="272;17;"/>
|
||||
</node>
|
||||
<node CREATED="1718373622001" ID="ID_641350815" MODIFIED="1718373638633" TEXT="diese wird hier abgegriffen und für den SeveralBuilder verwendet"/>
|
||||
|
|
@ -83391,8 +83390,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
Name: <font face="Monospaced" color="#7d0d27">SetupSeveral</font>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<node CREATED="1718408597002" ID="ID_1822635550" MODIFIED="1718408607465" TEXT="das deutet eine Namenskonvention an"/>
|
||||
</node>
|
||||
<node CREATED="1718408613255" ID="ID_1638086547" MODIFIED="1718408666260" TEXT="idealerweise ohne direkte Abhängikeit zu several-builder.hpp ">
|
||||
|
|
@ -83412,8 +83410,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
Schema: <font color="#731212" face="Monospaced">Policy<I,E></font>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<linktarget COLOR="#fafdd6" DESTINATION="ID_23659239" ENDARROW="Default" ENDINCLINATION="-13;-151;" ID="Arrow_ID_579093827" SOURCE="ID_1037391385" STARTARROW="None" STARTINCLINATION="272;17;"/>
|
||||
</node>
|
||||
<node CREATED="1718408890347" ID="ID_62564360" MODIFIED="1718408897333" TEXT="dieses wird instantiiert..."/>
|
||||
|
|
@ -83436,8 +83433,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
Denn auch den Allocator verwendet man typischerweise an vielen Stellen, und nicht überall möchte man dann auch several-builder.hpp mit reinziehen; wäre also gut wenn es einfacher Template-Code ist, der mit entspr. Forward-Deklarationen auch »blank« vom Compiler akzeptiert wird
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1718409079204" ID="ID_1662416508" MODIFIED="1718409204382" TEXT="erst zur Instantiierung müssen beide Header da sein">
|
||||
<icon BUILTIN="idea"/>
|
||||
|
|
@ -83461,8 +83457,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<font face="Monospaced" size="2">struct AllocationPolicy;</font>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1718412568076" ID="ID_587369018" MODIFIED="1718412572323" TEXT="namespace allo">
|
||||
|
|
@ -83477,8 +83472,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<font face="Monospaced" size="2">struct SetupSeveral;</font>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -83491,8 +83485,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<font face="Monospaced" size="2" color="#760a3a">SetupSeveral<std::void_t, lib::AllocationCluster&></font>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1718412642779" ID="ID_234744249" MODIFIED="1718412795303" TEXT="Builder wird nur mit einer Referenz auf einen aktuellen AllocationCluster aufgerufen">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
|
|
@ -83502,8 +83495,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
Die Definition der Builder-Methode <font color="#5d158e" face="Monospaced">withAllocator<ALO>(args...)</font>  sollte dazu führen, daß das Konfigurations-Template <font color="#ac1212" face="Monospaced"><b>SetupSeveral</b></font>  genau mit diesen Argumenten instantiiert wird...
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
</node>
|
||||
<node CREATED="1718412831442" ID="ID_155484703" MODIFIED="1718412860303" TEXT="definiere hier diese Policy als ein class-Template, das von AllocationPolicy erbt"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1718412861728" ID="ID_13977121" MODIFIED="1718412883443" TEXT="damit ist der Rahmen geschaffen, um die realloc()-Funktion zu adaptieren">
|
||||
|
|
@ -83522,6 +83514,44 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1718368775878" ID="ID_1921994351" LINK="#ID_28139752" MODIFIED="1718368785941" TEXT="testen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1718462814861" ID="ID_360498640" MODIFIED="1718462821406" TEXT="brauche einen Test-Allocator">
|
||||
<node CREATED="1718462822608" ID="ID_1246144327" MODIFIED="1718462832939" TEXT="soll Heap-Allocations machen"/>
|
||||
<node CREATED="1718462833600" ID="ID_148354832" MODIFIED="1718462843746" TEXT="aber jede Allocation registrieren"/>
|
||||
<node CREATED="1718462844949" ID="ID_878000215" MODIFIED="1718462853370" TEXT="Schnittstelle: Standard-Allocator"/>
|
||||
<node CREATED="1718462854892" ID="ID_1522781067" MODIFIED="1718462863507" TEXT="ansiedeln bei den »Test-Trackern«">
|
||||
<node CREATED="1718462864539" ID="ID_834960302" MODIFIED="1718462870302" TEXT="Ha! die gibt es noch gar nicht"/>
|
||||
<node CREATED="1718462871338" ID="ID_616892475" MODIFIED="1718462876676" TEXT="also: die Header reorganisieren"/>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1718462880129" ID="ID_1726310256" MODIFIED="1718467906896" TEXT="Test-Test">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1718462887129" ID="ID_908994270" MODIFIED="1718467842351" TEXT="demonstrate_logObject">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1718463949770" ID="ID_252224741" MODIFIED="1718463958992" TEXT="Vorlage / Beispiel: LateBindInstance_test">
|
||||
<icon BUILTIN="idea"/>
|
||||
</node>
|
||||
<node CREATED="1718467818948" ID="ID_626920967" MODIFIED="1718467839688" TEXT="puh ... wie ging das nochmal mit diesem EventLog ???">
|
||||
<icon BUILTIN="smiley-neutral"/>
|
||||
<node CREATED="1718467852238" ID="ID_1597919712" MODIFIED="1718467862238" TEXT=""notes" sind erst mal keine Events"/>
|
||||
<node CREATED="1718467863033" ID="ID_577989623" MODIFIED="1718467879864" TEXT="aber wenn man verifyEvent mit dem type-Feld verwendet, geht's"/>
|
||||
<node CREATED="1718467884100" ID="ID_629777074" MODIFIED="1718467902540" TEXT="naja...">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
diese erweiterten Event-Log-Matches sind wohl etwas ad hoc
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1718462887129" ID="ID_1798695685" MODIFIED="1718462911977" TEXT="demonstrate_checkObject"/>
|
||||
<node CREATED="1718462887129" ID="ID_1322153003" MODIFIED="1718462969529" TEXT="demonstrate_checkAllocator"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -83955,8 +83985,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
braucht ein API zum <i>Übernehmen </i>eines bereits konstruierten Objekts
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
</html></richcontent>
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
|
|
|
|||
Loading…
Reference in a new issue