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 / bit_vector.erl
Last active Aug 24, 2019
A shared mutable bit-vector in Erlang
View bit_vector.erl
-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) ->
garazdawi / gcount.erl
Created Sep 6, 2019
Global Counters in Erlang
View gcount.erl
ets_init() ->
ets:new(?MODULE, [{write_concurrency,true},named_table,public]).
ets_new(Counter) ->
You can’t perform that action at this time.