[m-rev.] for review: Make version_hash_table maintain concurrency (un)safeness.

Julien Fischer jfischer at opturion.com
Wed Jul 19 20:50:16 AEST 2023



On Wed, 19 Jul 2023, Peter Wang wrote:

> When a version hash table expanded its underlying version array,
> it previously would always create a concurrency-safe version array
> even if the hash table itself was originally created with a
> version_hash_table.unsafe_init* functions.
>
> This change makes it so that when an "unsafe" version hash table
> expands, it will create an "unsafe" version array internally.
>
> library/version_array.m:
>    Export a predicate has_lock/1 for use by version_hash_table.m
>
>    Replace occurrences of max(VA) with size(VA) - 1. The latter makes
>    it more obvious that an index may start out negative.
>
>    Other minor style changes.
>
>    Fix typos.
>
> library/version_hash_table.m:
>    When expanding a hash table, create a new version array with
>    version_array.init or version_array.unsafe_init
>    depending on whether the old version array had an internal lock.
>
>    Replace field access expressions with predicate calls.

That's fine.

Julien.


More information about the reviews mailing list