fix: avoid malloc_trim non non-gnu systems (#353)

This commit is contained in:
Ilya Zlobintsev 2024-08-06 09:32:55 +03:00 committed by GitHub
parent 4db593c73f
commit 88e9026c78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,6 +140,7 @@ impl<'a> Handler {
// Eagerly release memory
// `load_controllers` allocates and deallocates the entire PCI ID database,
// this tells the os to release it right away, lowering measured memory usage (the actual usage is low regardless as it was already deallocated)
#[cfg(target_env = "gnu")]
unsafe {
libc::malloc_trim(0);
}