forked from lukeroth/gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cache.go
39 lines (32 loc) · 924 Bytes
/
cache.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package gdal
/*
#include "go_gdal.h"
#include "gdal_version.h"
#cgo linux pkg-config: gdal
#cgo darwin pkg-config: gdal
#cgo windows LDFLAGS: -Lc:/gdal/release-1600-x64/lib -lgdal_i
#cgo windows CFLAGS: -IC:/gdal/release-1600-x64/include
*/
import "C"
/* ==================================================================== */
/* GDAL Cache Management */
/* ==================================================================== */
// Set maximum cache memory
func SetCacheMax(bytes int) {
C.GDALSetCacheMax64(C.GIntBig(bytes))
}
// Get maximum cache memory
func GetCacheMax() int {
bytes := C.GDALGetCacheMax64()
return int(bytes)
}
// Get cache memory used
func GetCacheUsed() int {
bytes := C.GDALGetCacheUsed64()
return int(bytes)
}
// Try to flush one cached raster block
func FlushCacheBlock() bool {
flushed := C.GDALFlushCacheBlock()
return flushed != 0
}