Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions changelog/remove_std_c.dd

This file was deleted.

19 changes: 0 additions & 19 deletions changelog/std-algorithm-iteration-joiner.dd

This file was deleted.

27 changes: 0 additions & 27 deletions changelog/std-algorithm-mutation-remove.dd

This file was deleted.

19 changes: 0 additions & 19 deletions changelog/std-math-fminmax.dd

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private mixin template BitmappedBlockImpl(bool isShared, bool multiBlock)
auto leadingUlongs = blocks.divideRoundUp(64);
import std.algorithm.comparison : min;
immutable initialAlignment = min(parentAlignment,
1U << trailingZeros(leadingUlongs * 8));
1U << min(31U, trailingZeros(leadingUlongs * 8)));
auto maxSlack = alignment <= initialAlignment
? 0
: alignment - initialAlignment;
Expand Down
7 changes: 5 additions & 2 deletions std/experimental/allocator/common.d
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,19 @@ Returns the effective alignment of `ptr`, i.e. the largest power of two that is
a divisor of `ptr`.
*/
@nogc nothrow pure
package uint effectiveAlignment(void* ptr)
package size_t effectiveAlignment(void* ptr)
{
return 1U << trailingZeros(cast(size_t) ptr);
return (cast(size_t) 1) << trailingZeros(cast(size_t) ptr);
}

@nogc nothrow pure
@system unittest
{
int x;
assert(effectiveAlignment(&x) >= int.alignof);

const max = (cast(size_t) 1) << (size_t.sizeof * 8 - 1);
assert(effectiveAlignment(cast(void*) max) == max);
}

/*
Expand Down