static struct h * _pe_comb_new_hist (struct event *e) { struct h *h; struct ec *r; int i; h = h_alloc (e); if(!h)return h;//ALESSANDRO for (r = pe.comb.r; r->h == 0; r = r->r2) { ASSERT (r->r1); ASSERT (EC_ISREAD (r->r1)); ASSERT (r->r1->h); h_add (h, r->r1->h); } h_add (h, r->h); al_add (&h->ecl, pe.comb.r); for (i = 0; i < pe.comb.size; i++) { ASSERT (pe.comb.tab[i].ispre || EC_ISGEN (pe.comb.tab[i].tab[pe.comb.tab[i].i])); for (r = pe.comb.tab[i].tab[pe.comb.tab[i].i]; r->h == 0; r = r->r2) { ASSERT (r->r1); ASSERT (EC_ISREAD (r->r1)); ASSERT (r->r1->h); h_add (h, r->r1->h); } h_add (h, r->h); al_add (&h->ecl, pe.comb.tab[i].tab[pe.comb.tab[i].i]); } /* compute the marking associated to that history, the marking hash, * lists r(h), s(h), the size of the history and return */ h_marking (h); return h; }
t_heap *new_heap(int *items, int size) { t_heap *heap; int i; heap = (t_heap *)malloc(sizeof(t_heap)); heap->size = 0; heap->items = (int *)malloc(sizeof(int)); heap->capacity = 1; i = 0; while (i < size) { h_add(heap, items[i]); i++; } return (heap); }