refactor is_borrowed/unborrow into shared/mut variants
This commit is contained in:
@@ -125,8 +125,11 @@ unsafe impl GuestMemory for HostMemory {
|
||||
fn has_outstanding_borrows(&self) -> bool {
|
||||
self.bc.has_outstanding_borrows()
|
||||
}
|
||||
fn is_borrowed(&self, r: Region) -> bool {
|
||||
self.bc.is_borrowed(r)
|
||||
fn is_shared_borrowed(&self, r: Region) -> bool {
|
||||
self.bc.is_shared_borrowed(r)
|
||||
}
|
||||
fn is_mut_borrowed(&self, r: Region) -> bool {
|
||||
self.bc.is_mut_borrowed(r)
|
||||
}
|
||||
fn mut_borrow(&self, r: Region) -> Result<BorrowHandle, GuestError> {
|
||||
self.bc.mut_borrow(r)
|
||||
@@ -134,8 +137,11 @@ unsafe impl GuestMemory for HostMemory {
|
||||
fn shared_borrow(&self, r: Region) -> Result<BorrowHandle, GuestError> {
|
||||
self.bc.shared_borrow(r)
|
||||
}
|
||||
fn unborrow(&self, h: BorrowHandle) {
|
||||
self.bc.unborrow(h)
|
||||
fn shared_unborrow(&self, h: BorrowHandle) {
|
||||
self.bc.shared_unborrow(h)
|
||||
}
|
||||
fn mut_unborrow(&self, h: BorrowHandle) {
|
||||
self.bc.mut_unborrow(h)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user