mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-04 10:29:36 +02:00
Global refactoring
This commit is contained in:
20
memory/free_linux.go
Normal file
20
memory/free_linux.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// +build linux
|
||||
|
||||
package memory
|
||||
|
||||
/*
|
||||
#include <features.h>
|
||||
#ifdef __GLIBC__
|
||||
#include <malloc.h>
|
||||
#else
|
||||
void malloc_trim(size_t pad){}
|
||||
#endif
|
||||
*/
|
||||
import "C"
|
||||
import "runtime/debug"
|
||||
|
||||
func Free() {
|
||||
debug.FreeOSMemory()
|
||||
|
||||
C.malloc_trim(0)
|
||||
}
|
Reference in New Issue
Block a user