| ... | @@ -794,8 +794,10 @@ test "PageAllocator" { | ... | @@ -794,8 +794,10 @@ test "PageAllocator" { |
| 794 | const allocator = page_allocator; | 794 | const allocator = page_allocator; |
| 795 | try testAllocator(allocator); | 795 | try testAllocator(allocator); |
| 796 | try testAllocatorAligned(allocator, 16); | 796 | try testAllocatorAligned(allocator, 16); |
| 797 | try testAllocatorLargeAlignment(allocator); | 797 | if (!std.Target.current.isWasm()) { |
| 798 | try testAllocatorAlignedShrink(allocator); | 798 | try testAllocatorLargeAlignment(allocator); |
| | 799 | try testAllocatorAlignedShrink(allocator); |
| | 800 | } |
| 799 | | 801 | |
| 800 | if (builtin.os == .windows) { | 802 | if (builtin.os == .windows) { |
| 801 | // Trying really large alignment. As mentionned in the implementation, | 803 | // Trying really large alignment. As mentionned in the implementation, |
| ... | @@ -832,7 +834,7 @@ test "ArenaAllocator" { | ... | @@ -832,7 +834,7 @@ test "ArenaAllocator" { |
| 832 | try testAllocatorAlignedShrink(&arena_allocator.allocator); | 834 | try testAllocatorAlignedShrink(&arena_allocator.allocator); |
| 833 | } | 835 | } |
| 834 | | 836 | |
| 835 | var test_fixed_buffer_allocator_memory: [80000 * @sizeOf(u64)]u8 = undefined; | 837 | var test_fixed_buffer_allocator_memory: [800000 * @sizeOf(u64)]u8 = undefined; |
| 836 | test "FixedBufferAllocator" { | 838 | test "FixedBufferAllocator" { |
| 837 | var fixed_buffer_allocator = FixedBufferAllocator.init(test_fixed_buffer_allocator_memory[0..]); | 839 | var fixed_buffer_allocator = FixedBufferAllocator.init(test_fixed_buffer_allocator_memory[0..]); |
| 838 | | 840 | |
| ... | @@ -955,8 +957,7 @@ fn testAllocatorAligned(allocator: *mem.Allocator, comptime alignment: u29) !voi | ... | @@ -955,8 +957,7 @@ fn testAllocatorAligned(allocator: *mem.Allocator, comptime alignment: u29) !voi |
| 955 | fn testAllocatorLargeAlignment(allocator: *mem.Allocator) mem.Allocator.Error!void { | 957 | fn testAllocatorLargeAlignment(allocator: *mem.Allocator) mem.Allocator.Error!void { |
| 956 | //Maybe a platform's page_size is actually the same as or | 958 | //Maybe a platform's page_size is actually the same as or |
| 957 | // very near usize? | 959 | // very near usize? |
| 958 | //if (mem.page_size << 2 > maxInt(usize)) return; | 960 | if (mem.page_size << 2 > maxInt(usize)) return; |
| 959 | if (mem.page_size << 2 > 32768) return; | | |
| 960 | | 961 | |
| 961 | const USizeShift = @IntType(false, std.math.log2(usize.bit_count)); | 962 | const USizeShift = @IntType(false, std.math.log2(usize.bit_count)); |
| 962 | const large_align = @as(u29, mem.page_size << 2); | 963 | const large_align = @as(u29, mem.page_size << 2); |