Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 4502e9b

Browse files
Geod24thewilsonator
authored andcommitted
Add attributes to GCBits.{clear,set,setLocked,test}
Like we did for pooltable.opSlice, we assume that GCBits, being internal to druntime and the GC implementation, will not be called on untested code path without contracts enabled.
1 parent 1a232a4 commit 4502e9b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/internal/gc/bits.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct GCBits
6060
onOutOfMemoryError();
6161
}
6262

63-
wordtype test(size_t i) const nothrow
63+
wordtype test(size_t i) const scope @trusted pure nothrow @nogc
6464
in
6565
{
6666
assert(i < nbits);
@@ -70,7 +70,7 @@ struct GCBits
7070
return core.bitop.bt(data, i);
7171
}
7272

73-
int set(size_t i) nothrow
73+
int set(size_t i) scope @trusted pure nothrow @nogc
7474
in
7575
{
7676
assert(i < nbits);
@@ -80,7 +80,7 @@ struct GCBits
8080
return core.bitop.bts(data, i);
8181
}
8282

83-
int clear(size_t i) nothrow
83+
int clear(size_t i) scope @trusted pure nothrow @nogc
8484
in
8585
{
8686
assert(i <= nbits);
@@ -91,7 +91,7 @@ struct GCBits
9191
}
9292

9393
// return non-zero if bit already set
94-
size_t setLocked(size_t i) nothrow
94+
size_t setLocked(size_t i) scope @trusted pure nothrow @nogc
9595
{
9696
version (GNU)
9797
{
@@ -112,7 +112,7 @@ struct GCBits
112112
}
113113
else version (D_InlineAsm_X86)
114114
{
115-
asm @nogc nothrow {
115+
asm pure @nogc nothrow {
116116
mov EAX, this;
117117
mov ECX, data[EAX];
118118
mov EDX, i;
@@ -123,7 +123,7 @@ struct GCBits
123123
}
124124
else version (D_InlineAsm_X86_64)
125125
{
126-
asm @nogc nothrow {
126+
asm pure @nogc nothrow {
127127
mov RAX, this;
128128
mov RAX, data[RAX];
129129
mov RDX, i;

0 commit comments

Comments
 (0)