Skip to content

Use boost small vectors instead of VLAs in the primops#7346

Closed
thufschmitt wants to merge 1 commit intoNixOS:masterfrom
tweag:dont-use-vlas-in-primops
Closed

Use boost small vectors instead of VLAs in the primops#7346
thufschmitt wants to merge 1 commit intoNixOS:masterfrom
tweag:dont-use-vlas-in-primops

Conversation

@thufschmitt
Copy link
Member

VLAs are a dangerous feature, and their usage triggers an undefined
behavior since theire size can be zero in some cases.
So replace them with boost::small_vectors which fit the same goal but
are safer.

It's also incidentally consistently 1% faster on the benchmarks.

The optimal static size of the small_vectors still needs to be benchmarked, currently it's only a wild guess (and probably too big).

VLAs are a dangerous feature, and their usage triggers an undefined
behavior since theire size can be zero in some cases.
So replace them with `boost::small_vector`s which fit the same goal but
are safer.

It's also incidentally consistently 1% faster on the benchmarks.
@edolstra edolstra self-requested a review November 25, 2022 20:47
@stale stale bot added the stale label Jun 18, 2023
@bb010g
Copy link

bb010g commented Mar 2, 2024

Subsumed by #9430, which has been merged. This should be closed.

@stale stale bot removed the stale label Mar 2, 2024
@thufschmitt
Copy link
Member Author

Indeed, thanks

@thufschmitt thufschmitt closed this Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants