PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pf_cache_policy_entry_v1 Struct Reference

One optional resident cache size. More...

#include <pineforge.h>

Data Fields

uint32_t kind
 
uint32_t reserved
 
uint64_t capacity_bytes
 

Detailed Description

One optional resident cache size.

Ordinary C alignment applies: kind is uint32_t and capacity_bytes is uint64_t, with no packed wire layout. Every capacity is in bytes. For PF_CACHE_KIND_LEDGER_CACHE, the engine selects the largest row count R with R * TradeLedger::kLedgerEntryBytes + ceil(R / 256) * sizeof(void*) <= capacity_bytes (312 bytes per decoded entry and 8 bytes per page pointer on LP64). The default is 20,449,280 bytes for 65,536 rows on LP64. Zero selects the existing zero-row bypass minimum. A nonzero capacity converting to fewer than one row fails with setting_rejected, input="cache_policy", reason="value_below_minimum"; above the existing 1,048,576-row ceiling it fails with the same input and reason="value_above_maximum". No clamping or sub-row bypass occurs. The ledger keeps private pages; its allowance includes their page directory. Allocated pointers and pages are reported once in cache resident bytes. Optional directory/page allocation failure permanently bypasses further cache allocation for that ledger, preserving backing reads and writes. Other kinds include optional line metadata in their byte allowances and bypass when below one line. Reads still use backing at zero capacity. reserved must be zero; a nonzero word is a typed setting_rejected error.

Definition at line 960 of file pineforge.h.

Field Documentation

◆ kind

uint32_t pf_cache_policy_entry_v1::kind

Definition at line 961 of file pineforge.h.

◆ reserved

uint32_t pf_cache_policy_entry_v1::reserved

Definition at line 962 of file pineforge.h.

◆ capacity_bytes

uint64_t pf_cache_policy_entry_v1::capacity_bytes

Definition at line 963 of file pineforge.h.


The documentation for this struct was generated from the following file: