mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-07 19:55:41 -05:00
Added some asserts in vectors/sparse vectors
This commit is contained in:
parent
e748333693
commit
6206ad6378
3 changed files with 3 additions and 1 deletions
|
|
@ -631,7 +631,7 @@ module Make (L : Log_intf.S)(E : Expr_intf.S)
|
|||
let slice_propagate f lvl =
|
||||
L.debug 100 "entering slice.propagate";
|
||||
let a = add_atom f in
|
||||
L.debug 100 "atom added";
|
||||
L.debug 100 "atom added. growing heap...";
|
||||
Iheap.grow_to_by_double env.order (St.nb_vars ());
|
||||
L.debug 100 "heap grown";
|
||||
enqueue_bool a lvl (Semantic lvl)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ let init sz f default =
|
|||
let length {sz} = sz
|
||||
|
||||
let grow_to t new_capa =
|
||||
assert (new_capa >= Array.length t.data);
|
||||
let data = t.data in
|
||||
let capa = Array.length data in
|
||||
t.data <- Array.init new_capa (fun i -> if i < capa then data.(i) else t.default)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ let size t = t.sz
|
|||
let is_empty t = t.sz = 0
|
||||
|
||||
let grow_to t new_capa =
|
||||
assert (new_capa >= Array.length t.data);
|
||||
let data = t.data in
|
||||
let capa = Array.length data in
|
||||
t.data <- Array.init new_capa (fun i -> if i < capa then data.(i) else t.dummy)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue