1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-12-09 09:56:01 +02:00
imgproxy/memory/free_linux.go

22 lines
251 B
Go
Raw Normal View History

2021-11-15 11:37:56 +02:00
//go:build linux
// +build linux
2020-01-10 16:52:40 +02:00
2021-04-26 13:52:50 +02:00
package memory
2020-01-10 16:52:40 +02:00
/*
#include <features.h>
#ifdef __GLIBC__
#include <malloc.h>
#else
void malloc_trim(size_t pad){}
#endif
*/
import "C"
import "runtime/debug"
2021-04-26 13:52:50 +02:00
func Free() {
2020-01-10 16:52:40 +02:00
debug.FreeOSMemory()
C.malloc_trim(0)
}