MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / geoArrayAppend

Function geoArrayAppend

src/geo.cpp:65–73  ·  view source on GitHub ↗

Add a new entry and return its pointer so that the caller can populate * it with data. */

Source from the content-addressed store, hash-verified

63/* Add a new entry and return its pointer so that the caller can populate
64 * it with data. */
65geoPoint *geoArrayAppend(geoArray *ga) {
66 if (ga->used == ga->buckets) {
67 ga->buckets = (ga->buckets == 0) ? 8 : ga->buckets*2;
68 ga->array = (geoPoint*)zrealloc(ga->array,sizeof(geoPoint)*ga->buckets, MALLOC_SHARED);
69 }
70 geoPoint *gp = ga->array+ga->used;
71 ga->used++;
72 return gp;
73}
74
75/* Destroy a geoArray created with geoArrayCreate(). */
76void geoArrayFree(geoArray *ga) {

Callers 1

geoAppendIfWithinShapeFunction · 0.85

Calls 1

zreallocFunction · 0.85

Tested by

no test coverage detected