Derecho-Project / derecho

The main code repository for the Derecho project.
BSD 3-Clause "New" or "Revised" License
186 stars 47 forks source link

Removing a copy on appending log to Persistent<T> #279

Closed songweijia closed 4 months ago

songweijia commented 4 months ago

This is a redo of pull #276 by excluding the other bugfixes merged in v2.4.0

We can avoid the copy when we appending to the persistent log. The idea is to use a 'data generator' lambda to do the work so that the object can be serialized directly to the persistent data region. This pull request involves changed IDeltaSupport API:

/** Removed in this pull request.
void IDeltaSupport::finalizeCurrentDelta(const DeltaFinalizer&);
**/

/** Added in this pull request. */
size_t IDeltaSupport::currentDeltaToBytes(uint8_t* const);
size_t IDeltaSupport::currentDeltaSize();