File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ unsafe impl GlobalAlloc for System {
99 unsafe fn alloc ( & self , layout : Layout ) -> * mut u8 {
1010 // jemalloc provides alignment less than MIN_ALIGN for small allocations.
1111 // So only rely on MIN_ALIGN if size >= align.
12- // Also see <https://github.com/rust-lang/rust/issues/45955>.
12+ // Also see <https://github.com/rust-lang/rust/issues/45955> and
13+ // <https://github.com/rust-lang/rust/issues/62251#issuecomment-507580914>.
1314 if layout. align ( ) <= MIN_ALIGN && layout. align ( ) <= layout. size ( ) {
1415 libc:: malloc ( layout. size ( ) ) as * mut u8
1516 } else {
@@ -25,9 +26,7 @@ unsafe impl GlobalAlloc for System {
2526
2627 #[ inline]
2728 unsafe fn alloc_zeroed ( & self , layout : Layout ) -> * mut u8 {
28- // jemalloc provides alignment less than MIN_ALIGN for small allocations.
29- // So only rely on MIN_ALIGN if size >= align.
30- // Also see <https://github.com/rust-lang/rust/issues/45955>.
29+ // See the comment above in `alloc` for why this check looks the way it does.
3130 if layout. align ( ) <= MIN_ALIGN && layout. align ( ) <= layout. size ( ) {
3231 libc:: calloc ( layout. size ( ) , 1 ) as * mut u8
3332 } else {
You can’t perform that action at this time.
0 commit comments