Potion *potion_create(void *sp) { Potion *P = potion_gc_boot(sp); //zeros P P->vt = PN_TSTATE; P->uniq = (PNUniq)potion_rand_int(); PN_FLEX_NEW(P->vts, PN_TFLEX, PNFlex, TYPE_BATCH_SIZE); PN_FLEX_SIZE(P->vts) = PN_TYPE_ID(PN_TUSER) + 1; P->prec = PN_PREC; P->fileno = -1; //P->flags = (Potion_Flags)EXEC_VM; potion_init(P); return P; }
int main(void) { POTION_INIT_STACK(sp); int count; // manually initialize the older generation P = potion_gc_boot(sp); if (P->mem->old_lo == NULL) { struct PNMemory *M = P->mem; int gensz = POTION_BIRTH_SIZE * 2; void *page = pngc_page_new(&gensz, 0); SET_GEN(old, page, gensz); } CuString *out = CuStringNew(); CuSuite *suite = gc_suite(); CuSuiteRun(suite); CuSuiteSummary(suite, out); CuSuiteDetails(suite, out); printf("%s\n", out->buffer); count = suite->failCount; CuSuiteFree(suite); CuStringFree(out); return count; }