Module solana_runtime::append_vec
source · Expand description
Persistent storage for accounts.
For more information, see:
https://docs.solana.com/implemented-proposals/persistent-account-storage
Modules
Helpers for AppendVec tests and benches
Structs
This struct will be backed by mmaped and snapshotted data files.
So the data layout must be stable and consistent across the entire cluster!
A thread-safe, file-backed block of memory used to store
Account
instances. Append operations
are serialized such that only one thread updates the internal append_lock
at a time. No
restrictions are placed on reading. That is, one may read items from one thread while another
is appending new items.Goal is to eliminate copies and data reshaping given various code paths that store accounts.
This struct contains what is needed to store accounts to a storage
References to account data stored elsewhere. Getting an
Account
requires cloning
(see StoredAccountMeta::clone_account()
).Meta contains enough context to recover the index from storage itself
This struct will be backed by mmaped and snapshotted data files.
So the data layout must be stable and consistent across the entire cluster!
Constants
size of the fixed sized fields in an append vec
we need to add data len and align it to get the actual stored size
Functions
Returns the size this item will take to store plus possible alignment padding bytes before the next entry.
fixed-size portion of per-account data written
plus ‘data_len’, aligned to next boundary