mirror of
				https://github.com/imgproxy/imgproxy.git
				synced 2025-10-30 23:08:02 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			251 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			251 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| //go:build linux
 | |
| // +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)
 | |
| }
 |