diff --git a/src/steam/engine/buffer-provider.cpp b/src/steam/engine/buffer-provider.cpp index 53c56d856..dd7883799 100644 --- a/src/steam/engine/buffer-provider.cpp +++ b/src/steam/engine/buffer-provider.cpp @@ -78,17 +78,20 @@ namespace engine { } - /** callback from implementation to build and enrol a BufferHandle, + /** + * Callback from implementation to build and enrol a BufferHandle, * to be returned to the client as result of the #lockBuffer call. * Performs the necessary metadata state transition leading from an * abstract buffer type to a metadata::Entry corresponding to an * actual buffer, which is locked for exclusive use by one client. + * @note the implementation is free to provide an opaque \a implMarker, + * which becomes part of the key to designate this specific buffer. */ BuffHandle - BufferProvider::buildHandle (HashVal typeID, Buff* storage, LocalTag const& localTag) + BufferProvider::buildHandle (HashVal typeID, Buff* storage, LocalTag implMarker) { metadata::Key& typeKey = bufferStage_->get (typeID); - metadata::Entry& entry = bufferStage_->markLocked(typeKey, storage, localTag); + metadata::Entry& entry = bufferStage_->markLocked (typeKey, storage, implMarker); return BuffHandle (BuffDescr(*this, entry), storage); } @@ -136,8 +139,10 @@ namespace engine { { REQUIRE (was_created_by_this_provider (type)); size_t buffSiz = getBufferSize (type); - return bufferStore_->provideBuffer (buffSiz, type); - } // is expected to call buildHandle() --> state transition + LocalTag implMarker; + Buff& storage = bufferStore_->provideBuffer (buffSiz, type, implMarker); + return buildHandle (type, &storage, implMarker); + } /** BufferProvider API: state transition to \em emitted state. diff --git a/src/steam/engine/buffer-provider.hpp b/src/steam/engine/buffer-provider.hpp index 7a2f93c85..4261a94e1 100644 --- a/src/steam/engine/buffer-provider.hpp +++ b/src/steam/engine/buffer-provider.hpp @@ -183,7 +183,7 @@ namespace engine { /// placeholder marker type for an actual data buffer using Buff = StreamType::ImplFacade::DataBuffer; - BuffHandle buildHandle (HashVal typeID, Buff* storage, LocalTag const& =LocalTag::UNKNOWN); + BuffHandle buildHandle (HashVal typeID, Buff* storage, LocalTag =LocalTag::UNKNOWN); bool was_created_by_this_provider (BuffDescr const&) const; @@ -203,10 +203,10 @@ namespace engine { public: virtual ~BufferStore() { } ///< this is an interface - virtual uint prepareBuffers (uint cnt, size_t,HashVal typeID) =0; - virtual BuffHandle provideBuffer (size_t,HashVal typeID) =0; - virtual void mark_emitted (size_t,HashVal, LocalTag const&) =0; - virtual void detachBuffer (size_t,HashVal, LocalTag const&, Buff&) =0; + virtual uint prepareBuffers (uint cnt, size_t,HashVal typeID) =0; + virtual Buff& provideBuffer (size_t,HashVal typeID, LocalTag&) =0; + virtual void mark_emitted (size_t,HashVal, LocalTag const&) =0; + virtual void detachBuffer (size_t,HashVal, LocalTag, Buff&) =0; }; unique_ptr bufferStage_; ///////////////////////////////////////////////////////////TICKET #1410 : must be turned into an internal interface diff --git a/src/steam/engine/heap-mem-buffer-store.cpp b/src/steam/engine/heap-mem-buffer-store.cpp index b6f590185..2cd66fe32 100644 --- a/src/steam/engine/heap-mem-buffer-store.cpp +++ b/src/steam/engine/heap-mem-buffer-store.cpp @@ -288,13 +288,13 @@ namespace engine { } - BuffHandle - HeapMemProvider::provideBuffer (size_t buffSiz, HashVal typeID) + Buff& + HeapMemProvider::provideBuffer (size_t buffSiz, HashVal typeID, LocalTag&) { BlockPool& blocks = getBlockPoolFor (buffSiz, typeID); Block& newBlock = blocks.createBlock(); - UNIMPLEMENTED ("Separate tasks into two distinct APIs"); -// return buildHandle (typeID, asBuffer(newBlock.accessMemory()), &newBlock); /////////////////////////////OOO instead return a tuple (buffer, localTag) + LocalTag specifics{&newBlock}; // used by this implementation to find the storage to release later + return * asBuffer(newBlock.accessMemory()); } @@ -320,7 +320,7 @@ namespace engine { /** mark a buffer as officially discarded */ void - HeapMemProvider::detachBuffer (size_t buffSiz, HashVal typeID, LocalTag const& specifics, Buff& storage) + HeapMemProvider::detachBuffer (size_t buffSiz, HashVal typeID, LocalTag specifics, Buff& storage) { Block* block4buffer = locateBlock (buffSiz, typeID, specifics); REQUIRE (block4buffer, "releasing a buffer not allocated through this provider"); diff --git a/src/steam/engine/heap-mem-buffer-store.hpp b/src/steam/engine/heap-mem-buffer-store.hpp index 148a47a8c..18272f24e 100644 --- a/src/steam/engine/heap-mem-buffer-store.hpp +++ b/src/steam/engine/heap-mem-buffer-store.hpp @@ -83,10 +83,10 @@ namespace engine { public: /* === BufferStore interface === */ - virtual uint prepareBuffers (uint cnt, size_t,HashVal typeID) override; - virtual BuffHandle provideBuffer (size_t,HashVal typeID) override; - virtual void mark_emitted (size_t,HashVal, LocalTag const&) override; - virtual void detachBuffer (size_t,HashVal, LocalTag const&, Buff&) override; + virtual uint prepareBuffers (uint cnt, size_t,HashVal typeID) override; + virtual Buff& provideBuffer (size_t,HashVal, LocalTag&) override; + virtual void mark_emitted (size_t,HashVal, LocalTag const&) override; + virtual void detachBuffer (size_t,HashVal, LocalTag, Buff&) override; public: ~HeapMemProvider(); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index c76f0719b..bbee40bd1 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -111530,8 +111530,9 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + + @@ -111541,8 +111542,9 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + + @@ -111567,6 +111569,9 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) + + + @@ -111650,20 +111655,33 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + - - + + + + + + + +

+ zumal das nirgends im Code dokumentiert ist, und diese implizite Annahme nichts zum Begreifen beiträgt (da sich hier zwei Layer vermischen, und man Informationen durch den Implementierungs-Call durchfädeln muß) +

+ + +
+ +
- - + + - - + + @@ -111685,13 +111703,19 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - - + + - + + + + + + + - - + + @@ -111753,7 +111777,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + @@ -111783,9 +111807,9 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + - + @@ -111817,6 +111841,9 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) + + + @@ -111829,8 +111856,8 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - - + + @@ -111841,23 +111868,26 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - - - + + - - - - + + + + + + + + - + - + @@ -111890,10 +111920,18 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - - + + - + + + + + + + + + @@ -112252,7 +112290,9 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + + + @@ -112288,7 +112328,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + @@ -112304,6 +112344,7 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) + @@ -112629,8 +112670,25 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + + + + + + + + + + + +

+ auf dem BufferStore-API werden lediglich drei Aufrufe übrig bleiben. Von denen zudem zwei speziell sind. Und jede Implementierung wird lediglich dieses Tupel wieder auseinandernehmen... +

+ + +
+