Merge pull request #5897 from dearblue/doc/MRB_HEAP_PAGE_SIZE

Added more description of the `MRB_HEAP_PAGE_SIZE` configuration
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-01-02 10:00:30 +09:00
committed by GitHub
+5
View File
@@ -123,6 +123,11 @@ end
- Defines value is `1024`.
- Specifies number of `RBasic` per each heap page.
- To calculate the number of bytes per heap page, it is "(size of management data per heap page) + (size per object) * `MRB_HEAP_PAGE_SIZE`".
In mruby 3.1.0, the "size of management data per heap page" is 6 words, also "size per object" is 6 words.
For a 32-bit CPU, `(6 * 4) + (6 * 4) * MRB_HEAP_PAGE_SIZE` gives the bytes of size per heap page.
Conversely, for example, to keep the size per heap page to 4 Ki bytes,
calculate `(4096 - (6 * 4)) / (6 * 4)` to specify `MRB_HEAP_PAGE_SIZE=169`.
## Memory pool configuration