Repository navigation
runtime: improve free_memory implementation for OpenBSD - #24431
Merged
Merged
Conversation
It's more accurate to use sysctl with uvmexp struct (statistics about the UVM memory management system) to get pagesize and free pages, than using calls to C.sysconf. Signed-off-by: Laurent Cheylus <foxy@free.fr>
|
Connected to Huly®: V_0.6-22802 |
Delta456
approved these changes
May 7, 2025
Contributor
|
Is there a difference in the reported sizes before/after the patch? |
Contributor
Author
Yes, there is a difference in the reported number of free pages between direct call to |
Contributor
|
Thank you. |
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.
It's more accurate to use
sysctlwithuvmexpstruct (statistics about the UVM memory management system) to get pagesize and free pages, than using calls toC.sysconf.See OpenBSD uvm/uvmexp.h include file for definition of
uvmexpstruct.Tests OK on OpenBSD current/amd64
get_free_memory.v:$ ./v run ~/tmp/get_free_memory.v OS: openbsd total memory: 4278042624 free memory: 1475702784