mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-31 03:10:03 +00:00
hot-reloading for dasm_cache, in case of filesystem changes; file stream layer -> expose filesystem-wide generation number, for very coarse-grained generation number to gracefully depend on filesystem changes passively
This commit is contained in:
@@ -10,6 +10,7 @@ fs_init(void)
|
||||
Arena *arena = arena_alloc();
|
||||
fs_shared = push_array(arena, FS_Shared, 1);
|
||||
fs_shared->arena = arena;
|
||||
fs_shared->change_gen = 1;
|
||||
fs_shared->slots_count = 1024;
|
||||
fs_shared->stripes_count = os_logical_core_count();
|
||||
fs_shared->slots = push_array(arena, FS_Slot, fs_shared->slots_count);
|
||||
@@ -33,6 +34,15 @@ fs_init(void)
|
||||
fs_shared->detector_thread = os_launch_thread(fs_detector_thread__entry_point, 0, 0);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Change Generation
|
||||
|
||||
internal U64
|
||||
fs_change_gen(void)
|
||||
{
|
||||
return ins_atomic_u64_eval(&fs_shared->change_gen);
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Cache Interaction
|
||||
|
||||
@@ -220,6 +230,10 @@ fs_streamer_thread__entry_point(void *p)
|
||||
}
|
||||
if(node != 0)
|
||||
{
|
||||
if(node->timestamp != 0)
|
||||
{
|
||||
ins_atomic_u64_inc_eval(&fs_shared->change_gen);
|
||||
}
|
||||
if(post_props.modified == pre_props.modified)
|
||||
{
|
||||
node->timestamp = post_props.modified;
|
||||
|
||||
@@ -38,6 +38,7 @@ typedef struct FS_Shared FS_Shared;
|
||||
struct FS_Shared
|
||||
{
|
||||
Arena *arena;
|
||||
U64 change_gen;
|
||||
|
||||
// rjf: path info cache
|
||||
U64 slots_count;
|
||||
@@ -71,6 +72,11 @@ global FS_Shared *fs_shared = 0;
|
||||
|
||||
internal void fs_init(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Change Generation
|
||||
|
||||
internal U64 fs_change_gen(void);
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Cache Interaction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user