Skip to content

Instantly share code, notes, and snippets.

Lukas Larsson garazdawi

Block or report user

Report or block garazdawi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@garazdawi
garazdawi / bit_vector.erl
Last active Aug 24, 2019
A shared mutable bit-vector in Erlang
View bit_vector.erl
-module(bit_vector).
-export([new/1, get/2, set/2, clear/2, flip/2, print/1]).
new(Size) ->
Words = (Size + 63) div 64,
{?MODULE, Size, atomics:new(Words, [{signed, false}])}.
get({?MODULE, _Size, Aref}, Bix) ->
You can’t perform that action at this time.