AlignedAddress

Address as an unsigned integer aligned to a byte alignment alignment_.

Used as key, value or element instead of a pointer in HybridHashMap to prevent triggering of gc_addRange and gc_removeRange.

TODO: is holeValue suitably chosen?

struct AlignedAddress (
uint alignment_
) if (
alignment_ == 1 ||
alignment_ == 2
||
alignment_ == 4
||
alignment_ == 8
||
alignment_ == 16
||
alignment_ == 32
) {}

Alias This

_addr

Members

Manifest constants

alignment
enum alignment;

< Alignment in bytes.

Properties

toHash
hash_t toHash [@property getter]

Get hash of this, with extra fast computation for the small case.

Static variables

holeValue
typeof(this) holeValue;

Hole/Deletion value. Prevent hole bitmap from being used.

nullValue
typeof(this) nullValue;

Null value.

Variables

_addr
size_t _addr;

< Actual pointer address as unsigned integer.

Examples

 // cannot be @nogc when `opIndex` may throw
	alias A = AlignedAddress!1;
	import nxt.nullable_traits : hasNullValue, isNullable;
	static assert(hasNullValue!A);
	static assert(isNullable!A);

See Also

Meta