void BijouBlock_destroy(BijouBlock *b) { kv_free(b->k); kv_free(b->locals); kv_free(b->upvals); kv_free(b->code); size_t i; for (i = 0; i < b->numchildren; ++i) { BijouBlock_destroy(b->children[i]); } B_FREE(b); b = NULL; }
static void parseHelper(struct ParseData *d, kvec_uchar_t *commands, kvec_float_t *coords, int alignment, int multiple) { int i; size_t j; char command; kvec_float_t n; command = *d->str; d->str++; kv_init(n); numbers(d, alignment, multiple, &n); if (multiple) { for (j = 0; j < kv_size(n); j += alignment) { kv_push_back(*commands, command); for (i = 0; i < alignment; ++i) kv_push_back(*coords, kv_a(n, j + i)); } } else { kv_push_back(*commands, command); for (i = 0; i < alignment; ++i) kv_push_back(*coords, kv_a(n, i)); } kv_free(n); }
/* * scenario_free -- free the scenario structure and all its content */ void scenario_free(struct scenario *s) { assert(s != NULL); while (!TAILQ_EMPTY(&s->head)) { struct kv *kv = TAILQ_FIRST(&s->head); TAILQ_REMOVE(&s->head, kv, next); kv_free(kv); } free(s->group); free(s->name); free(s->benchmark); free(s); }