mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Reduce tippecanoe memory usage (#5)
* Change JSON objects to a union type to use less memory * Stop storing the string representation of JSON numbers * Restore the ability to create features with large integer attributes * Make sure large-integer feature IDs still behave as before * Add missing #include * Don't preallocate as much space for arrays and objects * Treat inability to check free disk space as a warning, not an error * Update changelog and version
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "milo/dtoa_milo.h"
|
||||
#include "milo/milo.h"
|
||||
|
||||
/**
|
||||
* Returns an empty string if `s` is valid utf8;
|
||||
@@ -169,3 +172,14 @@ std::string format_commandline(int argc, char **argv) {
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
// for jsonpull to call from C
|
||||
char *dtoa_milo(double val) {
|
||||
std::string s = milo::dtoa_milo(val);
|
||||
char *dup = strdup(s.c_str());
|
||||
if (dup == NULL) {
|
||||
perror("strdup");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return dup;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user