Lines Matching defs:allocator

13844 fn check_overalign_requests<T: Allocator>(allocator: T) {
13853 allocator.allocate(Layout::from_size_align(size, align).unwrap()).unwrap()
13866 allocator.deallocate(
14021 // These are the magic symbols to call the global allocator. rustc generates
14039 /// The global memory allocator.
14042 /// to the allocator registered with the `#[global_allocator]` attribute
14055 /// Allocate memory with the global allocator.
14058 /// of the allocator registered with the `#[global_allocator]` attribute
14089 /// Deallocate memory with the global allocator.
14092 /// of the allocator registered with the `#[global_allocator]` attribute
14107 /// Reallocate memory with the global allocator.
14110 /// of the allocator registered with the `#[global_allocator]` attribute
14125 /// Allocate zero-initialized memory with the global allocator.
14128 /// of the allocator registered with the `#[global_allocator]` attribute
14309 /// The allocator for unique pointers.
14461 /// * Uses the excess returned from the allocator to use the largest available capacity.
14546 /// Like `new`, but parameterized over the choice of allocator for
14555 /// allocator for the returned `RawVec`.
14562 /// of allocator for the returned `RawVec`.
14587 /// an allocator could overallocate and return a greater memory block than requested.
14633 /// Reconstitutes a `RawVec` from a pointer, capacity, and allocator.
14637 /// The `ptr` must be allocated (via the given allocator `alloc`), and with the given
14664 /// Returns a shared reference to the allocator backing this `RawVec`.
14665 pub fn allocator(&self) -> &A {
14766 /// exactly the amount of memory necessary, but in principle the allocator
14916 // The allocator checks for alignment equality
16845 /// same allocator the standard library uses, with a required alignment of exactly 1.
16850 /// Violating these may cause problems like corrupting the allocator's
17069 /// better than the allocator.
17120 /// If the capacity overflows, or the allocator reports a failure, then an error
17152 /// Note that the allocator may give the collection more space than it
17158 /// If the capacity overflows, or the allocator reports a failure, then an error
19350 //! default global allocator. It is not compatible with the libc allocator API.
22427 /// Copies `self` into a new `Vec` with an allocator.
39956 /// The memory allocator returned an error
39966 Enable exposing the allocator’s custom error value \
39993 TryReserveError::AllocError { .. } => " because the memory allocator returned a error",
40946 /// Note that the allocator may give the collection more space than it requests. Therefore
41008 /// Note that the allocator may give the collection more space than it
41014 /// If the capacity overflows `usize`, or the allocator reports a failure, then an error
41052 /// If the capacity overflows `usize`, or the allocator reports a failure, then an error
41097 /// It will drop down as close as possible to the length but the allocator may still inform the
45157 /// Note that the allocator may give the collection more space than it requests. Therefore
45923 /// Returns a reference to the underlying allocator.
45926 pub fn allocator(&self) -> &A {
46341 /// Returns a reference to the underlying allocator.
46344 pub fn allocator(&self) -> &A {
46345 unsafe { self.vec.as_ref().allocator() }
47091 /// (as defined by the allocator Rust is configured to use by default), and its
47131 /// the allocator. If you wish to free up unused memory, use
47269 /// Violating these may cause problems like corrupting the allocator's
47273 /// the allocator cares about the alignment, and these two types have different
47344 /// allocator.
47407 /// Violating these may cause problems like corrupting the allocator's
47411 /// the allocator cares about the alignment, and these two types have different
47448 /// let alloc = v.allocator();
47508 /// the allocated capacity of the data (in elements), and the allocator. These are the same
47549 let alloc = unsafe { ptr::read(me.allocator()) };
47596 /// Note that the allocator may give the collection more space than it
47625 /// If the capacity overflows, or the allocator reports a failure, then an error
47661 /// Note that the allocator may give the collection more space than it
47667 /// If the capacity overflows, or the allocator reports a failure, then an error
47699 /// It will drop down as close as possible to the length but the allocator
47956 /// Returns a reference to the underlying allocator.
47959 pub fn allocator(&self) -> &A {
47960 self.buf.allocator()
48659 Vec::with_capacity_in(self.capacity(), self.allocator().clone()),
48664 let mut other = Vec::with_capacity_in(other_len, self.allocator().clone());
49146 let alloc = self.allocator().clone();
49156 let alloc = self.allocator().clone();
49238 let alloc = ptr::read(me.allocator());
49784 /// Returns a reference to the underlying allocator.
49787 pub fn allocator(&self) -> &A {
49788 self.vec.allocator()
50225 //! For non-zero-sized values, a [`Box`] will use the [`Global`] allocator for
50227 //! raw pointer allocated with the [`Global`] allocator, given that the
50228 //! [`Layout`] used with the allocator is correct for the type. More precisely,
50229 //! a `value: *mut T` that has been allocated with the [`Global`] allocator
50233 //! [`Global`] allocator with [`Layout::for_value(&*value)`].
50284 //! free the value with the global allocator. In general, the best practice
50286 //! allocator.
50489 /// Allocates memory in the given allocator then places `x` into it.
50512 /// Allocates memory in the given allocator then places `x` into it,
50537 /// Constructs a new box with uninitialized contents in the provided allocator.
50569 /// Constructs a new box with uninitialized contents in the provided allocator,
50600 /// being filled with `0` bytes in the provided allocator.
50632 /// being filled with `0` bytes in the provided allocator,
50750 /// Constructs a new boxed slice with uninitialized contents in the provided allocator.
50778 /// Constructs a new boxed slice with uninitialized contents in the provided allocator,
50907 /// Manually create a `Box` from scratch by using the global allocator:
50931 /// Constructs a box from a raw pointer in the given allocator.
50959 /// Manually create a `Box` from scratch by using the system allocator:
51029 /// Consumes the `Box`, returning a wrapped raw pointer and the allocator.
51099 /// Returns a reference to the underlying allocator.
51102 /// to call it as `Box::allocator(&b)` instead of `b.allocator()`. This
51106 pub fn allocator(b: &Self) -> &A {
51750 let alloc = Box::allocator(self).clone();
51876 // cannot check what happens when allocator is exhausted
51883 // A dumb allocator that consumes a fixed amount of fuel