feat: implement swap usage for linux #175
Open
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.
First of all, thanks for that amazing library, the performance and resource usage are really impressive compared to other similar libraries I've tried.
This PR implements swap for Linux, based on the already existing implementation for RAM that's using the
sysinfo
syscall.It's probably possible to read that information from
/proc/meminfo
on Android, BSD and OpenWRT, but since I'm not having access to a device running BSD (and not enough motivation to test it on Android and OpenWRT because it's already too late in the day), this will be left unimplemented for now. I'd probably implement support for the mentioned operation systems as well if you're generally okay with this change.Cheers.