diff --git a/readme.md b/readme.md index 3c8e7356..635d983e 100644 --- a/readme.md +++ b/readme.md @@ -97,15 +97,15 @@ Special thanks to: * [David Carlier](https://devnexen.blogspot.com/) (@devnexen) for his many contributions, and making mimalloc work better on many less common operating systems, like Haiku, Dragonfly, etc. -* [Sam Gross](https://github.com/colesbury) for the [no GIL](https://github.com/colesbury/nogil) Python fork which - uses mimalloc internally. * Mary Feofanova (@mary3000), Evgeniy Moiseenko, and Manuel Pöter (@mpoeter) for making mimalloc TSAN checkable, and finding memory model bugs using the [genMC] model checker. * Weipeng Liu (@pongba), Zhuowei Li, Junhua Wang, and Jakub Szymanski, for their early support of mimalloc and deployment at large scale services, leading to many improvements in the mimalloc algorithms for large workloads. * Jason Gibson (@jasongibson) for exhaustive testing on large scale workloads and server environments, and finding complex bugs in (early versions of) `mimalloc`. -* Manuel Pöter (@mpoeter) and Sam Gross (@colesbury) for finding an ABA concurrency issue in abandoned segment reclamation. +* Manuel Pöter (@mpoeter) and Sam Gross(@colesbury) for finding an ABA concurrency issue in abandoned segment reclamation. Sam also created the [no GIL](https://github.com/colesbury/nogil) Python fork which + uses mimalloc internally. + [genMC]: https://plv.mpi-sws.org/genmc/ diff --git a/src/segment.c b/src/segment.c index 3af491d6..1aadf5c2 100644 --- a/src/segment.c +++ b/src/segment.c @@ -659,7 +659,8 @@ static mi_segment_t* mi_segment_init(mi_segment_t* segment, size_t required, mi_ // initialize pages info for (size_t i = 0; i < capacity; i++) { - segment->pages[i].segment_idx = i; + mi_assert_internal(i <= 255); + segment->pages[i].segment_idx = (uint8_t)i; segment->pages[i].is_reset = false; segment->pages[i].is_committed = commit; segment->pages[i].is_zero_init = is_zero;