From ff43c3d8068e76f0a8f43e26a1f72f73c627ab60 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 16 Jun 2017 01:26:01 +0000 Subject: [PATCH] Expose vips cache memory management functions. --- vips.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/vips.go b/vips.go index ae654c5..221233f 100644 --- a/vips.go +++ b/vips.go @@ -130,6 +130,22 @@ func Shutdown() { } } +// VipsCacheSetMaxMem Sets the maximum amount of tracked memory allowed before the vips operation cache +// begins to drop entries. +func VipsCacheSetMaxMem(maxCacheMem int) { + C.vips_cache_set_max_mem(C.size_t(maxCacheMem)) +} + +// VipsCacheSetMax sets the maximum number of operations to keep in the vips operation cache. +func VipsCacheSetMax(maxCacheSize int) { + C.vips_cache_set_max(C.int(maxCacheSize)) +} + +// VipsCacheDropAll drops the vips operation cache, freeing the allocated memory. +func VipsCacheDropAll() { + C.vips_cache_drop_all() +} + // VipsDebugInfo outputs to stdout libvips collected data. Useful for debugging. func VipsDebugInfo() { C.im__print_all()