Open GaneshRapolu opened 10 months ago
You're right, there is a bug here when there are more hazard pointers than fit in the pre-allocated array of sorted pointer. To be fair, entering this fallback path is always a performance bug :( The overflow check would also ideally be moved all the way under the null check.
In ck_hp_reclaim there is a section
marker is seemingly meant to be non-null if the cardinality of the non-nil hazard pointers is greater than CK_HP_CACHE.
However, in ck_hp_member_cache https://github.com/concurrencykit/ck/blob/master/src/ck_hp.c#L208
The break doesn't break out of the outer loop; only the inner one. So the return value from ck_hp_member_cache will always be NULL. This will then cause
to never execute. Am I missing something or this is just buggy?