absl::CordMemoryAccounting

Memory accounting modes for Cord::EstimatedMemoryUsage().

Synopsis

Declared in <absl/strings/cord.h>

enum class CordMemoryAccounting : int;

Members

NameDescription
kTotal Counts the approximate number of bytes held in full or in part by this Cord (which may not remain the same between invocations). Cords that share memory could each be "charged" independently for the same shared memory. See also comment on kTotalMorePrecise on internally shared memory.
kTotalMorePrecise Counts the approximate number of bytes held in full or in part by this Cord for the distinct memory held by this cord. This option is similar to kTotal, except that if the cord has multiple references to the same memory, that memory is only counted once.
kFairShare Counts the approximate number of bytes held in full or in part by this Cord weighted by the sharing ratio of that data. For example, if some data edge is shared by 4 different Cords, then each cord is attributed 1/4th of the total memory usage as a 'fair share' of the total memory usage.