$ clang -c test.c -fsanitize=fuzzer-no-link -S -emit-llvm
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 Allocator = std.mem.Allocator; | |
const Io = std.Io; | |
pub const std_options: std.Options = .{ | |
.log_level = .info, | |
}; | |
pub fn main() !void { | |
var debug_allocator: std.heap.DebugAllocator(.{}) = .init; |
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
pub const GlobalVec = UniqueVec(.global); | |
pub const LocalVec = UniqueVec(.local); | |
pub const Tag = enum {global,local}; | |
fn UniqueVec(tag: Tag) type { | |
return struct { | |
pub const tag = Tag; | |
pub fn add(...) @This() { ... } | |
pub fn sub(...) @This() { ... } | |
// ... |
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
with import <nixpkgs> {}; { | |
tmpAoeu = stdenv.mkDerivation { | |
name = "zig-no-llvm"; | |
hardeningDisable = [ "all" ]; | |
buildInputs = [ | |
cmake | |
ninja | |
]; |
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
andy@bark ~/d/z/build-release (master) [1]> stage3/bin/zig build-obj test.zig -target avr-freestanding -OReleaseFast | |
andy@bark ~/d/z/build-release (master)> ~/local/llvm20-assert/bin/llvm-objdump -d test.o | |
test.o: file format elf32-avr | |
Disassembly of section .text: | |
00000000 <example>: | |
0: 6f 92 7f 92 <unknown> | |
4: 8f 92 9f 92 <unknown> |
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 assert = std.debug.assert; | |
const Allocator = std.mem.Allocator; | |
const Io = std.Io; | |
pub fn main() !void { | |
var debug_allocator: std.heap.DebugAllocator(.{}) = .init; | |
const gpa = debug_allocator.allocator(); | |
//const gpa = std.heap.smp_allocator; |
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 State = struct { | |
clowns: StringHashMap(Clown) = .empty, | |
const Clown = struct { | |
scariness: f32, | |
funniness: f32, | |
}; | |
fn deinit(state: *State, gpa: Allocator) void { | |
var it = state.clowns.iterator(); |
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 Allocator = std.mem.Allocator; | |
var debug_allocator: std.heap.DebugAllocator(.{ | |
.safety = false, | |
.stack_trace_frames = 0, | |
}) = .init; | |
pub fn main() !void { | |
//const gpa = debug_allocator.allocator(); |
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"); | |
pub fn main() !void { | |
const addr = try std.net.Address.initUnix("/home/andy/dev/zig/.zig-cache/tmp/b8f2350f14c91bbf"); | |
std.log.debug("socket", .{}); | |
const sockfd = try std.posix.socket( | |
std.posix.AF.UNIX, | |
std.posix.SOCK.STREAM | std.posix.SOCK.CLOEXEC, | |
0, |
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"); | |
pub fn main() !void { | |
const arena = std.heap.page_allocator; | |
var thread_pool: std.Thread.Pool = undefined; | |
try thread_pool.init(.{ | |
.allocator = arena, | |
.job_server = .{ .connect = try std.net.Address.initUnix("tmp_socket") }, | |
.n_jobs = 4, |
NewerOlder