pub struct PackWriteLimits {
pub compression_working_set: ByteBudget,
pub decoded_object: ByteBudget,
pub delta_base: ByteBudget,
}Expand description
Memory budgets for streaming pack generation.
Compression windows are admitted by these byte budgets, not by a fixed
object count. A single object larger than Self::compression_working_set
but within Self::decoded_object is written as an explicit one-object
quantum. A single retained delta base may likewise exceed
Self::delta_base and is kept alone. Either case is documented by the
resulting working-set high-water mark; nothing else may silently exceed
the configured budgets.
Peak charged memory is at most compression_working_set + delta_base plus
one leftover lookahead object that did not fit the current window, and one
oversized one-object quantum or retained base. The leftover is charged so
decoded RAM cannot silently approach twice the working-set budget.
Zlib output buffers and allocator slack are not included.
Fields§
§compression_working_set: ByteBudgetDecoded bodies plus per-object overhead admitted into one compression quantum.
decoded_object: ByteBudgetHard cap on one decoded object body. Exceeding this is a typed limit error; the object is not treated as a one-object quantum.
delta_base: ByteBudgetRetained sliding-window delta-base bodies. Charged separately from the compression working set.
Implementations§
Source§impl PackWriteLimits
impl PackWriteLimits
Sourcepub fn new() -> Self
pub fn new() -> Self
Fail-closed defaults: 32 MiB compression working set, 512 MiB single decoded object, 32 MiB retained delta bases.
pub fn with_compression_working_set(self, budget: ByteBudget) -> Self
pub fn with_decoded_object(self, budget: ByteBudget) -> Self
pub fn with_delta_base(self, budget: ByteBudget) -> Self
Trait Implementations§
Source§impl Clone for PackWriteLimits
impl Clone for PackWriteLimits
Source§fn clone(&self) -> PackWriteLimits
fn clone(&self) -> PackWriteLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more