Skip to content

Feature/disk io#4

Merged
el-dockerr merged 7 commits intomainfrom
feature/diskIO
Jan 31, 2026
Merged

Feature/disk io#4
el-dockerr merged 7 commits intomainfrom
feature/diskIO

Conversation

@el-dockerr
Copy link
Copy Markdown
Owner

@el-dockerr el-dockerr commented Jan 31, 2026

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 in GhostMemoryManager, 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

  • Added disk-backed storage support to 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]
  • Updated eviction and page freezing logic to handle both in-memory and disk-backed compressed page storage, with optional compression before writing to disk.

2. Configuration System

  • Introduced a new GhostConfig structure to allow users to configure disk backing, file path, compression, and maximum in-memory page limits. Added an Initialize method to GhostMemoryManager to accept this configuration. [1] [2]
  • Updated the integration guide and API reference to document all new configuration options and provide usage examples for both in-memory and disk-backed modes. [1] [2] [3]

3. Documentation Updates

  • Expanded the README.md to 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]
  • Improved the integration guide to include best practices for choosing between in-memory and disk-backed modes, with configuration tables and example scenarios. [1] [2] [3]

4. Testing

  • Added a new test file tests/test_disk_backing.cpp to the build system to ensure disk-backed mode is tested.

5. Miscellaneous Improvements

  • Enabled ARM architecture support in the documentation checklist.

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.

Swen Kalski 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
@el-dockerr el-dockerr self-assigned this Jan 31, 2026
@el-dockerr el-dockerr merged commit 59a663a into main Jan 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant