1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-08 10:45:04 +02:00
imgproxy/free_memory_linux.go

21 lines
238 B
Go
Raw Normal View History

2020-01-10 16:52:40 +02:00
// +build linux
package main
/*
#include <features.h>
#ifdef __GLIBC__
#include <malloc.h>
#else
void malloc_trim(size_t pad){}
#endif
*/
import "C"
import "runtime/debug"
func freeMemory() {
debug.FreeOSMemory()
C.malloc_trim(0)
}