arena: update Paging arena
This commit is contained in:
parent
c6bd701216
commit
92b04b2566
1 changed files with 2 additions and 2 deletions
|
|
@ -190,7 +190,7 @@ func Paging(page_size, total_reserved_in_bytes uintptr) Arena {
|
|||
|
||||
// @todo(judah): is this needed?
|
||||
runtime.AddCleanup(&base, func(_ struct{}) {
|
||||
if err := mem.Unreserve(base); err != nil {
|
||||
if err := mem.Release(base); err != nil {
|
||||
panic(fmt.Sprintf("paging: failed to release memory - %s", err))
|
||||
}
|
||||
}, struct{}{})
|
||||
|
|
@ -207,7 +207,7 @@ func Paging(page_size, total_reserved_in_bytes uintptr) Arena {
|
|||
required := offset + aligned
|
||||
to_commit := mem.AlignForward(required, page_size)
|
||||
|
||||
if err := mem.Commit(base[committed:to_commit-committed], mem.PERM_READ|mem.PERM_WRITE); err != nil {
|
||||
if err := mem.Commit(base[committed:to_commit-committed], mem.AccessRead|mem.AccessWrite); err != nil {
|
||||
return nil, fmt.Errorf("paging: failed to commit memory - %w", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue