gcc fixes
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
#define DEBUG_VERBOSE 0
|
||||
|
||||
__attribute__((always_inline)) void *safe_malloc(size_t s) {
|
||||
__attribute__((always_inline)) inline void *safe_malloc(size_t s) {
|
||||
if (void *p = malloc(s)) {
|
||||
return p;
|
||||
}
|
||||
@@ -853,7 +853,7 @@ Node *&getOrCreateChild(Node *&self, uint8_t index) {
|
||||
}
|
||||
if (self->numChildren == 4) {
|
||||
auto *newSelf = new (safe_malloc(sizeof(Node16))) Node16;
|
||||
memcpy(newSelf, self, offsetof(Node, type));
|
||||
memcpy((void*)newSelf, self, offsetof(Node, type));
|
||||
memcpy(newSelf->index, self4->index, 4);
|
||||
memcpy(newSelf->children, self4->children, 4 * sizeof(void *));
|
||||
free(std::exchange(self, newSelf));
|
||||
|
Reference in New Issue
Block a user