Merged
Conversation
added 2 commits
January 31, 2026 17:21
- Add GhostConfig structure for customizable configuration - Support disk-backed storage mode as alternative to in-memory compression - Add configurable max_memory_pages to override MAX_PHYSICAL_PAGES constant - Add compress_before_disk option for disk backing mode - Implement cross-platform disk I/O (Windows: CreateFile/ReadFile/WriteFile, Linux: open/read/write) - Update FreezePage() to write compressed pages to disk when enabled - Update page fault handlers to restore pages from disk - Add Initialize() method for configuration before allocation - Add destructor for proper file cleanup - Update demo application with commented disk-backing example - Update API_REFERENCE.md with GhostConfig documentation - Update INTEGRATION_GUIDE.md with disk-backing best practices - Update README.md to explain storage modes - All 25 tests passing
- Add 4 new tests for GhostConfig structure validation - Test default configuration values - Test disk-backed mode with compression - Test disk-backed mode without compression - Test configuration structure compilation - All 29 tests passing
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.
This pull request introduces full support for disk-backed storage of compressed pages in the GhostMem memory manager, making it possible to swap compressed pages to disk instead of only storing them in RAM. The changes include a new configuration structure (
GhostConfig), updated documentation, a new disk-backed implementation inGhostMemoryManager, and tests for the new feature. The documentation now clearly explains the configuration options, use cases, and performance trade-offs between in-memory and disk-backed modes.Key changes:
1. Disk-Backed Storage Implementation
GhostMemoryManager, including methods for initializing, opening, closing, reading, and writing to a disk file, as well as logic to choose between in-memory and disk-backed storage based on configuration (GhostConfig). [1] [2] [3]2. Configuration System
GhostConfigstructure to allow users to configure disk backing, file path, compression, and maximum in-memory page limits. Added anInitializemethod toGhostMemoryManagerto accept this configuration. [1] [2]3. Documentation Updates
README.mdto describe disk-backed mode, its benefits, configuration, and comparison to in-memory mode. Added code samples and clarified performance trade-offs. [1] [2] [3] [4]4. Testing
tests/test_disk_backing.cppto the build system to ensure disk-backed mode is tested.5. Miscellaneous Improvements
These changes make GhostMem more flexible and suitable for both high-performance and memory-constrained environments, with clear documentation and configuration options for end users.