1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT license.
*/
use NonNull;
use Error;
/// Indicate that an allocation error has occurred.
///
/// This type is limited in what it can contain because additional context
/// inevitably requires more memory allocation, which is what we're trying to avoid.
;
/// A dynamic memory allocator for use with [`crate::alloc::Poly`].
///
/// # Safety
///
/// Implementations must ensure that if `allocate` succeeds, the returned slice has a length
/// of at least `layout.size()` bytes and an alignment of at least `layout.align()`. If this
/// cannot be satisfied, then an error **must** be returned.
pub unsafe
/// A dynamic memory allocator for use with [`crate::alloc::Poly`].
///
/// Users should implement [`AllocatorCore`] instead and use the blanket implementation for
/// the full cloneable allocator.