mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35: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:
+22
-7
@@ -26,18 +26,33 @@ typedef enum json_type {
|
||||
} json_type;
|
||||
|
||||
typedef struct json_object {
|
||||
json_type type;
|
||||
struct json_object *parent;
|
||||
struct json_pull *parser;
|
||||
|
||||
char *string;
|
||||
double number;
|
||||
union {
|
||||
struct {
|
||||
double number;
|
||||
unsigned long long large_unsigned;
|
||||
long long large_signed;
|
||||
} number;
|
||||
|
||||
struct json_object **array;
|
||||
struct json_object **keys;
|
||||
struct json_object **values;
|
||||
size_t length;
|
||||
struct {
|
||||
char *string;
|
||||
} string;
|
||||
|
||||
struct {
|
||||
struct json_object **array;
|
||||
size_t length;
|
||||
} array;
|
||||
|
||||
struct {
|
||||
struct json_object **keys;
|
||||
struct json_object **values;
|
||||
size_t length;
|
||||
} object;
|
||||
} value;
|
||||
|
||||
json_type type;
|
||||
int expect;
|
||||
} json_object;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user