Struct fruity__bbqsrc::core_foundation::CFAllocator [−][src]
#[repr(C)]pub struct CFAllocator(_);
Expand description
An allocator object.
Documentation: Swift | Objective-C
Using the default allocator
APIs that use CFAllocator
will take an Option<&CFAllocator>
, where
None
is equivalent to
kCFAllocatorDefault
.
Implementations
Predefined allocators.
See documentation.
An allocator that does nothing—it allocates no memory.
See documentation.
An allocator that uses malloc()
, realloc()
, and free()
.
See documentation.
An allocator that uses the default malloc zone, returned by
malloc_default_zone()
.
You should only use this when an object is safe to be allocated in non-scanned memory.
See documentation.
Special allocator argument to CFAllocatorCreate
—it uses the functions
given in the context to allocate the allocator.
See documentation.
Safety
This isn’t really a CFAllocator
reference, so most operations outside
of the single specific use case are unsafe. They will most likely cause
a segfault.
This is treated as a CFAllocator
reference in order to make it easy to
fit into CFAllocator
APIs.
Returns the type identifier for CFAllocator
.
See documentation.
pub unsafe fn create(
allocator: Option<&CFAllocator>,
context: CFAllocatorContext
) -> Arc<Self>
pub unsafe fn create(
allocator: Option<&CFAllocator>,
context: CFAllocatorContext
) -> Arc<Self>
Creates an allocator object.
See documentation.
Returns the context of the default allocator.
See documentation.
Returns the context of this allocator.
See documentation.
Getting and setting the default allocator.
Gets the default allocator object for the current thread and retains it.
See documentation.
Gets the default allocator object for the current thread without retaining it.
See documentation.
Safety
Ownership of the allocator returned by CFAllocatorGetDefault
follows
The Get Rule,
so you do not own it and cannot be certain of the object’s life span.
Sets this given allocator as the default for the current thread.
See documentation.
Safety
This allocator must be able to deal with arbitrary allocation requests.
This allocator must never be released, even if another allocator replaces it as the default.
Methods from Deref<Target = CFType<'static>>
Returns this object’s reference count.
This method is only useful for debugging certain objects.
See documentation.
Returns a code that can be used to identify self
in a hashing
structure.
Returns the unique identifier of an opaque type to which self
belongs.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for CFAllocator
impl Send for CFAllocator
impl Sync for CFAllocator
impl Unpin for CFAllocator
impl UnwindSafe for CFAllocator