X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/blobdiff_plain/7e86fae368de25d7134db3e3afa586cdd588fdb6..8183938bc0141793deae76c17ea182b2774fd0df:/rt/gc/cdgc/bits.d diff --git a/rt/gc/cdgc/bits.d b/rt/gc/cdgc/bits.d index 17b71f3..7c06c83 100644 --- a/rt/gc/cdgc/bits.d +++ b/rt/gc/cdgc/bits.d @@ -162,13 +162,24 @@ struct GCBits void zero() { - version(MEMCPY_NON_SIG_SAFE) { - uint * d1=data+1,dEnd=d1+nwords; - for (;d1!=dEnd;++d1) - *d1=0u; - } else { - cstring.memset(data + 1, 0, nwords * uint.sizeof); - } + cstring.memset(data + 1, 0, nwords * uint.sizeof); + } + + void set_all() + { + cstring.memset(data + 1, 0xff, nwords * uint.sizeof); + } + + void set_group(size_t base, size_t nbits) + in + { + } + body + { + assert ((base % 8) == 0); + assert ((nbits % 8) == 0); + size_t nbytes = nbits / 8; + cstring.memset(data + 1 + (base >> BITS_SHIFT), 0xff, nbytes); } void copy(GCBits *f) @@ -178,13 +189,7 @@ struct GCBits } body { - version(MEMCPY_NON_SIG_SAFE) { - uint * d1=data+1,d2=f.data+1,dEnd=d1+nwords; - for (;d1!=dEnd;++d1,++d2) - *d1=*d2; - } else { - cstring.memcpy(data + 1, f.data + 1, nwords * uint.sizeof); - } + cstring.memcpy(data + 1, f.data + 1, nwords * uint.sizeof); } uint* base()