Use stdio instead of mmap for geometry while tiling to reduce thrashing

This commit is contained in:
Eric Fischer
2016-04-11 15:59:02 -07:00
parent c6d2988485
commit efe66dcafe
5 changed files with 98 additions and 37 deletions
+4 -4
View File
@@ -18,7 +18,7 @@ extern "C" {
#include "projection.h"
}
drawvec decode_geometry(char **meta, int z, unsigned tx, unsigned ty, int detail, long long *bbox, unsigned initial_x, unsigned initial_y) {
drawvec decode_geometry(FILE *meta, long long *geompos, int z, unsigned tx, unsigned ty, int detail, long long *bbox, unsigned initial_x, unsigned initial_y) {
drawvec out;
bbox[0] = LLONG_MAX;
@@ -31,7 +31,7 @@ drawvec decode_geometry(char **meta, int z, unsigned tx, unsigned ty, int detail
while (1) {
draw d;
deserialize_byte(meta, &d.op);
deserialize_byte_io(meta, &d.op, geompos);
if (d.op == VT_END) {
break;
}
@@ -39,8 +39,8 @@ drawvec decode_geometry(char **meta, int z, unsigned tx, unsigned ty, int detail
if (d.op == VT_MOVETO || d.op == VT_LINETO) {
long long dx, dy;
deserialize_long_long(meta, &dx);
deserialize_long_long(meta, &dy);
deserialize_long_long_io(meta, &dx, geompos);
deserialize_long_long_io(meta, &dy, geompos);
wx += dx << geometry_scale;
wy += dy << geometry_scale;