use SI units for size macros

This commit is contained in:
jacob 2025-07-06 16:25:33 -05:00
parent 69a8a7aa9a
commit 994ed1e1e1
18 changed files with 80 additions and 80 deletions

View File

@ -226,8 +226,8 @@ void sys_app_entry(struct string args_str)
bitbuff_test();
#endif
G.exit_callbacks_arena = arena_alloc(GIGABYTE(64));
G.arena = arena_alloc(GIGABYTE(64));
G.exit_callbacks_arena = arena_alloc(GIBI(64));
G.arena = arena_alloc(GIBI(64));
G.write_path = initialize_write_directory(G.arena, LIT(WRITE_DIR));

View File

@ -37,7 +37,7 @@ GLOBAL struct {
struct asset_cache_startup_receipt asset_cache_startup(void)
{
/* Init store */
G.store_arena = arena_alloc(GIGABYTE(64));
G.store_arena = arena_alloc(GIBI(64));
return (struct asset_cache_startup_receipt) { 0 };
}

View File

@ -752,7 +752,7 @@ void bitbuff_test(void)
struct string encoded = ZI;
{
struct bitbuff bb = bitbuff_alloc(GIGABYTE(64));
struct bitbuff bb = bitbuff_alloc(GIBI(64));
struct bitbuff_writer bw = bw_from_bitbuff(&bb);
for (u64 i = 0; i < countof(cases); ++i) {
struct test_case c = cases[i];

View File

@ -10,7 +10,7 @@
struct buddy_ctx *buddy_ctx_alloc(u64 reserve)
{
/* TODO: Determine meta reserve dynamically */
struct arena *meta_arena = arena_alloc(GIGABYTE(64));
struct arena *meta_arena = arena_alloc(GIBI(64));
struct buddy_ctx *ctx = arena_push(meta_arena, struct buddy_ctx);
ctx->meta_arena = meta_arena;
ctx->data_arena = arena_alloc(reserve);

View File

@ -235,10 +235,10 @@ void __asan_unpoison_memory_region(void const volatile *add, size_t);
#endif
/* Sizes */
#define KILOBYTE(n) (n*1024ULL)
#define MEGABYTE(n) (n*KILOBYTE(1024ULL))
#define GIGABYTE(n) (n*MEGABYTE(1024ULL))
#define TERABYTE(n) (n*GIGABYTE(1024ULL))
#define KIBI(n) (n*1024ULL)
#define MEBI(n) (n*KIBI(1024ULL))
#define GIBI(n) (n*MEBI(1024ULL))
#define TEBI(n) (n*GIBI(1024ULL))
/* Time */
#define NS_FROM_SECONDS(s) ((i64)((s) * 1000000000.0))
@ -657,13 +657,13 @@ INLINE f64 clamp_f64(f64 v, f64 min, f64 max) { return v < min ? min : v > max ?
#include "prof_tracy.h"
#define PROF_THREAD_GROUP_WORKERS -7000000
#define PROF_THREAD_GROUP_FIBERS -6000000
#define PROF_THREAD_GROUP_IO -5000000
#define PROF_THREAD_GROUP_WINDOW -4000000
#define PROF_THREAD_GROUP_EVICTORS -3000000
#define PROF_THREAD_GROUP_APP -2000000
#define PROF_THREAD_GROUP_MAIN -1000000
#define PROF_THREAD_GROUP_WORKERS -MEBI(7)
#define PROF_THREAD_GROUP_FIBERS -MEBI(6)
#define PROF_THREAD_GROUP_IO -MEBI(5)
#define PROF_THREAD_GROUP_WINDOW -MEBI(4)
#define PROF_THREAD_GROUP_EVICTORS -MEBI(3)
#define PROF_THREAD_GROUP_APP -MEBI(2)
#define PROF_THREAD_GROUP_MAIN -MEBI(1)
#ifdef __cplusplus
}

View File

@ -49,7 +49,7 @@ struct font_startup_receipt font_startup(struct gp_startup_receipt *gp_sr,
(UNUSED)ttf_sr;
(UNUSED)resource_sr;
G.params.arena = arena_alloc(GIGABYTE(64));
G.params.arena = arena_alloc(GIBI(64));
return (struct font_startup_receipt) { 0 };
}

View File

@ -353,23 +353,23 @@ struct gp_startup_receipt gp_startup(void)
__prof;
/* Initialize command descriptor heaps pool */
G.command_descriptor_heaps_arena = arena_alloc(GIGABYTE(64));
G.command_descriptor_heaps_arena = arena_alloc(GIBI(64));
/* Initialize command buffers pool */
G.command_buffers_arena = arena_alloc(GIGABYTE(64));
G.command_buffers_arena = arena_alloc(GIBI(64));
G.command_buffers_dict = dict_init(G.command_buffers_arena, 4096);
/* Initialize resources pool */
G.resources_arena = arena_alloc(GIGABYTE(64));
G.resources_arena = arena_alloc(GIBI(64));
/* Initialize pipeline cache */
G.pipelines_arena = arena_alloc(GIGABYTE(64));
G.pipelines_arena = arena_alloc(GIBI(64));
G.pipeline_descs = dict_init(G.pipelines_arena, 1024);
G.top_pipelines = dict_init(G.pipelines_arena, 1024);
G.top_successful_pipelines = dict_init(G.pipelines_arena, 1024);
/* Initialize fenced releases queue */
G.fenced_releases_arena = arena_alloc(GIGABYTE(64));
G.fenced_releases_arena = arena_alloc(GIBI(64));
/* Initialize dx12 */
dx12_init_device();
@ -864,7 +864,7 @@ INTERNAL SYS_JOB_DEF(pipeline_init_job, job)
struct pipeline *pipeline = NULL;
{
struct arena *pipeline_arena = arena_alloc(MEGABYTE(64));
struct arena *pipeline_arena = arena_alloc(MEBI(64));
pipeline = arena_push(pipeline_arena, struct pipeline);
pipeline->arena = pipeline_arena;
pipelines_out[job.id] = pipeline;
@ -1147,7 +1147,7 @@ INTERNAL struct pipeline_scope *pipeline_scope_begin(void)
if (scope) {
arena = scope->arena;
} else {
arena = arena_alloc(MEGABYTE(64));
arena = arena_alloc(MEBI(64));
}
arena_reset(arena);
scope = arena_push(arena, struct pipeline_scope);
@ -1344,7 +1344,7 @@ INTERNAL struct cpu_descriptor_heap *cpu_descriptor_heap_alloc(enum D3D12_DESCRI
__prof;
struct cpu_descriptor_heap *dh = NULL;
{
struct arena *arena = arena_alloc(MEGABYTE(64));
struct arena *arena = arena_alloc(MEBI(64));
dh = arena_push(arena, struct cpu_descriptor_heap);
dh->arena = arena;
}
@ -1429,15 +1429,15 @@ INTERNAL struct flow *flow_alloc(void)
__prof;
struct flow *flow = NULL;
{
struct arena *arena = arena_alloc(MEGABYTE(64));
struct arena *arena = arena_alloc(MEBI(64));
flow = arena_push(arena, struct flow);
flow->arena = arena;
}
flow->material_instance_descs_arena = arena_alloc(GIGABYTE(1));
flow->material_grid_descs_arena = arena_alloc(GIGABYTE(1));
flow->shape_verts_arena = arena_alloc(GIGABYTE(1));
flow->shape_indices_arena = arena_alloc(GIGABYTE(1));
flow->material_instance_descs_arena = arena_alloc(GIBI(1));
flow->material_grid_descs_arena = arena_alloc(GIBI(1));
flow->shape_verts_arena = arena_alloc(GIBI(1));
flow->shape_indices_arena = arena_alloc(GIBI(1));
return flow;
}
@ -1601,7 +1601,7 @@ INTERNAL struct dx12_resource *dx12_resource_alloc(D3D12_HEAP_PROPERTIES heap_pr
cbv_desc.BufferLocation = r->gpu_address;
//cbv_desc.SizeInBytes = desc.ByteWidth;
/* FIXME: Get actual size */
cbv_desc.SizeInBytes = KILOBYTE(64);
cbv_desc.SizeInBytes = KIBI(64);
ID3D12Device_CreateConstantBufferView(G.device, &cbv_desc, r->cbv_descriptor->handle);
}
if (view_flags & DX12_RESOURCE_VIEW_FLAG_SRV) {
@ -1689,7 +1689,7 @@ INTERNAL struct command_queue *command_queue_alloc(enum D3D12_COMMAND_LIST_TYPE
__prof;
struct command_queue *cq = NULL;
{
struct arena *arena = arena_alloc(GIGABYTE(64));
struct arena *arena = arena_alloc(GIBI(64));
cq = arena_push(arena, struct command_queue);
cq->arena = arena;
}
@ -1732,7 +1732,7 @@ INTERNAL struct command_list_pool *command_list_pool_alloc(struct command_queue
{
struct command_list_pool *pool = NULL;
{
struct arena *arena = arena_alloc(GIGABYTE(64));
struct arena *arena = arena_alloc(GIBI(64));
pool = arena_push(arena, struct command_list_pool);
pool->arena = arena;
}

View File

@ -176,17 +176,17 @@ struct host_startup_receipt host_startup(struct sock_startup_receipt *sock_sr)
struct host *host_alloc(u16 listen_port)
{
struct arena *arena = arena_alloc(GIGABYTE(64));
struct arena *arena = arena_alloc(GIBI(64));
struct host *host = arena_push(arena, struct host);
host->arena = arena;
host->cmd_arena = arena_alloc(GIGABYTE(64));
host->channel_arena = arena_alloc(GIGABYTE(64));
host->cmd_arena = arena_alloc(GIBI(64));
host->channel_arena = arena_alloc(GIBI(64));
host->rcv_buffer_read = arena_push(host->arena, struct host_rcv_buffer);
host->rcv_buffer_write = arena_push(host->arena, struct host_rcv_buffer);
host->rcv_buffer_read->arena = arena_alloc(GIGABYTE(64));
host->rcv_buffer_write->arena = arena_alloc(GIGABYTE(64));
host->buddy = buddy_ctx_alloc(GIGABYTE(64));
host->rcv_buffer_read->arena = arena_alloc(GIBI(64));
host->rcv_buffer_write->arena = arena_alloc(GIBI(64));
host->buddy = buddy_ctx_alloc(GIBI(64));
host->channels = arena_push_dry(host->channel_arena, struct host_channel);
@ -196,7 +196,7 @@ struct host *host_alloc(u16 listen_port)
host->num_msg_assembler_lookup_bins = NUM_MSG_ASSEMBLER_LOOKUP_BINS;
host->msg_assembler_lookup_bins = arena_push_array(host->arena, struct host_msg_assembler_lookup_bin, host->num_msg_assembler_lookup_bins);
host->sock = sock_alloc(listen_port, MEGABYTE(2), MEGABYTE(2));
host->sock = sock_alloc(listen_port, MEBI(2), MEBI(2));
host->receiver_thread = sys_thread_alloc(&host_receiver_thread_entry_point, host, LIT("Host receiver"), PROF_THREAD_GROUP_IO);
@ -1060,7 +1060,7 @@ void host_update_end(struct host *host)
INTERNAL SYS_THREAD_DEF(host_receiver_thread_entry_point, arg)
{
u64 read_buff_size = KILOBYTE(64);
u64 read_buff_size = KIBI(64);
struct arena *read_buff_arena = arena_alloc(read_buff_size);
struct string read_buff = ZI;
read_buff.len = read_buff_size;

View File

@ -64,7 +64,7 @@ GLOBAL READONLY struct log_level_settings g_log_level_settings[LOG_LEVEL_COUNT]
void log_startup(struct string logfile_path)
{
G.callbacks_arena = arena_alloc(MEGABYTE(8));
G.callbacks_arena = arena_alloc(MEBI(8));
if (logfile_path.len > 0) {
/* Create / wipe log file */
sys_file_close(sys_file_open_write(logfile_path));

View File

@ -72,7 +72,7 @@ GLOBAL struct {
struct mixer_startup_receipt mixer_startup(void)
{
G.track_arena = arena_alloc(GIGABYTE(64));
G.track_arena = arena_alloc(GIBI(64));
G.listener_pos = V2(0, 0);
G.listener_dir = V2(0, -1);

View File

@ -52,7 +52,7 @@ INTERNAL APP_EXIT_CALLBACK_FUNC_DEF(resource_shutdown);
struct resource_startup_receipt resource_startup(void)
{
G.arena = arena_alloc(GIGABYTE(64));
G.arena = arena_alloc(GIBI(64));
#if RESOURCES_EMBEDDED
struct string embedded_data = inc_res_tar();
@ -70,7 +70,7 @@ struct resource_startup_receipt resource_startup(void)
#if RESOURCE_RELOADING
G.watch = sys_watch_alloc(LIT("res"));
G.watch_dispatcher_info_arena = arena_alloc(GIGABYTE(64));
G.watch_dispatcher_info_arena = arena_alloc(GIBI(64));
app_register_exit_callback(&resource_shutdown);
G.resource_watch_monitor_thread = sys_thread_alloc(resource_watch_monitor_thread_entry_point, NULL, LIT("Resource watch monitor"), PROF_THREAD_GROUP_IO);

View File

@ -62,7 +62,7 @@ READONLY struct sim_ent **_g_sim_ent_nil = &G.nil_ent;
struct sim_startup_receipt sim_startup(void)
{
G.nil_arena = arena_alloc(GIGABYTE(1));
G.nil_arena = arena_alloc(GIBI(1));
/* Nil client store */
G.nil_client_store = arena_push(G.nil_arena, struct sim_client_store);
@ -106,14 +106,14 @@ struct sim_client_store *sim_client_store_alloc(void)
__prof;
struct sim_client_store *store;
{
struct arena *arena = arena_alloc(GIGABYTE(64));
struct arena *arena = arena_alloc(GIBI(64));
store = arena_push(arena, struct sim_client_store);
store->arena = arena;
}
store->valid = true;
store->num_client_lookup_bins = CLIENT_LOOKUP_BINS;
store->client_lookup_bins = arena_push_array(store->arena, struct sim_client_lookup_bin, store->num_client_lookup_bins);
store->clients_arena = arena_alloc(GIGABYTE(64));
store->clients_arena = arena_alloc(GIBI(64));
store->clients = arena_push_dry(store->clients_arena, struct sim_client);
return store;
}
@ -156,7 +156,7 @@ struct sim_client *sim_client_alloc(struct sim_client_store *store)
client->valid = true;
client->handle = handle;
client->snapshots_arena = arena_alloc(GIGABYTE(8));
client->snapshots_arena = arena_alloc(GIBI(8));
client->num_snapshot_lookup_bins = TICK_LOOKUP_BINS;
client->snapshot_lookup_bins = arena_push_array(client->snapshots_arena, struct sim_snapshot_lookup_bin, client->num_snapshot_lookup_bins);
@ -293,8 +293,8 @@ struct sim_snapshot *sim_snapshot_alloc(struct sim_client *client, struct sim_sn
arena = ss->arena;
} else {
/* Arenas allocated here will be released with client */
arena = arena_alloc(GIGABYTE(1));
ents_arena = arena_alloc(GIGABYTE(1));
arena = arena_alloc(GIBI(1));
ents_arena = arena_alloc(GIBI(1));
}
}
arena_reset(arena);

View File

@ -53,7 +53,7 @@ struct sock_startup_receipt sock_startup(void)
{
/* Startup winsock */
WSAStartup(MAKEWORD(2, 2), &G.wsa_data);
G.win32_socks_arena = arena_alloc(GIGABYTE(64));
G.win32_socks_arena = arena_alloc(GIBI(64));
return (struct sock_startup_receipt) { 0 };
}

View File

@ -39,7 +39,7 @@ struct sound_startup_receipt sound_startup(struct asset_cache_startup_receipt *a
(UNUSED)asset_cache_sr;
(UNUSED)resource_sr;
G.params.arena = arena_alloc(GIGABYTE(64));
G.params.arena = arena_alloc(GIBI(64));
return (struct sound_startup_receipt) { 0 };
}

View File

@ -24,7 +24,7 @@ struct space *space_alloc(f32 cell_size, u32 num_bins_sqrt)
{
struct space *space;
{
struct arena *arena = arena_alloc(GIGABYTE(64));
struct arena *arena = arena_alloc(GIBI(64));
space = arena_push(arena, struct space);
space->entry_arena = arena;
}
@ -32,7 +32,7 @@ struct space *space_alloc(f32 cell_size, u32 num_bins_sqrt)
space->valid = true;
space->entries = arena_push_dry(space->entry_arena, struct space_entry);
space->cell_arena = arena_alloc(GIGABYTE(64));
space->cell_arena = arena_alloc(GIBI(64));
space->cell_size = cell_size;
space->num_bins = num_bins_sqrt * num_bins_sqrt;
space->num_bins_sqrt = num_bins_sqrt;

View File

@ -14,8 +14,8 @@
/* The evictor will begin evicting once cache usage is > threshold.
* It will entries until the budget has shrunk < target. */
#define CACHE_MEMORY_BUDGET_THRESHOLD (MEGABYTE(256))
#define CACHE_MEMORY_BUDGET_TARGET (MEGABYTE(128))
#define CACHE_MEMORY_BUDGET_THRESHOLD (MEBI(256))
#define CACHE_MEMORY_BUDGET_TARGET (MEBI(128))
STATIC_ASSERT(CACHE_MEMORY_BUDGET_THRESHOLD >= CACHE_MEMORY_BUDGET_TARGET);
#define CACHE_BINS_COUNT 1024
@ -29,9 +29,9 @@ STATIC_ASSERT(CACHE_MEMORY_BUDGET_THRESHOLD >= CACHE_MEMORY_BUDGET_TARGET);
#define EVICTOR_GRACE_PERIOD_CYCLES (NS_FROM_SECONDS(10.000) / EVICTOR_CYCLE_INTERVAL_NS)
/* Texture arena only used to store texture struct at the moment. Actual image data is allocated on GPU. */
#define TEXTURE_ARENA_RESERVE MEGABYTE(1)
#define TEXTURE_ARENA_RESERVE MEBI(1)
#define SHEET_ARENA_RESERVE MEGABYTE(64)
#define SHEET_ARENA_RESERVE MEBI(64)
#define SHEET_SPAN_LOOKUP_TABLE_BIN_RATIO 2.0
#define SHEET_SLICE_LOOKUP_TABLE_BIN_RATIO 2.0
@ -214,7 +214,7 @@ struct sprite_startup_receipt sprite_startup(struct gp_startup_receipt *gp_sr,
(UNUSED)gp_sr;
(UNUSED)resource_sr;
G.perm_arena = arena_alloc(MEGABYTE(1));
G.perm_arena = arena_alloc(MEBI(1));
{
/* Init loading texture */
G.loading_texture = arena_push(G.perm_arena, struct sprite_texture);
@ -242,12 +242,12 @@ struct sprite_startup_receipt sprite_startup(struct gp_startup_receipt *gp_sr,
}
arena_set_readonly(G.perm_arena);
G.cache.arena = arena_alloc(GIGABYTE(64));
G.cache.arena = arena_alloc(GIBI(64));
G.cache.bins = arena_push_array(G.cache.arena, struct cache_bin, CACHE_BINS_COUNT);
G.load_cmds_arena = arena_alloc(GIGABYTE(64));
G.load_cmds_arena = arena_alloc(GIBI(64));
G.scopes_arena = arena_alloc(GIGABYTE(64));
G.scopes_arena = arena_alloc(GIBI(64));
G.evictor_scheduler_thread = sys_thread_alloc(sprite_evictor_scheduler_thread_entry_point, NULL, LIT("Sprite evictor scheduler"), PROF_THREAD_GROUP_EVICTORS);

View File

@ -31,8 +31,8 @@
#define SYS_WINDOW_EVENT_LISTENERS_MAX 512
#define WINDOW_CLASS_NAME L"power_play_window_class"
#define THREAD_STACK_SIZE MEGABYTE(4)
#define FIBER_STACK_SIZE MEGABYTE(4)
#define THREAD_STACK_SIZE KIBI(64)
#define FIBER_STACK_SIZE MEBI(4)
struct win32_mutex {
struct atomic_i32 v; /* Bits 0-30 = shared lock count, bit 30 = is exclusive lock pending, bit 31 = is exclusive locked */
@ -943,7 +943,7 @@ INTERNAL SYS_THREAD_DEF(test_entry, _)
/* Start workers */
G.num_worker_threads = 6;
//G.num_worker_threads = 2;
G.worker_threads_arena = arena_alloc(GIGABYTE(64));
G.worker_threads_arena = arena_alloc(GIBI(64));
G.worker_threads = arena_push_array(G.worker_threads_arena, struct sys_thread *, G.num_worker_threads);
G.worker_contexts = arena_push_array(G.worker_threads_arena, struct worker_ctx, G.num_worker_threads);
for (i32 i = 0; i < G.num_worker_threads; ++i) {
@ -987,7 +987,7 @@ struct sys_scratch_ctx *sys_scratch_ctx_from_fiber_id(i32 id)
if (!scratch_ctx->arenas[0]) {
__profn("Initialize scratch context");
for (u32 i = 0; i < countof(scratch_ctx->arenas); ++i) {
scratch_ctx->arenas[i] = arena_alloc(GIGABYTE(64));
scratch_ctx->arenas[i] = arena_alloc(GIBI(64));
}
}
return scratch_ctx;
@ -1552,7 +1552,7 @@ struct win32_watch {
HANDLE dir_handle;
HANDLE wake_handle;
struct win32_watch *next_free;
u8 results_buff[KILOBYTE(64)];
u8 results_buff[KIBI(64)];
};
struct sys_watch *sys_watch_alloc(struct string dir_path)
@ -2918,20 +2918,20 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance,
__profthread("Main thread", PROF_THREAD_GROUP_MAIN);
/* Init yielders */
G.yielders_arena = arena_alloc(GIGABYTE(64));
G.yielders_arena = arena_alloc(GIBI(64));
/* Init wait lists */
G.wait_lists_arena = arena_alloc(GIGABYTE(64));
G.wait_lists_arena = arena_alloc(GIBI(64));
/* Init fibers */
G.num_fibers = 1; /* Fiber at index 0 always nil */
G.fiber_names_arena = arena_alloc(GIGABYTE(64));
G.fiber_names_arena = arena_alloc(GIBI(64));
/* Init job queues */
for (u32 i = 0; i < countof(G.job_queues); ++i) {
struct job_queue *queue = &G.job_queues[i];
queue->kind = (enum job_queue_kind)i;
queue->arena = arena_alloc(GIGABYTE(64));
queue->arena = arena_alloc(GIBI(64));
}
/* Convert main thread to fiber */
@ -2973,13 +2973,13 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance,
timeBeginPeriod(G.scheduler_period_ms);
/* Set up threads */
G.threads_arena = arena_alloc(GIGABYTE(64));
G.threads_arena = arena_alloc(GIBI(64));
/* Set up watches */
G.watches_arena = arena_alloc(GIGABYTE(64));
G.watches_arena = arena_alloc(GIBI(64));
/* Set up windows */
G.windows_arena = arena_alloc(GIGABYTE(64));
G.windows_arena = arena_alloc(GIBI(64));
/* Initialize vk table */
win32_init_vk_btn_table();

View File

@ -218,7 +218,7 @@ struct user_startup_receipt user_startup(struct gp_startup_receipt *gp_sr,
(UNUSED)host_sr;
(UNUSED)sim_sr;
G.arena = arena_alloc(GIGABYTE(64));
G.arena = arena_alloc(GIBI(64));
G.real_time_ns = sys_time_ns();
/* TODO: Remove this */
@ -228,7 +228,7 @@ struct user_startup_receipt user_startup(struct gp_startup_receipt *gp_sr,
G.average_local_to_user_snapshot_publish_dt_ns = NS_FROM_SECONDS(1) / SIM_TICKS_PER_SECOND;
/* Sys events */
G.sys_events_arena = arena_alloc(GIGABYTE(64));
G.sys_events_arena = arena_alloc(GIBI(64));
/* User blend clients */
G.user_client_store = sim_client_store_alloc();
@ -245,7 +245,7 @@ struct user_startup_receipt user_startup(struct gp_startup_receipt *gp_sr,
G.world_gp_flow = gp_flow_alloc();
G.ui_gp_flow = gp_flow_alloc();
G.console_logs_arena = arena_alloc(GIGABYTE(64));
G.console_logs_arena = arena_alloc(GIBI(64));
//log_register_callback(debug_console_log_callback, LOG_LEVEL_SUCCESS);
log_register_callback(debug_console_log_callback, LOG_LEVEL_DEBUG);
@ -2206,8 +2206,8 @@ INTERNAL SYS_JOB_DEF(local_sim_job, _)
is_master = true;
}
struct bitbuff msg_writer_bb = bitbuff_alloc(GIGABYTE(64));
struct bitbuff snapshot_writer_bb = bitbuff_alloc(GIGABYTE(64));
struct bitbuff msg_writer_bb = bitbuff_alloc(GIBI(64));
struct bitbuff snapshot_writer_bb = bitbuff_alloc(GIBI(64));
struct sim_accel accel = sim_accel_alloc();
struct sim_client_store *store = sim_client_store_alloc();