This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; |