Skip to content

Instantly share code, notes, and snippets.

Avatar

Taylor Holliday wtholliday

  • Audulus LLC
  • Berkeley
View GitHub Profile
View stacktest.cpp
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
#include <iostream>
#include <type_traits>
// Big stack.
static size_t stackSize = 1024*1024*10;
static thread_local uint8_t* start = nullptr;
View func.hpp
#pragma once
template<typename>
class func;
// Alternative to std::function for when compile time is
// more important than runtime performance. Doesn't pull in
// any headers.
template<typename Result, typename... Arguments>
class func<Result (Arguments...)> {
@wtholliday
wtholliday / nodes.rs
Created Jul 9, 2019
Exercise in graph data structure with undo/redo.
View nodes.rs
#[derive(Debug)]
struct Node { }
#[derive(Copy, Clone, Debug)]
struct Wire {
from: u32, // node index
to: u32, // node index
}
@wtholliday
wtholliday / Collector.cpp
Last active Dec 18, 2015
A simple concurrent mark-sweep garbage collector. Requires manual management of the referential graph. I'm confident it works for a single mutator thread, but not sure about multiple mutator threads. Requires boost::lockfree.
View Collector.cpp
//
// Collector.cpp
// Dev
//
// Created by Taylor Holliday on 6/14/13.
// This file is in the public domain.
//
#include "gc2/Collector.hpp"
You can’t perform that action at this time.