diff options
author | Xander <xander@biltopia.org> | 2023-07-27 23:03:21 +0200 |
---|---|---|
committer | Xander <xander@biltopia.org> | 2023-07-27 23:03:21 +0200 |
commit | 018d1489e6fc0c6363442033abd674f287e6f5cd (patch) | |
tree | 8078f231af0b58d0d55064947d62631ce82d6666 /kernel/memory/frame.dats | |
parent | 50854768a4ef05d0a4983a0d949059c4b421ef9c (diff) | |
download | ats-os-018d1489e6fc0c6363442033abd674f287e6f5cd.tar.xz ats-os-018d1489e6fc0c6363442033abd674f287e6f5cd.zip |
name change to initializable
Diffstat (limited to 'kernel/memory/frame.dats')
-rw-r--r-- | kernel/memory/frame.dats | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/memory/frame.dats b/kernel/memory/frame.dats index fad0420..5a950ad 100644 --- a/kernel/memory/frame.dats +++ b/kernel/memory/frame.dats @@ -10,7 +10,6 @@ staload UN = "prelude/SATS/unsafe.sats" assume frame_allocator = frame_allocator_t - implement containing_address(address): frame_t = @{ counter = $UN.cast{size_t}(address) / i2sz(PAGE_SIZE) @@ -50,8 +49,8 @@ local var allocator_static : frame_allocator_t? prval () = opt_none allocator_static -var allocator = empty<frame_allocator_t>(allocator_static) -val allocator_ref = ref_make_viewptr{enablable frame_allocator_t} (view@allocator | addr@allocator) +var allocator = uninitialized<frame_allocator_t>(allocator_static) +val allocator_ref = ref_make_viewptr{initializable frame_allocator_t} (view@allocator | addr@allocator) in @@ -66,11 +65,11 @@ in } : frame_allocator_t val (vbox pf | p) = ref_get_viewptr(allocator_ref) in - if not p->enabled then let + if not p->initialized then let prval () = opt_unnone p->obj in p->obj := allocator; - p->enabled := true; + p->initialized := true; (* choose_next_area(b.0 | b.2, !p); *) let prval () = opt_some p->obj in end; end @@ -79,7 +78,7 @@ in implement allocate_frame(bf | b) : frame_t = let val (vbox pf | p) = ref_get_viewptr(allocator_ref) in - if p->enabled then let + if p->initialized then let (* var allocator = p->obj *) prval () = opt_unsome p->obj in |