pub struct Allocation { /* private fields */ }
Implementations§
Source§impl Allocation
impl Allocation
Sourcepub unsafe fn heap(&self) -> &ProtocolObject<dyn MTLHeap>
pub unsafe fn heap(&self) -> &ProtocolObject<dyn MTLHeap>
Returns the MTLHeap
object that is backing this allocation.
This heap object can be shared with multiple other allocations and shouldn’t be allocated from without this library, because that will lead to undefined behavior.
§Safety
When allocating new buffers, textures, or other resources on this MTLHeap
, be sure to
pass Self::offset()
and not exceed Self::size()
to not allocate new resources on top
of existing Allocation
s.
Also, this Allocation
must not be Allocator::free()
d while such a created resource
on this MTLHeap
is still live.
Sourcepub fn offset(&self) -> u64
pub fn offset(&self) -> u64
Returns the offset of the allocation on the MTLHeap
.
Since all Allocation
s are suballocated within a MTLHeap
, this offset always needs to
be supplied. See the safety documentation on Self::heap()
.
pub fn name(&self) -> Option<&str>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Allocation
impl !RefUnwindSafe for Allocation
impl !Send for Allocation
impl !Sync for Allocation
impl Unpin for Allocation
impl !UnwindSafe for Allocation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more