Merge: Intro an unrolled linked list, and fix `List::insert`
authorJean Privat <jean@pryen.org>
Wed, 27 May 2015 00:54:56 +0000 (20:54 -0400)
committerJean Privat <jean@pryen.org>
Wed, 27 May 2015 10:11:11 +0000 (06:11 -0400)
commitc19db972c12b05623c55c19b94ea3b105a73fea5
treeeb46a00c542c50b9a5868a6ef30fc7e804545b67
parent9f1d610549bae916e107fc6e75adf1894f79c9db
parent31b6c3da24f60a0d042f5ce3108fce140cf67650
Merge: Intro an unrolled linked list, and fix `List::insert`

An unrolled list is a sequence implemented by a linked list of arrays.

I use this list for a very long FIFO. `Array::shift` is very slow and a large `List` can create too many small nodes for the GC.

The test compares the behavior of `UnrolledList` with `List` on random data sets. It allowed me to find a bug in `List::insert`.

Pull-Request: #1379
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
lib/more_collections.nit