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;
3030/// };
3131///
3232/// 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
3435/// struct SimpleAllocator {
3536/// arena: UnsafeCell<[u8; ARENA_SIZE]>,
3637/// remaining: AtomicUsize, // we allocate from the top, counting down
@@ -53,8 +54,7 @@ use crate::ptr;
5354/// // So we can safely use a mask to ensure alignment without worrying about UB.
5455/// let align_mask_to_round_down = !(align - 1);
5556///
56- /// if align > ARENA_SIZE {
57- /// // align may be > size !
57+ /// if align > MAX_SUPPORTED_ALIGN {
5858/// return null_mut();
5959/// }
6060///
You can’t perform that action at this time.
0 commit comments