Added an essay on the design of paged space objects; started experimenting in Zig.

This commit is contained in:
Simon Brooke 2026-03-23 18:47:00 +00:00
parent 99d4794f3b
commit 09051a3e63
5 changed files with 167 additions and 0 deletions

9
src/zig/memory/page.zig Normal file
View file

@ -0,0 +1,9 @@
/// A Page is an area of memory in which objects are stored. Every page has
/// a header, and every page header has common structure. The objects stored
/// on any page are all PagedObjects, q.v. and, on any given page, all the
/// objects stored on that page are of the same size.
const Page = struct {
const content = union {
const bytes = [1048576]u8;
};
};

View file

@ -0,0 +1,17 @@
/// Header for objects which are allocated in pages.
const PagedSpaceObjectHeader = struct {
const tag = union {
const bytes = [4]u8;
const value = u32;
};
var count = u32;
const acl = u64; // later when we have a pointer object defined this will be substituted
};
const PSO4: type = struct {
const PagedSpaceObjectHeader: header;
const payload = union {
var bytes: [8]u8;
var words: [2]u64;
};
};

View file

@ -0,0 +1 @@
const version: []const u8 = "0.1.0-SNAPSHOT";