call malloc_trim only on linux

This commit is contained in:
Frank Cui 2023-11-04 00:02:31 +08:00 committed by acgnhiki
parent 78c561c12e
commit b504dc04c2

View File

@ -1,8 +1,9 @@
from ctypes import cdll from ctypes import cdll
from ctypes.util import find_library from ctypes.util import find_library
from sys import platform
lib_name = find_library('c') lib_name = find_library('c')
if not lib_name: if not lib_name or platform != 'linux':
libc = None libc = None
else: else:
libc = cdll.LoadLibrary(lib_name) libc = cdll.LoadLibrary(lib_name)