assert partial HArrs are finished
This commit is contained in:
parent
b7f5b6b3ce
commit
cc36fd0d7c
@ -13,7 +13,7 @@ rtperf: FLAGS=-O3 -DRT_PERF
|
||||
rtperf: gen
|
||||
heapverify: FLAGS=-DDEBUG -g -DHEAP_VERIFY
|
||||
heapverify: gen
|
||||
rtverify: FLAGS=-O3 -DRT_VERIFY
|
||||
rtverify: FLAGS=-DDEBUG -O3 -DRT_VERIFY
|
||||
rtverify: gen
|
||||
|
||||
gen: builtins core base utils
|
||||
|
||||
@ -135,10 +135,10 @@ void harrP_print(B x) {
|
||||
B* p = c(HArr,x)->a;
|
||||
usz am = *c(HArr,x)->sh;
|
||||
usz ia = a(x)->ia;
|
||||
printf("(partial HArr %d/%d %p %p: ?⥊⟨", am, ia, c(HArr,x)->sh, &a(x)->ia);
|
||||
printf("(partial HArr %d/%d: ⟨", am, ia);
|
||||
for (usz i = 0; i < ia; i++) {
|
||||
if (i) printf(", ");
|
||||
if (i>=am) printf("(…)\n");
|
||||
if (i>=am) printf("?");
|
||||
else print(p[i]);
|
||||
}
|
||||
printf("⟩)");
|
||||
|
||||
@ -28,6 +28,7 @@ static HArr_p m_harrs(usz ia, usz* ctr) { // writes just ia
|
||||
return harr_parts(r);
|
||||
}
|
||||
static B harr_fv(HArr_p p) { VTY(p.b, t_harrPartial);
|
||||
assert(p.c->ia == *p.c->sh);
|
||||
p.c->type = t_harr;
|
||||
p.c->sh = &p.c->ia;
|
||||
srnk(p.b, 1);
|
||||
@ -35,12 +36,14 @@ static B harr_fv(HArr_p p) { VTY(p.b, t_harrPartial);
|
||||
return p.b;
|
||||
}
|
||||
static B harr_fc(HArr_p p, B x) { VTY(p.b, t_harrPartial);
|
||||
assert(p.c->ia == *p.c->sh);
|
||||
p.c->type = t_harr;
|
||||
arr_shCopy(p.b, x);
|
||||
gsPop();
|
||||
return p.b;
|
||||
}
|
||||
static B harr_fcd(HArr_p p, B x) { VTY(p.b, t_harrPartial);
|
||||
assert(p.c->ia == *p.c->sh);
|
||||
p.c->type = t_harr;
|
||||
arr_shCopy(p.b, x);
|
||||
dec(x);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user