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
--protection | |
PROT_NONE: 0b000 | |
PROT_READ: 0b001 | |
PROT_WRITE: 0b010 | |
PROT_EXEC: 0b100 | |
--map flags | |
MAP_SHARED: 0b000001 Share mapping with all process mapped to this object. Chages made will be written to file | |
MAP_PRIVATE: 0b000010 Mapping not shared with other processes. Changes made will not be written to file | |
MAP_FIXED: 0b010000 System is forced to use exact mapping address specified. Fail if not possible |
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 Text_Object = @This(); | |
list: []const Text, | |
pub const Text = union(enum) { | |
component: Component, | |
plain: []const u8, | |
pub fn jsonParse( | |
ally: std.mem.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
pub fn main() !void { | |
var arena_state: std.heap.ArenaAllocator = .init(std.heap.page_allocator); | |
defer arena_state.deinit(); | |
const arena = arena_state.allocator(); | |
const parsed = try std.json.parseFromSliceLeaky(Meow, arena, | |
\\{ | |
\\ "name": "My name", | |
\\ "map": { | |
\\ "a": 1, |
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
comptime { | |
const builtin = @import("builtin"); | |
std.debug.assert(builtin.target.cpu.arch == .x86); | |
} | |
pub const Instruction = union(enum) { | |
mov_: Mov, | |
int_: Int, | |
ret_: Ret, | |
lea_: Lea, |