tiny.trace.TraceWriterCapacity
Defined in tiny.trace.
API (26)
Actions
Public operations.
Fields and members
Public fields and members.
block_bytesblock_offsetbuild_id_bytesbuild_id_offsetdatabaseendian_bytesendian_offsetevent_bytesmanifest_bytesmanifest_io_bytesmanifest_io_offsetmanifest_offsetmode_bytesmode_offsetpath_bytespath_offsetsroot_path_bytesroot_path_offsetscratch_bytesscratch_offsetsql_bytessql_offsetstorage_bytestarget_triple_bytestarget_triple_offset
Source
Source: lib/trace/src/store/writer/capacity.zig:42
zig
pub const Capacity = struct { root_path_bytes: usize, root_path_offset: usize, target_triple_bytes: usize, target_triple_offset: usize, build_id_bytes: usize, build_id_offset: usize, mode_bytes: usize, mode_offset: usize, endian_bytes: usize, endian_offset: usize, scratch_bytes: usize, scratch_offset: usize, event_bytes: usize, block_bytes: usize, block_offset: usize, manifest_io_bytes: usize, manifest_io_offset: usize, manifest_bytes: usize, manifest_offset: usize, database: database.Capacity, sql_bytes: usize, sql_offset: usize, path_bytes: usize, path_offsets: [path_buffer_count]usize, storage_bytes: usize, pub fn derive(limits: Limits) DeriveError!Capacity { if (limits.root_path_bytes == 0) return error.RootPathStorageTooSmall; if (limits.event_bytes == 0) return error.EventStorageTooSmall; if (limits.event_bytes > format.Limits.maximum_event_bytes) return error.EventStorageTooLarge; if (limits.manifest_io_bytes == 0) return error.ManifestIoStorageTooSmall; const block_bytes = block.capacity(limits.event_bytes) catch return error.CapacityOverflow; const database_capacity = database.writerCapacity(block_bytes) catch return error.CapacityOverflow; var offset: usize = 0; const root_path_offset = offset; offset = try add(offset, limits.root_path_bytes); const target_triple_offset = offset; offset = try add(offset, limits.target_triple_bytes); const build_id_offset = offset; offset = try add(offset, limits.build_id_bytes); const mode_offset = offset; offset = try add(offset, limits.mode_bytes); const endian_offset = offset; offset = try add(offset, limits.endian_bytes); const scratch_offset = offset; const scratch_bytes = @max(block_bytes, format.max_manifest_bytes); offset = try add(offset, scratch_bytes); const manifest_io_offset = offset; offset = try add(offset, limits.manifest_io_bytes); const sql_offset = offset; offset = try add(offset, database_capacity.heap_bytes); const path_bytes = try add( try add(limits.root_path_bytes, 1), format.max_relative_path_bytes, ); var path_offsets: [path_buffer_count]usize = undefined; for (&path_offsets) |*path_offset| { path_offset.* = offset; offset = try add(offset, path_bytes); } return .{ .root_path_bytes = limits.root_path_bytes, .root_path_offset = root_path_offset, .target_triple_bytes = limits.target_triple_bytes, .target_triple_offset = target_triple_offset, .build_id_bytes = limits.build_id_bytes, .build_id_offset = build_id_offset, .mode_bytes = limits.mode_bytes, .mode_offset = mode_offset, .endian_bytes = limits.endian_bytes, .endian_offset = endian_offset, .scratch_bytes = scratch_bytes, .scratch_offset = scratch_offset, .event_bytes = limits.event_bytes, .block_bytes = block_bytes, .block_offset = scratch_offset, .manifest_io_bytes = limits.manifest_io_bytes, .manifest_io_offset = manifest_io_offset, .manifest_bytes = format.max_manifest_bytes, .manifest_offset = scratch_offset, .database = database_capacity, .sql_bytes = database_capacity.heap_bytes, .sql_offset = sql_offset, .path_bytes = path_bytes, .path_offsets = path_offsets, .storage_bytes = offset, }; }};Source: lib/trace/src/root.zig:66
zig
pub const TraceWriterCapacity = store.WriterCapacity;Also reachable as
Audit
| Definitions | 2 |
|---|---|
| Public names | 4 |
| Members | 25 |
| Version | 26.7.0 |
| Revision | daab053ee433 |