Skip to content

Instantly share code, notes, and snippets.

View rdunnington's full-sized avatar

Reuben Dunnington rdunnington

View GitHub Profile
@rdunnington
rdunnington / build.zig
Last active September 9, 2025 04:27
Zig dynamic linking
const std = @import("std");
const Build = std.Build;
pub fn build(b: *Build) !void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const lib = b.addLibrary(.{
.name = "foo",
.linkage = .dynamic,
@rdunnington
rdunnington / overcommit.c
Created April 29, 2024 06:47
A program to test overcommit behavior on linux.
#include <sys/mman.h>
#include <stdio.h>
const size_t KB = 1024;
const size_t MB = KB * 1024;
const size_t GB = MB * 1024;
const int map = MAP_PRIVATE | MAP_ANONYMOUS;
const int fd = -1;
const int offset = 0;