File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ use crate::ptr;
30
30
/// };
31
31
///
32
32
/// const ARENA_SIZE: usize = 128 * 1024;
33
- /// #[repr(C, align(131072))] // 131072 == ARENA_SIZE.
33
+ /// const MAX_SUPPORTED_ALIGN: usize = 4096;
34
+ /// #[repr(C, align(4096))] // 4096 == MAX_SUPPORTED_ALIGN
34
35
/// struct SimpleAllocator {
35
36
/// arena: UnsafeCell<[u8; ARENA_SIZE]>,
36
37
/// remaining: AtomicUsize, // we allocate from the top, counting down
@@ -53,8 +54,7 @@ use crate::ptr;
53
54
/// // So we can safely use a mask to ensure alignment without worrying about UB.
54
55
/// let align_mask_to_round_down = !(align - 1);
55
56
///
56
- /// if align > ARENA_SIZE {
57
- /// // align may be > size !
57
+ /// if align > MAX_SUPPORTED_ALIGN {
58
58
/// return null_mut();
59
59
/// }
60
60
///
You can’t perform that action at this time.
0 commit comments