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.util import find_library
from sys import platform
lib_name = find_library('c')
if not lib_name:
if not lib_name or platform != 'linux':
libc = None
else:
libc = cdll.LoadLibrary(lib_name)