@@ -111,21 +111,21 @@ struct KRRegion(ParentAllocator = NullAllocator)
111
111
112
112
this (this ) @disable ;
113
113
114
- pure nothrow @trusted @nogc
114
+ pure nothrow @safe @nogc
115
115
void [] payload () inout
116
116
{
117
117
return (cast (ubyte * ) &this )[0 .. size];
118
118
}
119
119
120
- pure nothrow @trusted @nogc
120
+ pure nothrow @safe @nogc
121
121
bool adjacent (in Node* right) const
122
122
{
123
123
assert (right);
124
124
auto p = payload;
125
125
return p.ptr < right && right < p.ptr + p.length + Node.sizeof;
126
126
}
127
127
128
- pure nothrow @trusted @nogc
128
+ pure nothrow @safe @nogc
129
129
bool coalesce (void * memoryEnd = null )
130
130
{
131
131
// Coalesce the last node before the memory end with any possible gap
@@ -156,7 +156,7 @@ struct KRRegion(ParentAllocator = NullAllocator)
156
156
if (leftover >= Node.sizeof)
157
157
{
158
158
// There's room for another node
159
- auto newNode = (() @trusted => cast (Node* ) ((cast (ubyte * ) &this ) + bytes))();
159
+ auto newNode = (() @safe => cast (Node* ) ((cast (ubyte * ) &this ) + bytes))();
160
160
newNode.size = leftover;
161
161
newNode.next = next == &this ? newNode : next;
162
162
assert (next);
@@ -418,7 +418,7 @@ struct KRRegion(ParentAllocator = NullAllocator)
418
418
immutable balance = root.size - actualBytes;
419
419
if (balance >= Node.sizeof)
420
420
{
421
- auto newRoot = (() @trusted => cast (Node* ) (result + actualBytes))();
421
+ auto newRoot = (() @safe => cast (Node* ) (result + actualBytes))();
422
422
newRoot.next = root.next;
423
423
newRoot.size = balance;
424
424
root = newRoot;
@@ -428,7 +428,7 @@ struct KRRegion(ParentAllocator = NullAllocator)
428
428
root = null ;
429
429
switchToFreeList;
430
430
}
431
- return (() @trusted => result[0 .. n])();
431
+ return (() @safe => result[0 .. n])();
432
432
}
433
433
434
434
// Not enough memory, switch to freelist mode and fall through
@@ -604,7 +604,7 @@ struct KRRegion(ParentAllocator = NullAllocator)
604
604
It does a simple $(BIGOH 1) range check. `b` should be a buffer either
605
605
allocated with `this` or obtained through other means.
606
606
*/
607
- pure nothrow @trusted @nogc
607
+ pure nothrow @safe @nogc
608
608
Ternary owns (void [] b)
609
609
{
610
610
debug (KRRegion) assertValid(" owns" );
@@ -942,3 +942,4 @@ version (StdUnittest)
942
942
assert (alloc.deallocate(k));
943
943
assert (alloc.empty == Ternary.yes);
944
944
}
945
+
0 commit comments