Commit Graph

2 Commits (master)

Author SHA1 Message Date
Stephen Dolan 5946b93a85
Refactor skiplist to avoid UB casts (#9660)
This patch removes casts between struct skiplist * and struct skipcell *, and removes the "layout compatibility" fields in skiplist that were there to enable these casts.

The only algorithmic difference is that caml_skiplist_find is now "stop-at" (see discussion here), as this was slightly easier to write in the no-cast style.
2020-06-10 16:40:51 +02:00
Xavier Leroy 9a5f3b1967 Add skip lists as a reusable data structure
The implementation is taken from globroots.c, but made reusable elsewhere.
2020-06-08 14:12:53 +02:00