Skip to content

Instantly share code, notes, and snippets.

View bokner's full-sized avatar

Boris Okner bokner

  • Barrie, ON, Canada
View GitHub Profile
@bokner
bokner / bit_vector.erl
Created March 4, 2023 21:09 — forked from garazdawi/bit_vector.erl
A shared mutable bit-vector in Erlang
-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) ->
@bokner
bokner / erl
Created December 20, 2015 02:01 — forked from sideshowcoder/erl
debug erlang nif code with lldb
#!/bin/sh
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 1996-2012. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be