Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
15
third-party/vendor/objc2/src/rc/allocated.rs
vendored
Normal file
15
third-party/vendor/objc2/src/rc/allocated.rs
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/// A marker type that can be used within [`Id`] to indicate that the object
|
||||
/// has been allocated but not initialized.
|
||||
///
|
||||
/// The reason we use `Option<Id<Allocated<T>, O>>` instead of just `*mut T`
|
||||
/// is:
|
||||
/// - To allow releasing allocated objects, e.g. in the face of panics.
|
||||
/// - To safely know the object is valid (albeit uninitialized).
|
||||
/// - To allow specifying ownership.
|
||||
///
|
||||
/// [`Id`]: crate::rc::Id
|
||||
#[repr(transparent)]
|
||||
#[derive(Debug)]
|
||||
pub struct Allocated<T: ?Sized>(T);
|
||||
|
||||
// Explicitly don't implement `Deref`, `Message` nor `RefEncode`!
|
||||
Loading…
Add table
Add a link
Reference in a new issue