Draft
Conversation
Raise the per-app persistent storage limit from 6 KiB to 1 MiB. Modern Pebble watches have 32 MB of flash storage, so a 1 MiB per-app limit is reasonable. Update the API documentation accordingly. Fixes coredevices#416 Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Gerard Marull-Paretas <[email protected]>
Commit f88a27b raised PERSIST_STORAGE_MAX_SPACE from 6 KiB to 1 MiB, but settings_file_open pre-allocates the PFS file at ~120% of max_used_space. This means every persist file now claims ~1.2 MiB of flash regardless of actual usage, while most apps use only a few hundred bytes. Decouple the enforcement cap from the physical allocation by adding an alloc_used_space field to SettingsFile that tracks the physical allocation budget separately from max_used_space. A new settings_file_open_growable() API sets alloc_used_space to a small initial value. When a write needs more physical space but fits within the enforcement cap, the file is automatically grown via rewrite with doubling allocation (e.g. 4K -> 8K -> 16K -> ... -> 1M). The persist service now uses settings_file_open_growable() with a 4 KiB initial allocation (~5 KiB physical), close to the old 6 KiB limit. Existing callers of settings_file_open() are unchanged (alloc_used_space equals max_used_space, preserving the old pre-allocation behavior). Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Gerard Marull-Paretas <[email protected]>
|
Is the max value exposed somewhere in the stg? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #416