ponylang / ponyc

Pony is an open-source, actor-model, capabilities-secure, high performance programming language
http://www.ponylang.io
BSD 2-Clause "Simplified" License
5.72k stars 415 forks source link

Make heap large chunk bit twiddling branchless #4526

Closed dipinhora closed 1 month ago

dipinhora commented 1 month ago

We use some bit twiddling operations for setting some flags on large chunks in actor heaps. Before this commit, the functionality was implemented with a ternary operator which would result in a branch.

This commit changes the logic to use bit shifts instead to avoid the branching.

dipinhora commented 1 month ago

macro-ified