diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-07-05 17:16:37 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-07-05 20:49:44 +0200 |
commit | bdcafee412ab6eec58f6b315e16e57fe3dad002f (patch) | |
tree | afd73a1a23dcb5440ebce45f241b0646c9a51980 /vm/vm_object.h | |
parent | cab23fb54d10843158e874d87dd3725ddbb2b4db (diff) | |
download | gnumach-bdcafee412ab6eec58f6b315e16e57fe3dad002f.tar.gz gnumach-bdcafee412ab6eec58f6b315e16e57fe3dad002f.tar.bz2 gnumach-bdcafee412ab6eec58f6b315e16e57fe3dad002f.zip |
vm: Make vm_object_coalesce return new object and offset
vm_object_coalesce() callers used to rely on the fact that it always
merged the next_object into prev_object, potentially destroying
next_object and leaving prev_object the result of the whole operation.
After ee65849bec5da261be90f565bee096abb4117bdd
"vm: Allow coalescing null object with an internal object", this is no
longer true, since in case of prev_object == VM_OBJECT_NULL and
next_object != VM_OBJECT_NULL, the overall result is next_object, not
prev_object. The current callers are prepared to deal with this since
they handle this case seprately anyway, but the following commit will
introduce another caller that handles both cases in the same code path.
So, declare the way vm_object_coalesce() coalesces the two objects its
implementation detail, and make it return the resulting object and the
offset into it explicitly. This simplifies the callers, too.
Message-Id: <20230705141639.85792-2-bugaevc@gmail.com>
Diffstat (limited to 'vm/vm_object.h')
-rw-r--r-- | vm/vm_object.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vm/vm_object.h b/vm/vm_object.h index 46328a38..9c17541f 100644 --- a/vm/vm_object.h +++ b/vm/vm_object.h @@ -247,7 +247,9 @@ extern boolean_t vm_object_coalesce( vm_offset_t prev_offset, vm_offset_t next_offset, vm_size_t prev_size, - vm_size_t next_size); + vm_size_t next_size, + vm_object_t *new_object, /* OUT */ + vm_offset_t *new_offset); /* OUT */ extern void vm_object_pager_wakeup(ipc_port_t pager); |