MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / ply_grow_array

Function ply_grow_array

src/IO/rply.c:1130–1143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1128}
1129
1130static void *ply_grow_array(p_ply ply, void **pointer,
1131 long *nmemb, long size) {
1132 void *temp = *pointer;
1133 long count = *nmemb + 1;
1134 if (!temp) temp = malloc(count*size);
1135 else temp = realloc(temp, count*size);
1136 if (!temp) {
1137 ply_ferror(ply, "Out of memory");
1138 return NULL;
1139 }
1140 *pointer = temp;
1141 *nmemb = count;
1142 return (char *) temp + (count-1) * size;
1143}
1144
1145static p_ply_element ply_grow_element(p_ply ply) {
1146 p_ply_element element = NULL;

Callers 4

ply_add_commentFunction · 0.85
ply_add_obj_infoFunction · 0.85
ply_grow_elementFunction · 0.85
ply_grow_propertyFunction · 0.85

Calls 1

ply_ferrorFunction · 0.85

Tested by

no test coverage detected