XS fxGrowKeys should delegate to a new fxAllocateKeys, track with a meter #7509
Labels
enhancement
New feature or request
metering
charging for execution (was: package: tame-metering and transform-metering)
vaults_triage
DO NOT USE
xsnap
the XS execution tool
What is the Problem Being Solved?
Per agoric-labs/moddable#9 (comment) :
fxGrowSlots
uses c_realloc() directly, unlike slots/chunks which go through an intermediate fxAllocateChunks/fxAllocateSlots, which xsnapPlatform.c overrides to track in the space meter. So the space used by keys won't be tracked.This keyArray wants to use re-alloc, which is not quite as easy to wrap/track. But when we start trying to meter space allocation in earnest, we should consider creating an fxReallocKeys(), which can be controlled by the platform, and which can compare the old size (i.e. it can somehow learn the old size, maybe it should accept a third arg with the old size, maybe the->keyCount?) and new size, and apply the difference to the meter.
Description of the Design
Security Considerations
Scaling Considerations
Test Plan
The text was updated successfully, but these errors were encountered: