aumcode/nfx

Add Pile.Put(PilePointer) to overwrite exisitng pointer, prealloc buffer + linking

itadapter opened this issue · 2 comments

Something akin to:

    /// <summary>
    /// Tries to put the new object over an existing one at the pre-define position.
    /// The pointer has to reference a valid allocated block.
    /// If object fits in the allocated block returns true, otherwise tries to create an internal link
    /// to the new pointer which is completely transparent to the caller. The linking may be exlicitly disabled
    /// in which case the method returns false when the new object does not fit into the existing block
    /// </summary>
    /// <param name="obj">A new/modified CLR object to put into the Pile over an existing one</param>
    /// <param name="lifeSpanSec">
    ///  Optional lifeSpanSec will auto-delete object after the interval elapses if
    ///  the pile SupportsObjectExpiration and SweepExpiredObjects is set to true
    /// </param>
    /// <param name="ptr">The pointer to the existing valid allocated block</param>
    /// <param name="link">False to prohibit internal pointer linking</param>
    /// <returns>True if object was inserted, false otherwise (i.e. when linking is false)</returns>
    bool Put(PilePointer ptr, object obj, uint lifeSpanSec = 0, bool link = true);

done, in testing 829b4a8

Passing tests. Closing.