Skip to content

Instantly share code, notes, and snippets.

@UplinkCoder
Created May 22, 2017 17:32
Show Gist options
  • Select an option

  • Save UplinkCoder/fb74a701e9ad2826349d49696ccbdb4b to your computer and use it in GitHub Desktop.

Select an option

Save UplinkCoder/fb74a701e9ad2826349d49696ccbdb4b to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
module vibe.core.drivers.libasync;
import object;
version (VibeLibasyncDriver)
{
import vibe.core.core;
import vibe.core.driver;
import vibe.core.drivers.threadedfile;
import vibe.core.drivers.timerqueue;
import vibe.core.log;
import vibe.utils.array : FixedRingBuffer;
import libasync : AsyncDirectoryWatcher, AsyncDNS, AsyncFile, AsyncSignal, AsyncTimer, AsyncTCPConnection, AsyncTCPListener, AsyncUDPSocket, DWFileEvent, DWChangeInfo, EventLoop, NetworkAddressLA = NetworkAddress, UDPEvent, TCPEvent, TCPOption, fd_t, getThreadEventLoop;
import libasync.internals.memory;
import libasync.types : Status;
import std.algorithm : min, max;
import std.array;
import std.container : Array;
import std.conv;
import std.datetime;
import std.encoding;
import std.exception;
import std.string;
import std.stdio : File;
import std.typecons;
import core.atomic;
import core.memory;
import core.thread;
import core.sync.mutex;
import core.stdc.stdio;
import core.sys.posix.netinet.in_;
version (Posix)
{
import core.sys.posix.sys.socket;
}
version (Windows)
{
import core.sys.windows.winsock2;
}
private __gshared EventLoop gs_evLoop;
private EventLoop s_evLoop;
private DriverCore s_driverCore;
private shared shared(int) s_refCount;
version (Windows)
{
extern (C)
{
extern (C) FILE* _wfopen(const(wchar)* filename, in wchar* mode);
extern (C) int _wchmod(in wchar*, int);
}
}
nothrow @trusted EventLoop getMainEventLoop()
{
if (s_evLoop is null)
return gs_evLoop;
return s_evLoop;
}
nothrow @safe DriverCore getDriverCore()
{
assert(s_driverCore !is null);
return s_driverCore;
}
private struct TimerInfo
{
ulong refCount = 1LU;
void delegate() callback;
Task owner;
this(void delegate() callback)
{
this.callback = callback;
return this;
}
}
final class LibasyncDriver : Object, EventDriver
{
@trusted
{
private
{
@trusted bool m_break = false;
debug (1)
{
Thread m_ownerThread;
}
@trusted AsyncTimer m_timerEvent;
@trusted TimerQueue!(TimerInfo, 10000L) m_timers;
@trusted SysTime m_nextSched = SysTime(9223372036854775807L, Rebindable(, UTC("UTC", "UTC", "UTC")));
shared @trusted shared(AsyncSignal) m_exitSignal;
}
nothrow @trusted this(DriverCore core)
{
assert(!isControlThread(), "Libasync driver created in control thread");
try
{
import core.atomic : atomicOp;
atomicOp(s_refCount, 1);
if (!gs_mutex)
{
import core.sync.mutex;
gs_mutex = new Mutex;
gs_availID.reserve(32LU);
{
ulong __key6543 = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU;
ulong __limit6544 = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = gs_availID._data;) , ((ref inout(RefCountedStore) __inlineretval15505 = this._refCounted;)) , __inlineretval15505._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = gs_availID._data;) , ((ref inout(Payload) __inlineretval15506 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15506))._capacity : 0LU;
for (; __key6543 < __limit6544; __key6543 += 1LU)
{
ulong i = __key6543;
gs_availID.insertBack(i + 1LU);
}
}
gs_maxID = 32LU;
}
}
catch(Throwable)
{
halt;
}
s_driverCore = core;
s_evLoop = getThreadEventLoop();
if (!gs_evLoop)
gs_evLoop = s_evLoop;
this.m_exitSignal = new shared(AsyncSignal)(getMainEventLoop());
this.m_exitSignal.run(delegate ()
{
this.m_break = true;
}
);
logTrace("Loaded libasync backend in thread %s", delegate string() => getThis().name());
return this;
}
static nothrow @property @trusted bool isControlThread()
{
try
{
return sm_this.isDaemon() && sm_this.name() == "CmdProcessor";
}
catch(Throwable __o6547)
{
halt;
}
}
override @trusted void dispose()
{
{
string fmt = "Deleting event driver";
log(fmt);
}
this.m_break = true;
{
in EventLoop this = s_evLoop is null ? gs_evLoop : s_evLoop;
{
ref EventLoopImpl this = this.m_evLoop;
close(this.m_epollfd);
}
}
if (((ref shared(int) val = s_refCount;) , ((int mod = 1;)) , ((ref shared(int) val = val;) , ((ulong mod = cast(ulong)mod;)) , atomicFetchAdd(val, -mod)) - mod) == 0)
{
import libasync.threads : destroyAsyncThreads;
destroyAsyncThreads();
}
}
override @trusted int runEventLoop()
{
for (; !this.m_break && (s_evLoop is null ? gs_evLoop : s_evLoop).loop(((long length = 2147483647L;) , ((Duration __inlineretval15507 = (ref Duration this = Duration(0L);) , ((long hnsecs = (long value = length;) , 10000L * value / 1L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval15507)));)
{
{
this.processTimers();
(assert(s_driverCore !is null) , s_driverCore).notifyIdle();
}
}
this.m_break = false;
logDebug("Event loop exit %d", delegate bool() => this.m_break);
return 0;
}
override @trusted int runEventLoopOnce()
{
(s_evLoop is null ? gs_evLoop : s_evLoop).loop(((long length = 2147483647L;) , ((Duration __inlineretval15508 = (ref Duration this = Duration(0L);) , ((long hnsecs = (long value = length;) , 10000L * value / 1L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval15508)));
this.processTimers();
(assert(s_driverCore !is null) , s_driverCore).notifyIdle();
{
string fmt = "runEventLoopOnce exit";
log(fmt);
}
return 0;
}
override @trusted bool processEvents()
{
(s_evLoop is null ? gs_evLoop : s_evLoop).loop(((long length = 0L;) , ((Duration __inlineretval15420 = (ref Duration this = Duration(0L);) , ((long hnsecs = (long value = length;) , 10000000L * value / 1L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval15420)));
this.processTimers();
if (this.m_break)
{
this.m_break = false;
return false;
}
return true;
}
override @trusted void exitEventLoop()
{
logDebug("Exiting (%s)", delegate bool() => this.m_break);
this.m_exitSignal.trigger();
}
override @trusted LibasyncFileStream openFile(Path path, FileMode mode)
{
return cast(FileStream)new LibasyncFileStream(path, mode);
}
override @trusted DirectoryWatcher watchDirectory(Path path, bool recursive)
{
return cast(DirectoryWatcher)new LibasyncDirectoryWatcher(path, recursive);
}
override @trusted NetworkAddress resolveHost(string host, ushort family = cast(ushort)2u, bool use_dns = true)
{
import libasync.types : isIPv6;
Flag is_ipv6 = Flag.no;
if (cast(int)family == 10)
is_ipv6 = Flag.yes;
else
is_ipv6 = Flag.no;
import std.regex : regex, Captures, Regex, matchFirst, ctRegex;
import std.traits : ReturnType;
StaticRegex!char IPv4Regex = StaticRegex(& func, Regex([InversionList(CowArray([48u, 54u, 2u])), InversionList(CowArray([48u, 58u, 2u]))], [Bytecode(3221225472u), Bytecode(2432696368u), Bytecode(2952790017u), Bytecode(2952790018u), Bytecode(2164260895u), Bytecode(3087007748u), Bytecode(2147483698u), Bytecode(2147483701u), Bytecode(2281701376u), Bytecode(3154116634u), Bytecode(3087007752u), Bytecode(2147483698u), Bytecode(2428502064u), Bytecode(2428502065u), Bytecode(2428502066u), Bytecode(2428502067u), Bytecode(2428502068u), Bytecode(2281701377u), Bytecode(3154116625u), Bytecode(3087007760u), Bytecode(2432696322u), Bytecode(2415919152u), Bytecode(2415919153u), Bytecode(2449473538u), Bytecode(0u), Bytecode(5u), Bytecode(0u), Bytecode(5u), Bytecode(2281701377u), Bytecode(2432696321u), Bytecode(2281701377u), Bytecode(2449473537u), Bytecode(10u), Bytecode(5u), Bytecode(0u), Bytecode(5u), Bytecode(2181038111u), Bytecode(20u), Bytecode(3019898882u), Bytecode(2952790019u), Bytecode(2164260869u), Bytecode(3087007746u), Bytecode(2147483694u), Bytecode(3154116610u), Bytecode(3087007745u), Bytecode(3288334336u), Bytecode(2181038085u), Bytecode(25u), Bytecode(3019898883u), Bytecode(3019898881u), Bytecode(2449473584u), Bytecode(30u), Bytecode(1u), Bytecode(4u), Bytecode(4u), Bytecode(3288334336u), Bytecode(2550136833u)], null, 4u, 3u, 35u, 238u, 128u, [CharMatcher(BitTable([0u, 0u, 0u, 0u]), Trie(MultiArray([0LU, 0LU], [0LU, 0LU], null))), CharMatcher(BitTable([0u, 0u, 0u, 0u]), Trie(MultiArray([0LU, 0LU], [0LU, 0LU], null)))], null, null, ShiftOr(null, 0u, 0u)));
StaticRegex!char IPv6Regex = StaticRegex(& func, Regex([InversionList(CowArray([48u, 58u, 65u, 71u, 97u, 103u, 2u])), InversionList(CowArray([48u, 54u, 2u])), InversionList(CowArray([48u, 58u, 2u]))], [Bytecode(3221225472u), Bytecode(2432696330u), Bytecode(2952790017u), Bytecode(2432696321u), Bytecode(2281701376u), Bytecode(2449473537u), Bytecode(0u), Bytecode(8u), Bytecode(0u), Bytecode(32u), Bytecode(2147483706u), Bytecode(3019898881u), Bytecode(2449473546u), Bytecode(40u), Bytecode(1u), Bytecode(2u), Bytecode(7u), Bytecode(2952790018u), Bytecode(2164260929u), Bytecode(3087007753u), Bytecode(2432696321u), Bytecode(2281701376u), Bytecode(2449473537u), Bytecode(48u), Bytecode(1u), Bytecode(1u), Bytecode(4u), Bytecode(3288334336u), Bytecode(3154116663u), Bytecode(3087007798u), Bytecode(2432696368u), Bytecode(2952790019u), Bytecode(2952790020u), Bytecode(2164260895u), Bytecode(3087007748u), Bytecode(2147483698u), Bytecode(2147483701u), Bytecode(2281701377u), Bytecode(3154116634u), Bytecode(3087007752u), Bytecode(2147483698u), Bytecode(2428502064u), Bytecode(2428502065u), Bytecode(2428502066u), Bytecode(2428502067u), Bytecode(2428502068u), Bytecode(2281701378u), Bytecode(3154116625u), Bytecode(3087007760u), Bytecode(2432696322u), Bytecode(2415919152u), Bytecode(2415919153u), Bytecode(2449473538u), Bytecode(53u), Bytecode(5u), Bytecode(0u), Bytecode(5u), Bytecode(2281701378u), Bytecode(2432696321u), Bytecode(2281701378u), Bytecode(2449473537u), Bytecode(63u), Bytecode(5u), Bytecode(0u), Bytecode(5u), Bytecode(2181038111u), Bytecode(73u), Bytecode(3019898884u), Bytecode(2952790021u), Bytecode(2164260869u), Bytecode(3087007746u), Bytecode(2147483694u), Bytecode(3154116610u), Bytecode(3087007745u), Bytecode(3288334336u), Bytecode(2181038085u), Bytecode(78u), Bytecode(3019898885u), Bytecode(3019898883u), Bytecode(2449473584u), Bytecode(83u), Bytecode(1u), Bytecode(4u), Bytecode(4u), Bytecode(2181038145u), Bytecode(88u), Bytecode(3019898882u), Bytecode(3288334336u), Bytecode(2550136833u)], null, 6u, 4u, 89u, 421u, 128u, [CharMatcher(BitTable([0u, 0u, 0u, 0u]), Trie(MultiArray([0LU, 0LU], [0LU, 0LU], null))), CharMatcher(BitTable([0u, 0u, 0u, 0u]), Trie(MultiArray([0LU, 0LU], [0LU, 0LU], null))), CharMatcher(BitTable([0u, 0u, 0u, 0u]), Trie(MultiArray([0LU, 0LU], [0LU, 0LU], null)))], null, null, ShiftOr(null, 0u, 0u)));
Captures!(string, ulong) ipv4 = (string input = host;) , ((StaticRegex!char re = IPv4Regex;)) , ((Captures!(string, ulong) __inlineretval15509 = matchOnce(input, re);) , __inlineretval15509);
try
{
Captures!(string, ulong) ipv6 = (string input = host;) , ((StaticRegex!char re = IPv6Regex;)) , ((Captures!(string, ulong) __inlineretval15510 = matchOnce(input, re);) , __inlineretval15510);
try
{
if (!(ipv4._nMatch == 0 || ipv4._f >= ipv4._b))
{
if (!(ipv4._nMatch == 0 || ipv4._f >= ipv4._b))
is_ipv6 = Flag.no;
use_dns = false;
}
else if (!(ipv6._nMatch == 0 || ipv6._f >= ipv6._b))
{
is_ipv6 = Flag.yes;
use_dns = false;
}
else
{
use_dns = true;
}
NetworkAddress ret = 0;
if (use_dns)
{
bool done = false;
struct DNSCallback
{
Task waiter;
NetworkAddress* address;
bool* finished;
void handler(NetworkAddress addr)
{
*this.address = NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , , ).this(addr);
*this.finished = true;
if (!((ref Task this = this.waiter;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && !((ref Task this = this.waiter;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter))
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.waiter, null);
}
void* this;
}
DNSCallback* cb = (void[] mem = manualAllocator().alloc(40LU);) , ((const(void*) p = cast(void*)mem;) , ((ulong sz = 40LU;)) , ((const(TypeInfo) ti = null;)) , gc_addRange(p, sz, ti)) , ((void[] chunk = mem;) , ((void[] chunk = chunk;) , ((ulong typeSize = 40LU;)) , ((ulong typeAlignment = 8LU;)) , ((string typeName = "DNSCallback";)) , (assert(chunk.length >= typeSize, "emplace: Chunk size too small.") , assert(cast(ulong)cast(void*)chunk % typeAlignment == 0LU, "emplace: Chunk is not aligned.")) , emplaceRef(*cast(DNSCallback*)cast(void*)chunk) , cast(DNSCallback*)cast(void*)chunk));
(*cb).waiter = getThis();
(*cb).address = & ret;
(*cb).finished = & done;
shared shared(AsyncDNS) dns = new shared(AsyncDNS)(getMainEventLoop());
try
{
bool success = dns.handler(&(*cb).handler).resolveHost(host, is_ipv6, false);
if (!success || cast(int)dns.status().code != 0)
throw new Exception(dns.status().text, "core/vibe/core/drivers/libasync.d", 253LU, null);
for (; !done;)
{
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
}
if (cast(int)dns.status().code != 0)
throw new Exception(dns.status().text, "core/vibe/core/drivers/libasync.d", 257LU, null);
assert(ret !is NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , , ));
assert(cast(int)ret.addr.sa_family != 0);
logTrace("Async resolved address %s", delegate string() => ret.toString());
{
DNSCallback* obj = cb;
DNSCallback* objc = obj;
{
ref DNSCallback* obj = objc;
obj = null;
}
{
const(void*) p = cast(void*)obj;
gc_removeRange(p);
}
manualAllocator().free((cast(void*)obj)[0..40]);
}
if (cast(int)ret.addr.sa_family == 0)
{
ushort val = family;
ret.addr.sa_family = cast(ushort)cast(ubyte)val;
}
return ret;
}
finally
{
{
shared(AsyncDNS) obj = dns;
rt_finalize(cast(void*)obj, true);
}
}
}
else
{
ret = NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , , ).this((s_evLoop is null ? gs_evLoop : s_evLoop).resolveIP(host, cast(ushort)0u, is_ipv6, Flag.yes, Flag.yes));
if (cast(int)ret.addr.sa_family == 0)
{
ushort val = family;
ret.addr.sa_family = cast(ushort)cast(ubyte)val;
}
return ret;
}
}
finally
{
{
if (!(ipv6._refcount & 2147483648u))
{
if ((ipv6._refcount -= 1u) == 0u)
{
free(cast(void*)cast(Group!ulong*)ipv6.big_matches);
ipv6.big_matches = null;
}
}
}
}
}
finally
{
{
if (!(ipv4._refcount & 2147483648u))
{
if ((ipv4._refcount -= 1u) == 0u)
{
free(cast(void*)cast(Group!ulong*)ipv4.big_matches);
ipv4.big_matches = null;
}
}
}
}
}
override @trusted LibasyncTCPConnection connectTCP(NetworkAddress addr, NetworkAddress bind_addr)
{
AsyncTCPConnection conn = new AsyncTCPConnection(getMainEventLoop(), 0);
LibasyncTCPConnection tcp_connection = new LibasyncTCPConnection(conn, (TCPConnection conn)
{
Task waiter = (cast(LibasyncTCPConnection)conn).m_settings.writer.task;
if (!waiter.opEquals(Task(null, 0LU)))
{
getDriverCore().resumeTask(waiter, null);
}
}
);
if (!getThis().opEquals(Task(null, 0LU)))
tcp_connection.m_settings.writer.acquire();
tcp_connection.m_tcpImpl.conn = conn;
conn.ip(bind_addr.toAddressString(), cast(ulong)bind_addr.port());
conn.peer(((NetworkAddress __retvar15514 = void;) , (__retvar15514 = NetworkAddress , ((ushort val = (ref NetworkAddress this = addr;) , this.addr.sa_family;) , __retvar15514.addr.sa_family = cast(ushort)cast(ubyte)val) , (cast(ubyte*)&__retvar15514.addr)[0..cast(ulong)addr.sockAddrLen()] = (cast(ubyte*)((ref NetworkAddress this = addr;) , &this.addr))[0..cast(ulong)addr.sockAddrLen()] , __retvar15514)));
enforce(((void delegate(TCPEvent) del = &tcp_connection.handler;) , ((TCPEventHandler handler = 0;) , handler.del = del , handler.conn = conn , conn.run(handler))), delegate const(char)[]() => "An error occured while starting a new connection: " ~ conn.error(), "core/vibe/core/drivers/libasync.d", 296LU);
for (; !(!tcp_connection.m_closed && tcp_connection.m_tcpImpl.conn && ((in const(AsyncTCPConnection) this = tcp_connection.m_tcpImpl.conn;) , this.m_socket != 0)) && !tcp_connection.m_error;)
{
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
}
enforce(!tcp_connection.m_error, delegate const(char)[]() => cast(const(char)[])tcp_connection.m_error, "core/vibe/core/drivers/libasync.d", 299LU);
tcp_connection.m_tcpImpl.localAddr = NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , , ).this(conn.local());
if (!getThis().opEquals(Task(null, 0LU)))
tcp_connection.m_settings.writer.release();
return cast(TCPConnection)tcp_connection;
}
override @trusted LibasyncTCPListener listenTCP(ushort port, void delegate(TCPConnection conn) @safe conn_callback, string address, TCPListenOptions options)
{
NetworkAddress localaddr = ((bool ignore_unloaded = false;) , (assert(ignore_unloaded || s_driver !is null, "No event driver loaded. Did the vibe.core.core module constructor run?") , s_driver)).resolveHost(address, cast(ushort)2u, true);
localaddr.port(port);
return cast(TCPListener)new LibasyncTCPListener(localaddr, conn_callback, options);
}
override @trusted LibasyncUDPConnection listenUDP(ushort port, string bind_address = "0.0.0.0")
{
NetworkAddress localaddr = ((bool ignore_unloaded = false;) , (assert(ignore_unloaded || s_driver !is null, "No event driver loaded. Did the vibe.core.core module constructor run?") , s_driver)).resolveHost(bind_address, cast(ushort)2u, true);
localaddr.port(port);
AsyncUDPSocket sock = new AsyncUDPSocket(getMainEventLoop(), 0);
sock.local(((NetworkAddress __retvar15515 = void;) , (__retvar15515 = NetworkAddress , ((ushort val = (ref NetworkAddress this = localaddr;) , this.addr.sa_family;) , __retvar15515.addr.sa_family = cast(ushort)cast(ubyte)val) , (cast(ubyte*)&__retvar15515.addr)[0..cast(ulong)localaddr.sockAddrLen()] = (cast(ubyte*)((ref NetworkAddress this = localaddr;) , &this.addr))[0..cast(ulong)localaddr.sockAddrLen()] , __retvar15515)));
LibasyncUDPConnection udp_connection = new LibasyncUDPConnection(sock);
sock.run(&udp_connection.handler);
return cast(UDPConnection)udp_connection;
}
override nothrow @trusted LibasyncManualEvent createManualEvent()
{
return cast(ManualEvent)new LibasyncManualEvent(this);
}
override @trusted FileDescriptorEvent createFileDescriptorEvent(int file_descriptor, Trigger triggers, Mode mode)
{
halt;
}
override @trusted ulong createTimer(void delegate() @safe callback)
{
return this.m_timers.create(((ref TimerInfo this = TimerInfo(1LU, null, Task(null, 0LU));) , ((void delegate() callback = cast(void delegate())callback;)) , (this.callback = callback , this)));
}
override @trusted void acquireTimer(ulong timer_id)
{
((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15517 = ((ref inout(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15516 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15516)).data;) , __inlineretval15517)).refCount++;
}
override nothrow @trusted void releaseTimer(ulong timer_id)
{
logTrace("Releasing timer %s", delegate ulong() => timer_id);
if (!(((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15518 = ((ref inout(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15516 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15516)).data;) , __inlineretval15518)).refCount -= 1LU))
{
ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;
ulong timer = timer_id;
this.m_timers.remove(timer);
}
}
override nothrow @trusted bool isTimerPending(ulong timer_id)
{
return (ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , this.m_length) > 0LU && ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15519 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15519)).pending;
}
override @trusted void rearmTimer(ulong timer_id, Duration dur, bool periodic)
{
if (!((in LibasyncDriver this = this;) , ((ulong timer_id = timer_id;)) , ((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , this.m_length) > 0LU && ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15519 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15519)).pending)))
{
in LibasyncDriver this = this;
ulong timer_id = timer_id;
((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15517 = ((ref inout(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15516 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15516)).data;) , __inlineretval15517)).refCount++;
}
{
ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;
(ulong timer_id = timer_id;) , ((Duration timeout_duration = dur;)) , ((bool periodic = periodic;));
long timeout = currStdTime() + ((long hnsecs = timeout_duration._hnsecs;) , ((long value = hnsecs;) , 1L * value / 1L));
TimerInfo* pt = (ref HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ulong idx = this.findIndex(key);) , idx == 18446744073709551615LU ? null : &this.m_table[idx].value);
assert(pt !is null, "Accessing non-existent timer ID.");
(*pt).timeout = timeout;
(*pt).repeatDuration = periodic ? (long hnsecs = timeout_duration._hnsecs;) , ((long value = hnsecs;) , 1L * value / 1L) : 0L;
(*pt).pending = true;
this.scheduleTimer(timeout, timer_id);
}
this.rescheduleTimerEvent(((immutable(TimeZone) tz = _utc;) , ((SysTime __inlineretval15520 = (ref SysTime this = SysTime(0L, Rebindable(null, ));) , ((long stdTime = currStdTime();) , ((immutable(TimeZone) tz = tz;))) , (this._stdTime = stdTime , (this._timezone = Rebindable , this._timezone.this(tz is null ? alias FuncType = nothrow pure @safe immutable(LocalTime) function() pure nothrow;
, (*& singleton)() : tz)) , this);) , __inlineretval15520)));
}
override nothrow @trusted void stopTimer(ulong timer_id)
{
logTrace("Stopping timer %s", delegate ulong() => timer_id);
if ((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , this.m_length) > 0LU && ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15519 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15519)).pending)
{
{
ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;
ulong timer_id = timer_id;
TimerInfo* pt = (ref HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ulong idx = this.findIndex(key);) , idx == 18446744073709551615LU ? null : &this.m_table[idx].value);
(*pt).pending = false;
}
this.releaseTimer(timer_id);
}
}
override @trusted void waitTimer(ulong timer_id)
{
logTrace("Waiting for timer in %s", delegate Task() => getThis());
for (; true;)
{
{
assert(!((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , this.m_length) > 0LU && ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15521 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15521)).repeatDuration > 0L), "Cannot wait for a periodic timer.");
if (!((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , this.m_length) > 0LU && ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15519 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15519)).pending))
{
return ;
}
TimerInfo* data = &((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15522 = ((ref inout(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15516 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15516)).data;) , __inlineretval15522));
assert(((ref Task this = (*data).owner;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Waiting for the same timer from multiple tasks is not supported.");
(*data).owner = getThis();
try
{
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
}
finally
{
((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15523 = ((ref inout(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15516 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15516)).data;) , __inlineretval15523)).owner = Task(null, 0LU);
}
}
}
}
private @trusted void processTimers()
{
if (!((ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , !((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this.m_timeoutHeap;) , !((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU))))
return ;
{
string fmt = "Processing due timers";
log(fmt);
}
SysTime now = (immutable(TimeZone) tz = _utc;) , ((SysTime __inlineretval15527 = (ref SysTime this = SysTime(0L, Rebindable(null, ));) , ((long stdTime = currStdTime();) , ((immutable(TimeZone) tz = tz;))) , (this._stdTime = stdTime , (this._timezone = Rebindable , this._timezone.this(tz is null ? alias FuncType = nothrow pure @safe immutable(LocalTime) function() pure nothrow;
, (*& singleton)() : tz)) , this);) , __inlineretval15527);
this.m_nextSched.opAssign(((SysTime __inlineretval15528 = (ref SysTime this = SysTime(0L, Rebindable(null, ));) , ((long stdTime = 9223372036854775807L;) , ((immutable(TimeZone) tz = _utc;))) , (this._stdTime = stdTime , (this._timezone = Rebindable , this._timezone.this(tz is null ? alias FuncType = nothrow pure @safe immutable(LocalTime) function() pure nothrow;
, (*& singleton)() : tz)) , this);) , __inlineretval15528));
this.m_timers.consumeTimeouts(now, delegate (ulong timer, bool periodic, ref TimerInfo data)
{
Task owner = data.owner;
void delegate() callback = data.callback;
logTrace("Timer %s fired (%s/%s)", delegate ulong() => timer, delegate bool() => !owner.opEquals(Task(null, 0LU)), delegate bool() => callback !is cast(void delegate())null);
if (!periodic)
this.releaseTimer(timer);
if (owner.m_fiber !is null && owner.running() && !((const(Task) other = getThis();) , owner.m_fiber is other.m_fiber && owner.m_taskCounter == other.m_taskCounter))
{
if (getThis().opEquals(Task(null, 0LU)))
(assert(s_driverCore !is null) , s_driverCore).resumeTask(owner, null);
else
(assert(s_driverCore !is null) , s_driverCore).yieldAndResumeTask(owner, null);
}
if (callback)
runTask(callback);
}
);
this.rescheduleTimerEvent(now);
}
private @trusted void rescheduleTimerEvent(SysTime now)
{
logTrace("Rescheduling timer event %s", delegate Task() => getThis());
if (this.m_nextSched.opCmp(((immutable(TimeZone) tz = _utc;) , ((SysTime __inlineretval15529 = (ref SysTime this = SysTime(0L, Rebindable(null, ));) , ((long stdTime = currStdTime();) , ((immutable(TimeZone) tz = tz;))) , (this._stdTime = stdTime , (this._timezone = Rebindable , this._timezone.this(tz is null ? alias FuncType = nothrow pure @safe immutable(LocalTime) function() pure nothrow;
, (*& singleton)() : tz)) , this);) , __inlineretval15529))) <= 0)
return ;
bool first = false;
SysTime next = (ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;) , ((SysTime __inlineretval15531 = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this.m_timeoutHeap;) , !((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU)) ? (SysTime __inlineretval15530 = (ref SysTime this = SysTime(0L, Rebindable(null, ));) , ((long stdTime = 9223372036854775807L;) , ((immutable(TimeZone) tz = _utc;))) , (this._stdTime = stdTime , (this._timezone = Rebindable , this._timezone.this(tz is null ? alias FuncType = nothrow pure @safe immutable(LocalTime) function() pure nothrow;
, (*& singleton)() : tz)) , this);) , __inlineretval15530 : ((ref SysTime this = SysTime(0L, Rebindable(null, ));) , ((long stdTime = this.m_timeoutHeap.front().timeout;) , ((immutable(TimeZone) tz = _utc;))) , (this._stdTime = stdTime , (this._timezone = Rebindable , this._timezone.this(tz is null ? alias FuncType = nothrow pure @safe immutable(LocalTime) function() pure nothrow;
, (*& singleton)() : tz)) , this));) , __inlineretval15531);
Duration dur = 0;
if ((const(SysTime) rhs = (SysTime __inlineretval15532 = (ref SysTime this = SysTime(0L, Rebindable(null, ));) , ((long stdTime = 9223372036854775807L;) , ((immutable(TimeZone) tz = _utc;))) , (this._stdTime = stdTime , (this._timezone = Rebindable , this._timezone.this(tz is null ? alias FuncType = nothrow pure @safe immutable(LocalTime) function() pure nothrow;
, (*& singleton)() : tz)) , this);) , __inlineretval15532;) , ((ref const(SysTime) this = next;) , ((ref const(SysTime) rhs = rhs;)) , this._stdTime == rhs._stdTime))
return ;
dur = ((Duration _param_0 = (long length = 1L;) , ((Duration __inlineretval15533 = (ref Duration this = Duration(0L);) , ((long hnsecs = (long value = length;) , 10000L * value / 1L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval15533);) , ((Duration _param_1 = (const(SysTime) rhs = now;) , ((Duration __inlineretval15534 = (long length = next._stdTime - rhs._stdTime;) , ((Duration __inlineretval15042 = (ref Duration this = Duration(0L);) , ((long hnsecs = (long value = length;) , 1L * value / 1L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval15042);) , __inlineretval15534);)) , ((Duration __inlineretval15535 = alias a = Duration _param_0;
;
, (alias T0 = Duration;
) , (alias b = Duration _param_1;
;
) , (alias T1 = Duration;
) , ((immutable immutable(bool) chooseB = (ref Duration a = _param_0;) , ((ref Duration b = _param_1;)) , ((immutable immutable(bool) result = a.opCmp(b) < 0;) , result);)) , chooseB ? _param_1 : _param_0;) , __inlineretval15535));
if (!((ref SysTime this = this.m_nextSched;) , ((ref const(SysTime) rhs = next;)) , this._stdTime == rhs._stdTime))
this.m_nextSched.opAssign(next);
else
return ;
if (((long hnsecs = dur._hnsecs;) , ((long value = hnsecs;) , 1L * value / 10000000L)) >= 2147483647L)
return ;
if (!this.m_timerEvent)
{
this.m_timerEvent = new AsyncTimer(getMainEventLoop());
bool success = ((in AsyncTimer this = this.m_timerEvent;) , ((Duration dur = dur;)) , (this.m_timeout = dur , this)).run(&this.onTimerTimeout);
assert(success, "Failed to run timer");
}
else
{
bool success = this.m_timerEvent.rearm(dur);
assert(success, "Failed to rearm timer");
}
}
private @trusted void onTimerTimeout()
{
import std.encoding : sanitize;
{
string fmt = "timer event fired";
log(fmt);
}
try
this.processTimers();
catch(Exception e)
{
logError("Failed to process timers: %s", delegate string() => e.msg);
try
logDiagnostic("Full error: %s", delegate string() => sanitize(e.toString()));
catch(Throwable)
{
}
}
}
}
~this()
{
{
ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;
{
ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this.m_timeoutHeap;
this._payload.~this();
}
this.m_timers.~this();
}
}
alias __xdtor = ~this()
{
{
ref TimerQueue!(TimerInfo, 10000L) this = this.m_timers;
{
ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this.m_timeoutHeap;
this._payload.~this();
}
this.m_timers.~this();
}
}
;
}
final class LibasyncFileStream : Object, FileStream
{
@trusted
{
import vibe.core.path : Path;
private
{
@trusted Path m_path;
@trusted ulong m_size;
@trusted ulong m_offset = 0LU;
@trusted FileMode m_mode;
@trusted Task m_task;
@trusted Exception m_ex;
shared @trusted shared(AsyncFile) m_impl;
@trusted bool m_started;
@trusted bool m_truncated;
@trusted bool m_finished;
}
@trusted this(Path path, FileMode mode)
{
import std.file : getSize, exists;
if (mode != FileMode.createTrunc)
this.m_size = getSize(path.toNativeString());
else
{
string path_str = path.toNativeString();
if (exists(path_str))
{
Path path = path;
{
string path = path.toNativeString();
remove(path);
}
}
{
import std.string : toStringz;
shared(_IO_FILE)* f = fopen(toStringz(path_str), "w");
fclose(f);
this.m_truncated = true;
}
}
this.m_path = path;
this.m_mode = mode;
this.m_impl = new shared(AsyncFile)(getMainEventLoop());
this.m_impl.onReady(&this.handler);
this.m_started = true;
return this;
}
~this()
{
try
{
in LibasyncFileStream this = this;
if (this.m_impl)
{
this.m_impl.kill();
this.m_impl = null;
}
this.m_started = false;
if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && !getThis().opEquals(Task(null, 0LU)))
(assert(s_driverCore !is null) , s_driverCore).yieldAndResumeTask(this.m_task, new Exception("The file was closed during an operation", "core/vibe/core/drivers/libasync.d", 539LU, null));
else if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && getThis().opEquals(Task(null, 0LU)))
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_task, new Exception("The file was closed during an operation", "core/vibe/core/drivers/libasync.d", 541LU, null));
}
catch(Exception e)
{
halt;
}
}
override const nothrow @property @trusted Path path()
{
return this.m_path;
}
override const @property @trusted bool isOpen()
{
return this.m_started;
}
override const nothrow @property @trusted ulong size()
{
return this.m_size;
}
override const nothrow @property @trusted bool readable()
{
return this.m_mode != FileMode.append;
}
override const nothrow @property @trusted bool writable()
{
return this.m_mode != FileMode.read;
}
override @trusted void seek(ulong offset)
{
this.m_offset = offset;
}
override nothrow @trusted ulong tell()
{
return this.m_offset;
}
override @trusted void close()
{
if (this.m_impl)
{
this.m_impl.kill();
this.m_impl = null;
}
this.m_started = false;
if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && !getThis().opEquals(Task(null, 0LU)))
(assert(s_driverCore !is null) , s_driverCore).yieldAndResumeTask(this.m_task, new Exception("The file was closed during an operation", "core/vibe/core/drivers/libasync.d", 539LU, null));
else if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && getThis().opEquals(Task(null, 0LU)))
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_task, new Exception("The file was closed during an operation", "core/vibe/core/drivers/libasync.d", 541LU, null));
}
override const @property @trusted bool empty()
{
assert(((in const(LibasyncFileStream) this = this;) , this.m_mode != FileMode.append));
return this.m_offset >= this.m_size;
}
override const @property @trusted ulong leastSize()
{
assert(((in const(LibasyncFileStream) this = this;) , this.m_mode != FileMode.append));
return this.m_size - this.m_offset;
}
override @property @trusted bool dataAvailableForRead()
{
return true;
}
override @trusted const(ubyte)[] peek()
{
return null;
}
override @trusted ulong read(scope ubyte[] dst, IOMode _param_1)
{
try
{
assert(((in LibasyncFileStream this = this;) , this.m_mode != FileMode.append), "To read a file, it must be opened in a read-enabled mode.");
scope shared shared(ubyte[]) bytes = cast(shared(ubyte[]))dst;
bool truncate_if_exists = false;
if (!this.m_truncated && this.m_mode == FileMode.createTrunc)
{
truncate_if_exists = true;
this.m_truncated = true;
this.m_size = 0LU;
}
this.m_finished = false;
enforce(dst.length <= ((in LibasyncFileStream this = this;) , (assert(((in const(LibasyncFileStream) this = this;) , this.m_mode != FileMode.append)) , this.m_size - this.m_offset)), delegate const(char)[]() => null, "core/vibe/core/drivers/libasync.d", 567LU);
enforce(this.m_impl.read(this.m_path.toNativeString(), bytes, this.m_offset, true, truncate_if_exists), delegate const(char)[]() => "Failed to read data from disk: " ~ this.m_impl.error(), "core/vibe/core/drivers/libasync.d", 568LU);
if (!this.m_finished)
{
{
in LibasyncFileStream this = this;
assert(getThis().opEquals(Task(null, 0LU)) || ((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Acquiring FileStream that is already owned.");
this.m_task = getThis();
}
try
{
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
}
finally
{
{
in LibasyncFileStream this = this;
assert(getThis().opEquals(Task(null, 0LU)) || ((ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Releasing FileStream that is not owned by the calling task.");
this.m_task = Task(null, 0LU);
}
}
}
this.m_finished = false;
if (this.m_ex)
throw this.m_ex;
this.m_offset += dst.length;
assert(this.m_impl.offset() == this.m_offset, "Incoherent offset returned from file reader: " ~ ((ulong _param_0 = this.m_offset;) , ((ulong value = _param_0;) , toImpl(value, 10u, LetterCase.upper))) ~ "B assumed but the implementation is at: " ~ ((ulong _param_0 = this.m_impl.offset();) , ((ulong value = _param_0;) , toImpl(value, 10u, LetterCase.upper))) ~ "B");
return dst.length;
}
catch(Throwable __o7158)
{
{
in LibasyncFileStream this = this;
if (this.m_impl)
{
this.m_impl.kill();
this.m_impl = null;
}
this.m_started = false;
if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && !getThis().opEquals(Task(null, 0LU)))
(assert(s_driverCore !is null) , s_driverCore).yieldAndResumeTask(this.m_task, new Exception("The file was closed during an operation", "core/vibe/core/drivers/libasync.d", 539LU, null));
else if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && getThis().opEquals(Task(null, 0LU)))
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_task, new Exception("The file was closed during an operation", "core/vibe/core/drivers/libasync.d", 541LU, null));
}
throw __o7158;
}
}
alias write = abstract @safe ulong write(const(ubyte[]) bytes, IOMode mode);
;
override @trusted ulong write(const(ubyte[]) bytes_, IOMode _param_1)
{
assert(((in LibasyncFileStream this = this;) , this.m_mode != FileMode.read), "To write to a file, it must be opened in a write-enabled mode.");
shared shared(const(ubyte)[]) bytes = cast(shared(const(ubyte)[]))bytes_;
bool truncate_if_exists = false;
if (!this.m_truncated && this.m_mode == FileMode.createTrunc)
{
truncate_if_exists = true;
this.m_truncated = true;
this.m_size = 0LU;
}
this.m_finished = false;
if (this.m_mode == FileMode.append)
enforce(this.m_impl.append(this.m_path.toNativeString(), bytes, true, truncate_if_exists), delegate const(char)[]() => "Failed to write data to disk: " ~ this.m_impl.error(), "core/vibe/core/drivers/libasync.d", 601LU);
else
enforce(this.m_impl.write(this.m_path.toNativeString(), bytes, this.m_offset, true, truncate_if_exists), delegate const(char)[]() => "Failed to write data to disk: " ~ this.m_impl.error(), "core/vibe/core/drivers/libasync.d", 603LU);
if (!this.m_finished)
{
{
in LibasyncFileStream this = this;
assert(getThis().opEquals(Task(null, 0LU)) || ((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Acquiring FileStream that is already owned.");
this.m_task = getThis();
}
try
{
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
}
finally
{
{
in LibasyncFileStream this = this;
assert(getThis().opEquals(Task(null, 0LU)) || ((ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Releasing FileStream that is not owned by the calling task.");
this.m_task = Task(null, 0LU);
}
}
}
this.m_finished = false;
if (this.m_ex)
throw this.m_ex;
if (this.m_mode == FileMode.append)
{
this.m_size += bytes.length;
}
else
{
this.m_offset += bytes.length;
if (this.m_offset >= this.m_size)
this.m_size += this.m_offset - this.m_size;
assert(this.m_impl.offset() == this.m_offset, "Incoherent offset returned from file writer.");
}
return bytes_.length;
}
override @trusted void flush()
{
assert(((in LibasyncFileStream this = this;) , this.m_mode != FileMode.read), "To write to a file, it must be opened in a write-enabled mode.");
}
override @trusted void finalize()
{
if ((in LibasyncFileStream this = this;) , this.m_mode != FileMode.read)
{
in LibasyncFileStream this = this;
assert(((in LibasyncFileStream this = this;) , this.m_mode != FileMode.read), "To write to a file, it must be opened in a write-enabled mode.");
}
}
@trusted void release()
{
assert(getThis().opEquals(Task(null, 0LU)) || ((ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Releasing FileStream that is not owned by the calling task.");
this.m_task = Task(null, 0LU);
}
@trusted void acquire()
{
assert(getThis().opEquals(Task(null, 0LU)) || ((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Acquiring FileStream that is already owned.");
this.m_task = getThis();
}
private @trusted void handler()
{
Exception ex = null;
if (cast(int)this.m_impl.status().code != 0)
ex = new Exception(this.m_impl.error(), "core/vibe/core/drivers/libasync.d", 657LU, null);
this.m_finished = true;
if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter))
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_task, ex);
else
this.m_ex = ex;
}
}
alias __xdtor = ~this()
{
try
{
in LibasyncFileStream this = this;
if (this.m_impl)
{
this.m_impl.kill();
this.m_impl = null;
}
this.m_started = false;
if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && !getThis().opEquals(Task(null, 0LU)))
(assert(s_driverCore !is null) , s_driverCore).yieldAndResumeTask(this.m_task, new Exception("The file was closed during an operation", "core/vibe/core/drivers/libasync.d", 539LU, null));
else if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && getThis().opEquals(Task(null, 0LU)))
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_task, new Exception("The file was closed during an operation", "core/vibe/core/drivers/libasync.d", 541LU, null));
}
catch(Exception e)
{
halt;
}
}
;
}
final class LibasyncDirectoryWatcher : Object, DirectoryWatcher
{
@trusted
{
private
{
@trusted Path m_path;
@trusted bool m_recursive;
@trusted Task m_task;
@trusted AsyncDirectoryWatcher m_impl;
@trusted Array!(DirectoryChange) m_changes;
@trusted Exception m_error;
}
@trusted this(Path path, bool recursive)
{
this.m_impl = new AsyncDirectoryWatcher(getMainEventLoop());
this.m_impl.run(&this.handler);
this.m_path = path;
this.m_recursive = recursive;
{
in LibasyncDirectoryWatcher this = this;
(Path path = path;) , ((bool recursive = recursive;));
this.m_impl.watchDir(path.toNativeString(), DWFileEvent.ALL, recursive);
}
return this;
}
~this()
{
this.m_impl.kill();
}
override const @property @trusted Path path()
{
return this.m_path;
}
override const @property @trusted bool recursive()
{
return this.m_recursive;
}
@trusted void release()
{
assert(((ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Releasing FileStream that is not owned by the calling task.");
this.m_task = Task(null, 0LU);
}
@trusted void acquire()
{
assert(((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Acquiring FileStream that is already owned.");
this.m_task = getThis();
}
@trusted bool amOwner()
{
return (ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter;
}
override @trusted bool readChanges(ref DirectoryChange[] dst, Duration timeout)
{
dst.length = 0LU;
assert(!((in LibasyncDirectoryWatcher this = this;) , ((ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter)));
if (this.m_error)
throw this.m_error;
{
in LibasyncDirectoryWatcher this = this;
assert(((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Acquiring FileStream that is already owned.");
this.m_task = getThis();
}
try
{
@system void consumeChanges()
{
if (cast(int)((in AsyncDirectoryWatcher this = this.m_impl;) , ((StatusInfo __inlineretval15569 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval15568 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval15568);) , __inlineretval15569)).code == 3)
{
throw new Exception(this.m_impl.error(), "core/vibe/core/drivers/libasync.d", 722LU, null);
}
{
RangeT!(Array!(DirectoryChange)) __aggr7160 = this.m_changes.opSlice();
RangeT!(Array!(DirectoryChange)) __r7161 = __aggr7160.opSlice();
for (; !(__r7161._a >= __r7161._b); cast(void)(assert(!((ref RangeT!(Array!(DirectoryChange)) this = __r7161;) , this._a >= this._b), "Attempting to popFront an empty Array") , __r7161._a += 1LU))
{
ref DirectoryChange change = (ref inout(DirectoryChange) __inlineretval15570 = assert(!((ref inout(RangeT!(Array!(DirectoryChange))) this = __r7161;) , this._a >= this._b), "Attempting to access the front of an empty Array") , ((inout ref inout(Array!(DirectoryChange)) __dop4891 = (ref inout(RangeT!(Array!(DirectoryChange))) this = __r7161;) , ((ref inout(Array!(DirectoryChange)) __inlineretval14694 = this._outer_[0];) , __inlineretval14694);)) , ((ulong i = __r7161._a;) , ((ref inout(DirectoryChange) __inlineretval14697 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4891._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4891._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval14697));) , __inlineretval15570;
dst ~= change;
}
{
{
Array!(DirectoryChange)[] a = (&__r7161._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
{
{
Array!(DirectoryChange)[] a = (&__aggr7160._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
}
import std.array : array;
import std.algorithm : uniq;
dst = array(uniq(dst));
logTrace("Consumed change: %s", delegate string() => to(dst));
{
ref Array!(DirectoryChange) this = this.m_changes;
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
}
if (!((ref Array!(DirectoryChange) this = this.m_changes;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15571 = this._refCounted;)) , __inlineretval15571._store !is null) || ((const(DirectoryChange[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15572 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15572))._payload;) , !a.length)))
{
consumeChanges();
return true;
}
ulong tm = (bool ignore_unloaded = false;) , assert(ignore_unloaded || s_driver !is null, "No event driver loaded. Did the vibe.core.core module constructor run?") , ((void delegate() @safe callback = cast(void delegate() @safe)null;)) , s_driver.m_timers.create(((ref TimerInfo this = TimerInfo(1LU, null, Task(null, 0LU));) , ((void delegate() callback = cast(void delegate())callback;)) , (this.callback = callback , this)));
((ref TimerQueue!(TimerInfo, 10000L) this = ((bool ignore_unloaded = false;) , (assert(ignore_unloaded || s_driver !is null, "No event driver loaded. Did the vibe.core.core module constructor run?") , s_driver)).m_timers;) , ((ulong timer_id = tm;)) , ((ref inout(TimerInfo) __inlineretval15573 = ((ref inout(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15516 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15516)).data;) , __inlineretval15573)).owner = getThis();
((bool ignore_unloaded = false;) , (assert(ignore_unloaded || s_driver !is null, "No event driver loaded. Did the vibe.core.core module constructor run?") , s_driver)).rearmTimer(tm, timeout, false);
for (; (ref Array!(DirectoryChange) this = this.m_changes;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15571 = this._refCounted;)) , __inlineretval15571._store !is null) || ((const(DirectoryChange[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15572 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15572))._payload;) , !a.length);)
{
{
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
if (!((bool ignore_unloaded = false;) , assert(ignore_unloaded || s_driver !is null, "No event driver loaded. Did the vibe.core.core module constructor run?") , ((ulong timer_id = tm;)) , ((ref TimerQueue!(TimerInfo, 10000L) this = s_driver.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , this.m_length) > 0LU && ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15519 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15519)).pending)))
break;
}
}
if (!((ref Array!(DirectoryChange) this = this.m_changes;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15571 = this._refCounted;)) , __inlineretval15571._store !is null) || ((const(DirectoryChange[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15572 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15572))._payload;) , !a.length)))
{
consumeChanges();
return true;
}
return false;
}
finally
{
{
in LibasyncDirectoryWatcher this = this;
assert(((ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Releasing FileStream that is not owned by the calling task.");
this.m_task = Task(null, 0LU);
}
}
}
private @trusted void watch(Path path, bool recursive)
{
this.m_impl.watchDir(path.toNativeString(), DWFileEvent.ALL, recursive);
}
private @trusted void handler()
{
import std.stdio;
DWChangeInfo[] changes = allocArray(manualAllocator(), 128LU);
Exception ex = null;
try
{
uint cnt = 0u;
do
{
cnt = ((in AsyncDirectoryWatcher this = this.m_impl;) , ((ref DWChangeInfo[] dst = changes;)) , ((uint cnt = (in EventLoop this = this.m_evLoop;) , ((const(int) fd = this.m_fd;) , ((ref DWChangeInfo[] dst = dst;))) , this.m_evLoop.readChanges(fd, dst);) , cnt));
ulong i = 0LU;
{
DWChangeInfo[] __r7211 = changes[];
ulong __key7212 = 0LU;
for (; __key7212 < __r7211.length; __key7212 += 1LU)
{
DWChangeInfo change = __r7211[__key7212];
DirectoryChange dc = DirectoryChange;
final switch (change.event)
{
case DWFileEvent.CREATED:
{
dc.type = DirectoryChangeType.added;
break;
}
case DWFileEvent.DELETED:
{
dc.type = DirectoryChangeType.removed;
break;
}
case DWFileEvent.MODIFIED:
{
dc.type = DirectoryChangeType.modified;
break;
}
case DWFileEvent.MOVED_FROM:
{
dc.type = DirectoryChangeType.removed;
break;
}
case DWFileEvent.MOVED_TO:
{
dc.type = DirectoryChangeType.added;
break;
}
case DWFileEvent.ALL:
{
break;
}
case DWFileEvent.ERROR:
{
throw new Exception(this.m_impl.error(), "core/vibe/core/drivers/libasync.d", 784LU, null);
}
}
dc.path = ((ref Path this = Path(null, false, false);) , ((string pathstr = change.m_path.toNativeString();)) , (this.m_nodes = splitPath(pathstr) , this.m_absolute = ((string doesThisStart = pathstr;) , ((string withThis = "/";)) , (alias haystack = string doesThisStart;
;
, (alias needle = string withThis;
;
) , ((enum bool isDefaultPred = true;)) , doesThisStart.length < withThis.length ? false : doesThisStart[0..withThis.length] == withThis)) || this.m_nodes.length > 0LU && (((string haystack = (ref immutable(PathEntry) this = this.m_nodes[0];) , this.m_name;) , ((char needle = ':';)) , !((const(char[]) a = find(haystack, needle);) , !a.length)) || ((ref immutable(PathEntry) this = this.m_nodes[0];) , ((string rhs = "\\";)) , this.m_name == rhs)) , this.m_endsWithSlash = ((string doesThisEnd = pathstr;) , ((string withThis = "/";)) , (alias haystack = string doesThisEnd;
;
, (alias needle = string withThis;
;
) , ((enum bool isDefaultPred = true;)) , doesThisEnd.length < withThis.length ? false : doesThisEnd[__dollar - withThis.length..__dollar] == withThis)) , this));
this.m_changes.insertBack(dc);
i++;
if (cast(ulong)cnt == i)
break;
}
}
}
while (cnt == 0u && cast(int)((in AsyncDirectoryWatcher this = this.m_impl;) , ((StatusInfo __inlineretval15620 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval15568 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval15568);) , __inlineretval15620)).code == 0);
if (cast(int)((in AsyncDirectoryWatcher this = this.m_impl;) , ((StatusInfo __inlineretval15621 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval15568 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval15568);) , __inlineretval15621)).code == 3)
{
ex = new Exception(this.m_impl.error(), "core/vibe/core/drivers/libasync.d", 795LU, null);
}
}
catch(Exception e)
{
ex = e;
}
if (!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter))
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_task, ex);
else
this.m_error = ex;
{
(Allocator allocator = manualAllocator();) , ((ref DWChangeInfo[] array = changes;));
{
const(void*) p = cast(const(void*))cast(DWChangeInfo*)array;
gc_removeRange(p);
}
allocator.free(cast(void[])array);
array = null;
}
}
}
~this()
{
{
ref Array!(DirectoryChange) this = this.m_changes;
this._data.~this();
}
}
~this()
{
{
in LibasyncDirectoryWatcher this = this;
this.m_impl.kill();
}
{
in LibasyncDirectoryWatcher this = this;
{
ref Array!(DirectoryChange) this = this.m_changes;
this._data.~this();
}
}
}
alias __xdtor = ~this()
{
{
in LibasyncDirectoryWatcher this = this;
this.m_impl.kill();
}
{
in LibasyncDirectoryWatcher this = this;
{
ref Array!(DirectoryChange) this = this.m_changes;
this._data.~this();
}
}
}
;
}
final class LibasyncManualEvent : Object, ManualEvent
{
@trusted
{
private
{
shared @trusted shared(int) m_emitCount = 0;
shared @trusted shared(int) m_threadCount = 0;
shared @trusted shared(ulong) m_instance;
@trusted Array!(void*) ms_signals;
@trusted Mutex m_mutex;
nothrow @property @trusted ulong instanceID()
{
return atomicLoad(this.m_instance);
}
nothrow @property @trusted void instanceID(ulong instance)
{
atomicStore(this.m_instance, instance);
}
}
nothrow @trusted this(LibasyncDriver driver)
{
this.m_mutex = new Mutex;
{
in LibasyncManualEvent this = this;
ulong instance = generateID();
atomicStore(this.m_instance, instance);
}
return this;
}
~this()
{
{
recycleID(((in LibasyncManualEvent this = this;) , atomicLoad(this.m_instance)));
{
RangeT!(Array!(void*)) __aggr7214 = this.ms_signals.opSlice();
RangeT!(Array!(void*)) __r7215 = __aggr7214.opSlice();
for (; !(__r7215._a >= __r7215._b); cast(void)(assert(!((ref RangeT!(Array!(void*)) this = __r7215;) , this._a >= this._b), "Attempting to popFront an empty Array") , __r7215._a += 1LU))
{
ref void* signal = assert(!((ref inout(RangeT!(Array!(void*))) this = __r7215;) , this._a >= this._b), "Attempting to access the front of an empty Array") , ((inout ref inout(Array!(void*)) __dop4851 = (ref inout(RangeT!(Array!(void*))) this = __r7215;) , ((ref inout(Array!(void*)) __inlineretval14680 = this._outer_[0];) , __inlineretval14680);)) , ((ulong i = __r7215._a;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4851._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4851._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]));
if (signal)
{
(cast(shared(AsyncSignal))signal).kill();
signal = null;
}
}
{
{
Array!(void*)[] a = (&__r7215._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
{
{
Array!(void*)[] a = (&__aggr7214._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
}
}
}
override nothrow @trusted void emit()
{
try
{
{
string fmt = "Emitting signal";
log(fmt);
}
atomicOp(this.m_emitCount, 1);
Mutex __sync7318 = this.m_mutex;
_d_monitorenter(__sync7318);
{
{
string fmt = "Looping signals. found: " ~ ((ulong _param_0 = (ref Array!(void*) this = this.ms_signals;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU;) , ((ulong value = _param_0;) , toImpl(value, 10u, LetterCase.upper)));
log(fmt);
}
{
RangeT!(Array!(void*)) __aggr7321 = this.ms_signals.opSlice();
RangeT!(Array!(void*)) __r7322 = __aggr7321.opSlice();
for (; !(__r7322._a >= __r7322._b); cast(void)(assert(!((ref RangeT!(Array!(void*)) this = __r7322;) , this._a >= this._b), "Attempting to popFront an empty Array") , __r7322._a += 1LU))
{
ref void* signal = assert(!((ref inout(RangeT!(Array!(void*))) this = __r7322;) , this._a >= this._b), "Attempting to access the front of an empty Array") , ((inout ref inout(Array!(void*)) __dop4851 = (ref inout(RangeT!(Array!(void*))) this = __r7322;) , ((ref inout(Array!(void*)) __inlineretval14680 = this._outer_[0];) , __inlineretval14680);)) , ((ulong i = __r7322._a;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4851._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4851._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]));
EventLoop evloop = s_evLoop is null ? gs_evLoop : s_evLoop;
shared shared(AsyncSignal) sig = cast(shared(AsyncSignal))signal;
if (!sig.trigger(evloop))
logError("Failed to trigger ManualEvent: %s", delegate string() => sig.error());
}
{
{
Array!(void*)[] a = (&__r7322._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
{
{
Array!(void*)[] a = (&__aggr7321._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
}
}
_d_monitorexit(__sync7318);
}
catch(Throwable __o7315)
{
halt;
}
}
override @trusted void wait()
{
this.wait(this.m_emitCount);
}
override @trusted int wait(int reference_emit_count)
{
return this.doWait(reference_emit_count);
}
override @trusted int wait(Duration timeout, int reference_emit_count)
{
return this.doWait(timeout, reference_emit_count);
}
override nothrow @trusted int waitUninterruptible(int reference_emit_count)
{
return this.doWait(reference_emit_count);
}
override nothrow @trusted int waitUninterruptible(Duration timeout, int reference_emit_count)
{
return this.doWait(timeout, reference_emit_count);
}
@trusted void acquire()
{
Task task = getThis();
bool signal_exists = false;
ulong instance = (in LibasyncManualEvent this = this;) , atomicLoad(this.m_instance);
if ((((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU) <= instance)
this.expandWaiters();
logTrace("Acquire event ID#%d", delegate ulong() => instance);
Array!(Task) taskList = (ref Array!(Task) this = taskList = ((ulong i = instance;) , ((ref inout(Array!(Task)) __inlineretval15626 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval15626));) , this._data.__postblit();
try
{
if ((((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = taskList._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = taskList._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU) > 0LU)
signal_exists = true;
if (!signal_exists)
{
shared shared(AsyncSignal) sig = new shared(AsyncSignal)(getMainEventLoop());
sig.run(&this.onSignal);
Mutex __sync7328 = this.m_mutex;
_d_monitorenter(__sync7328);
this.ms_signals.insertBack(cast(void*)sig);
_d_monitorexit(__sync7328);
}
((ulong i = instance;) , ((ref inout(Array!(Task)) __inlineretval15629 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval15629)).insertBack(getThis());
}
finally
{
{
taskList._data.~this();
}
}
}
@trusted void release()
{
assert(this.amOwner(), "Releasing non-acquired signal.");
import std.algorithm : countUntil;
ulong instance = (in LibasyncManualEvent this = this;) , atomicLoad(this.m_instance);
Array!(Task) taskList = (ref Array!(Task) this = taskList = ((ulong i = instance;) , ((ref inout(Array!(Task)) __inlineretval15630 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval15630));) , this._data.__postblit();
try
{
long idx = countUntil(taskList.opSlice(), getThis());
logTrace("Release event ID#%d", delegate ulong() => instance);
(RangeT!(Array!(Task)) __tmpfordtor7339 = ((ulong i = instance;) , ((ref inout(Array!(Task)) __inlineretval15631 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval15631)).linearRemove(taskList.opSlice(cast(ulong)idx, cast(ulong)(idx + 1L)));) , __tmpfordtor7339;
if ((ulong i = instance;) , ((ref inout(Array!(Task)) __inlineretval15632 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];)) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval15632._data;) , ((ref inout(RefCountedStore) __inlineretval15633 = this._refCounted;)) , __inlineretval15633._store !is null) || ((const(Task[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval15632._data;) , ((ref inout(Payload) __inlineretval15634 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15634))._payload;) , !a.length))
{
this.removeMySignal();
}
}
finally
{
{
taskList._data.~this();
}
}
}
@trusted bool amOwner()
{
import std.algorithm : countUntil;
ulong instance = (in LibasyncManualEvent this = this;) , atomicLoad(this.m_instance);
if ((((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU) <= instance)
return false;
Array!(Task) taskList = (ref Array!(Task) this = taskList = ((ulong i = instance;) , ((ref inout(Array!(Task)) __inlineretval15635 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval15635));) , this._data.__postblit();
try
{
if ((((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = taskList._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = taskList._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU) == 0LU)
return false;
long idx = countUntil(taskList.opSlice(), getThis());
return idx != -1L;
}
finally
{
{
taskList._data.~this();
}
}
}
override const nothrow @property @trusted int emitCount()
{
return atomicLoad(this.m_emitCount);
}
private int doWait(bool INTERRUPTIBLE)(int reference_emit_count)
{
try
{
assert(!amOwner());
acquire();
scope(exit) release();
auto ec = this.emitCount;
while (ec == reference_emit_count)
{
static if (INTERRUPTIBLE)
{
getDriverCore().yieldForEvent();
}
else
{
getDriverCore().yieldForEventDeferThrow();
}
ec = this.emitCount;
}
return ec;
}
catch(Exception e)
{
static if (!INTERRUPTIBLE)
{
assert(false, e.msg);
}
else
{
throw e;
}
}
}
private int doWait(bool INTERRUPTIBLE)(Duration timeout, int reference_emit_count)
{
static if (!INTERRUPTIBLE)
{
scope(failure) assert(false);
}
assert(!amOwner());
acquire();
scope(exit) release();
auto tm = getEventDriver().createTimer(null);
scope(exit) getEventDriver().releaseTimer(tm);
getEventDriver().m_timers.getUserData(tm).owner = Task.getThis();
getEventDriver().rearmTimer(tm, timeout, false);
auto ec = this.emitCount;
while (ec == reference_emit_count)
{
static if (INTERRUPTIBLE)
{
getDriverCore().yieldForEvent();
}
else
{
getDriverCore().yieldForEventDeferThrow();
}
ec = this.emitCount;
if (!getEventDriver().isTimerPending(tm))
break;
}
return ec;
}
private @trusted void removeMySignal()
{
import std.algorithm : countUntil;
Mutex __sync7342 = this.m_mutex;
_d_monitorenter(__sync7342);
try
{
{
long idx = countUntil(this.ms_signals.opSlice(), this);
(RangeT!(Array!(void*)) __tmpfordtor7350 = this.ms_signals.linearRemove(this.ms_signals.opSlice(cast(ulong)idx, cast(ulong)(idx + 1L)));) , __tmpfordtor7350;
}
}
finally
{
_d_monitorexit(__sync7342);
}
}
private @trusted void expandWaiters()
{
ulong maxID = 0LU;
Mutex __sync7351 = gs_mutex;
_d_monitorenter(__sync7351);
maxID = gs_maxID;
_d_monitorexit(__sync7351);
s_eventWaiters.reserve(maxID);
logTrace("gs_maxID: %d", delegate ulong() => maxID);
ulong s_ev_len = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU;
ulong s_ev_cap = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval15636 = this._refCounted;)) , __inlineretval15636._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval15637 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15637))._capacity : 0LU;
assert(maxID > (((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU));
{
ulong __key7359 = s_ev_len;
ulong __limit7360 = s_ev_cap;
for (; __key7359 < __limit7360; __key7359 += 1LU)
{
ulong i = __key7359;
s_eventWaiters.insertBack(Array(RefCounted(RefCountedStore(null))));
}
}
}
private @trusted void onSignal()
{
{
string fmt = "Got signal in onSignal";
log(fmt);
}
{
Thread thread = sm_this;
DriverCore core = assert(s_driverCore !is null) , s_driverCore;
ulong instance = (in LibasyncManualEvent this = this;) , atomicLoad(this.m_instance);
logTrace("Got context: %d", delegate ulong() => instance);
{
RangeT!(Array!(Task)) __aggr7371 = ((ulong i = instance;) , ((ref inout(Array!(Task)) __inlineretval15638 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = s_eventWaiters._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval15638)).opSlice();
RangeT!(Array!(Task)) __r7372 = __aggr7371.opSlice();
for (; !(__r7372._a >= __r7372._b); cast(void)(assert(!((ref RangeT!(Array!(Task)) this = __r7372;) , this._a >= this._b), "Attempting to popFront an empty Array") , __r7372._a += 1LU))
{
Task task = (ref inout(Task) __inlineretval15639 = assert(!((ref inout(RangeT!(Array!(Task))) this = __r7372;) , this._a >= this._b), "Attempting to access the front of an empty Array") , ((inout ref inout(Array!(Task)) __dop4927 = (ref inout(RangeT!(Array!(Task))) this = __r7372;) , ((ref inout(Array!(Task)) __inlineretval14675 = this._outer_[0];) , __inlineretval14675);)) , ((ulong i = __r7372._a;) , ((ref inout(Task) __inlineretval14678 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4927._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4927._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval14678));) , __inlineretval15639;
{
string fmt = "Task Found";
log(fmt);
}
core.resumeTask(task, null);
}
{
{
Array!(Task)[] a = (&__r7372._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
{
{
Array!(Task)[] a = (&__aggr7371._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
}
}
}
}
~this()
{
{
ref Array!(void*) this = this.ms_signals;
this._data.~this();
}
}
~this()
{
this.~this();
{
in LibasyncManualEvent this = this;
{
ref Array!(void*) this = this.ms_signals;
this._data.~this();
}
}
}
alias __xdtor = ~this()
{
this.~this();
{
in LibasyncManualEvent this = this;
{
ref Array!(void*) this = this.ms_signals;
this._data.~this();
}
}
}
;
}
final class LibasyncTCPListener : Object, TCPListener
{
@trusted
{
private
{
@trusted NetworkAddress m_local;
@trusted void delegate(TCPConnection conn) @safe m_connectionCallback;
@trusted TCPListenOptions m_options;
@trusted AsyncTCPListener[] m_listeners;
@trusted int socket;
}
@trusted this(NetworkAddress addr, void delegate(TCPConnection conn) @safe connection_callback, TCPListenOptions options)
{
this.m_connectionCallback = connection_callback;
this.m_options = options;
this.m_local = addr;
void function(shared(LibasyncTCPListener)) init = function (shared(LibasyncTCPListener) ctxt)
{
shared shared(LibasyncTCPListener) __sync7379 = ctxt;
_d_monitorenter(__sync7379);
try
{
{
LibasyncTCPListener ctxt2 = ctxt;
AsyncTCPListener listener = new AsyncTCPListener(getMainEventLoop(), ctxt2.socket);
listener.local(ctxt2.m_local.opCast());
enforce(listener.run(cast(void delegate(TCPEvent) delegate(AsyncTCPConnection))&ctxt2.initConnection), delegate const(char)[]() => "Failed to start listening to local socket: " ~ listener.error(), "core/vibe/core/drivers/libasync.d", 1028LU);
ctxt2.socket = listener.socket();
ctxt2.m_listeners ~= listener;
}
}
finally
{
_d_monitorexit(__sync7379);
}
}
;
if (options & TCPListenOptions.distribute)
{
(void function(shared(LibasyncTCPListener)) func = init;) , ((shared(LibasyncTCPListener) _param_1 = this;));
unrolled {
{
alias T = shared(LibasyncTCPListener);
}
}
{
(ref void function(shared(LibasyncTCPListener)) callable = func;) , ((ref shared(LibasyncTCPListener) _param_1 = _param_1;));
alias FARGS = (shared(LibasyncTCPListener));
setupWorkerThreads(cast(uint)get_nprocs());
TaskFuncInfo tfi = makeTaskFuncInfo(callable, _param_1);
Mutex __sync7385 = st_threadsMutex;
_d_monitorenter(__sync7385);
{
{
ThreadContext[] __r7386 = st_threads[];
ulong __key7387 = 0LU;
for (; __key7387 < __r7386.length; __key7387 += 1LU)
{
ref ThreadContext ctx = __r7386[__key7387];
if (ctx.isWorker)
ctx.taskQueue ~= tfi;
}
}
}
_d_monitorexit(__sync7385);
st_threadsSignal.emit();
}
}
else
(*init)(this);
return this;
}
override @property @trusted NetworkAddress bindAddress()
{
return this.m_local;
}
@property @trusted void delegate(TCPConnection) connectionCallback()
{
return cast(void delegate(TCPConnection))this.m_connectionCallback;
}
private @trusted void delegate(TCPEvent) initConnection(AsyncTCPConnection conn)
{
{
string fmt = "Connection initialized in thread: " ~ sm_this.name();
log(fmt);
}
LibasyncTCPConnection native_conn = new LibasyncTCPConnection(conn, this.m_connectionCallback);
native_conn.m_tcpImpl.conn = conn;
native_conn.m_tcpImpl.localAddr = this.m_local;
return &native_conn.handler;
}
override @trusted void stopListening()
{
LibasyncTCPListener __sync7390 = this;
_d_monitorenter(__sync7390);
{
{
AsyncTCPListener[] __r7391 = this.m_listeners[];
ulong __key7392 = 0LU;
for (; __key7392 < __r7391.length; __key7392 += 1LU)
{
AsyncTCPListener listener = __r7391[__key7392];
listener.kill();
listener = null;
}
}
}
_d_monitorexit(__sync7390);
}
}
}
final class LibasyncTCPConnection : Object, TCPConnection
{
@trusted
{
private
{
@trusted FixedRingBuffer!(ubyte, 0LU, true) m_readBuffer;
@trusted ubyte[] m_buffer;
@trusted ubyte[] m_slice;
@trusted TCPConnectionImpl m_tcpImpl;
@trusted Settings m_settings;
@trusted bool m_closed = true;
@trusted bool m_mustRecv = true;
@trusted string m_error;
}
@trusted ubyte[] readChunk(ubyte[] buffer = null)
{
logTrace("readBuf TCP: %d", delegate ulong() => buffer.length);
import std.algorithm : swap;
ubyte[] ret = null;
if (this.m_slice.length > 0LU)
{
swap(ret, this.m_slice);
logTrace("readBuf returned instantly with slice length: %d", delegate ulong() => ret.length);
return ret;
}
if (((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill) > 0LU)
{
ulong amt = (ulong _param_0 = buffer.length;) , ((ulong _param_1 = (ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill;)) , (alias a = ulong _param_0;
;
, (alias T0 = ulong;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref ulong a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1);
this.m_readBuffer.read(buffer[0..amt]);
logTrace("readBuf returned with existing amount: %d", delegate ulong() => amt);
return buffer[0..amt];
}
if (buffer)
{
this.m_buffer = buffer;
{
ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;
delete this.m_buffer;
this.m_buffer = null;
this.m_start = (this.m_fill = 0LU);
}
}
this.leastSize();
swap(ret, this.m_slice);
logTrace("readBuf returned with buffered length: %d", delegate ulong() => ret.length);
return ret;
}
@trusted this(AsyncTCPConnection conn, void delegate(TCPConnection) @safe cb)
in
{
assert(conn !is null);
}
body
{
this.m_settings.onConnect = cast(void delegate(TCPConnection) @trusted)cb;
{
ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;
ulong new_size = 65536LU;
if (this.m_buffer.length)
{
ubyte[] newbuffer = new ubyte[](new_size);
ubyte[] dst = newbuffer;
ulong newfill = (ulong _param_0 = this.m_fill;) , ((ulong _param_1 = new_size;)) , (alias a = ulong _param_0;
;
, (alias T0 = ulong;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref ulong a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1);
this.read(dst[0..newfill]);
this.m_buffer = newbuffer;
this.m_start = 0LU;
this.m_fill = newfill;
}
else
{
this.m_buffer = new ubyte[](new_size);
}
}
return this;
}
private @property @trusted AsyncTCPConnection conn()
{
return this.m_tcpImpl.conn;
}
override @property @trusted void tcpNoDelay(bool enabled)
{
this.m_settings.tcpNoDelay = enabled;
((in LibasyncTCPConnection this = this;) , this.m_tcpImpl.conn).setOption(TCPOption.NODELAY, enabled);
}
override const @property @trusted bool tcpNoDelay()
{
return this.m_settings.tcpNoDelay;
}
override @property @trusted void readTimeout(Duration dur)
{
this.m_settings.readTimeout = dur;
((in LibasyncTCPConnection this = this;) , this.m_tcpImpl.conn).setOption(TCPOption.TIMEOUT_RECV, dur);
}
override const @property @trusted Duration readTimeout()
{
return this.m_settings.readTimeout;
}
override @property @trusted void keepAlive(bool enabled)
{
this.m_settings.keepAlive = enabled;
((in LibasyncTCPConnection this = this;) , this.m_tcpImpl.conn).setOption(TCPOption.KEEPALIVE_ENABLE, enabled);
}
override const @property @trusted bool keepAlive()
{
return this.m_settings.keepAlive;
}
override const @property @trusted bool connected()
{
return !this.m_closed && this.m_tcpImpl.conn && ((in const(AsyncTCPConnection) this = this.m_tcpImpl.conn;) , this.m_socket != 0);
}
override @property @trusted bool dataAvailableForRead()
{
{
string fmt = "dataAvailableForRead";
log(fmt);
}
this.m_settings.reader.acquire();
try
{
return !((in LibasyncTCPConnection this = this;) , this.m_buffer && !this.m_slice || !this.m_buffer && ((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill == 0LU));
}
finally
{
this.m_settings.reader.release();
}
}
private @property @trusted bool readEmpty()
{
return this.m_buffer && !this.m_slice || !this.m_buffer && ((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill == 0LU);
}
override const @property @trusted string peerAddress()
{
return ((in const(AsyncTCPConnection) this = this.m_tcpImpl.conn;) , ((NetworkAddress __inlineretval15640 = this.m_peer;) , __inlineretval15640)).toString();
}
override const @property @trusted NetworkAddress localAddress()
{
return this.m_tcpImpl.localAddr;
}
override const @property @trusted NetworkAddress remoteAddress()
{
return NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , , ).this(((in const(AsyncTCPConnection) this = this.m_tcpImpl.conn;) , ((NetworkAddress __inlineretval15641 = this.m_peer;) , __inlineretval15641)));
}
override @property @trusted bool empty()
{
return this.leastSize() == 0LU;
}
override @property @trusted ulong leastSize()
{
{
string fmt = "leastSize TCP";
log(fmt);
}
this.m_settings.reader.acquire();
try
{
for (; (ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill == 0LU;)
{
{
if (!((in LibasyncTCPConnection this = this;) , !this.m_closed && this.m_tcpImpl.conn && ((in const(AsyncTCPConnection) this = this.m_tcpImpl.conn;) , this.m_socket != 0)))
return 0LU;
this.m_settings.reader.noExcept = true;
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
this.m_settings.reader.noExcept = false;
}
}
return this.m_slice.length > 0LU ? this.m_slice.length : ((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill);
}
finally
{
this.m_settings.reader.release();
}
}
override @trusted void close()
{
{
string fmt = "Close TCP enter";
log(fmt);
}
Task reader = this.m_settings.reader.task;
for (; this.m_settings.reader.isWaiting && reader.running();)
{
{
{
string fmt = "resuming reader first";
log(fmt);
}
(assert(s_driverCore !is null) , s_driverCore).yieldAndResumeTask(reader, null);
}
}
if (this.m_closed)
{
{
string fmt = "connection already closed.";
log(fmt);
}
return ;
}
this.m_settings.writer.acquire();
try
{
{
ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;
delete this.m_buffer;
this.m_buffer = null;
this.m_start = (this.m_fill = 0LU);
}
this.onClose(null, false);
}
finally
{
this.m_settings.writer.release();
}
}
override @trusted bool waitForData(Duration timeout = max())
{
if (timeout is ((long length = 0L;) , ((Duration __inlineretval15642 = (ref Duration this = Duration(0L);) , ((long hnsecs = (long value = length;) , 10000000L * value / 1L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval15642)))
timeout = ((Duration __inlineretval15643 = (ref Duration this = Duration(0L);) , ((long hnsecs = 9223372036854775807L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval15643);
logTrace("WaitForData enter, timeout %s :: Ptr %s", delegate string() => timeout.toString(), delegate string() => to(cast(void*)this));
this.m_settings.reader.acquire();
LibasyncDriver _driver = (bool ignore_unloaded = false;) , (assert(ignore_unloaded || s_driver !is null, "No event driver loaded. Did the vibe.core.core module constructor run?") , s_driver);
ulong tm = (void delegate() @safe callback = cast(void delegate() @safe)null;) , _driver.m_timers.create(((ref TimerInfo this = TimerInfo(1LU, null, Task(null, 0LU));) , ((void delegate() callback = cast(void delegate())callback;)) , (this.callback = callback , this)));
try
{
((ref TimerQueue!(TimerInfo, 10000L) this = _driver.m_timers;) , ((ulong timer_id = tm;)) , ((ref inout(TimerInfo) __inlineretval15644 = ((ref inout(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15516 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15516)).data;) , __inlineretval15644)).owner = getThis();
if (timeout !is ((Duration __inlineretval15645 = (ref Duration this = Duration(0L);) , ((long hnsecs = 9223372036854775807L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval15645))
_driver.rearmTimer(tm, timeout, false);
{
string fmt = "waitForData TCP";
log(fmt);
}
for (; (ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill == 0LU;)
{
{
if (!((in LibasyncTCPConnection this = this;) , !this.m_closed && this.m_tcpImpl.conn && ((in const(AsyncTCPConnection) this = this.m_tcpImpl.conn;) , this.m_socket != 0)))
return false;
if (this.m_mustRecv)
this.onRead();
else
{
this.m_settings.reader.noExcept = true;
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
this.m_settings.reader.noExcept = false;
}
if (timeout !is ((Duration __inlineretval15646 = (ref Duration this = Duration(0L);) , ((long hnsecs = 9223372036854775807L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval15646) && !((ulong timer_id = tm;) , ((ref TimerQueue!(TimerInfo, 10000L) this = _driver.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , this.m_length) > 0LU && ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15519 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15519)).pending)))
{
{
string fmt = "WaitForData TCP: timer signal";
log(fmt);
}
return false;
}
}
}
if (((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill == 0LU) && !((in LibasyncTCPConnection this = this;) , !this.m_closed && this.m_tcpImpl.conn && ((in const(AsyncTCPConnection) this = this.m_tcpImpl.conn;) , this.m_socket != 0)))
return false;
{
string fmt = "WaitForData exit: fiber resumed with read buffer";
log(fmt);
}
return !((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill == 0LU);
}
finally
{
{
_driver.stopTimer(tm);
_driver.releaseTimer(tm);
this.m_settings.reader.release();
}
}
}
override @trusted const(ubyte)[] peek()
{
{
string fmt = "Peek TCP enter";
log(fmt);
}
this.m_settings.reader.acquire();
try
{
if (!((in LibasyncTCPConnection this = this;) , this.m_buffer && !this.m_slice || !this.m_buffer && ((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill == 0LU)))
return this.m_slice.length > 0LU ? this.m_slice : ((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_buffer[this.m_start..((inout(ulong) _param_0 = this.m_start + this.m_fill;) , ((ulong _param_1 = this.m_buffer.length;)) , (alias a = inout inout(ulong) _param_0;
;
, (alias T0 = inout(ulong);
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref inout(ulong) a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1))]);
else
return null;
}
finally
{
this.m_settings.reader.release();
}
}
override @trusted ulong read(scope ubyte[] dst, IOMode _param_1)
{
if (!dst.length)
return 0LU;
assert(dst !is null && !this.m_slice);
{
string fmt = "Read TCP";
log(fmt);
}
this.m_settings.reader.acquire();
ulong len = 0LU;
try
{
for (; dst.length > 0LU;)
{
{
for (; (ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill == 0LU;)
{
{
this.checkConnected();
if (this.m_mustRecv)
this.onRead();
else
{
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
this.checkConnected();
}
}
}
ulong amt = (ulong _param_0 = dst.length;) , ((ulong _param_1 = (ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_fill;)) , (alias a = ulong _param_0;
;
, (alias T0 = ulong;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref ulong a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1);
this.m_readBuffer.read(dst[0..amt]);
dst = dst[amt..__dollar];
len += amt;
}
}
return len;
}
finally
{
this.m_settings.reader.release();
}
}
override @trusted ulong write(const(ubyte[]) bytes_, IOMode _param_1)
{
assert(bytes_ !is null);
logTrace("%s", delegate string() => "write enter");
this.m_settings.writer.acquire();
try
{
this.checkConnected();
const(ubyte)[] bytes = bytes_;
logTrace("TCP write with %s bytes called", delegate ulong() => bytes.length);
bool first = true;
ulong offset = 0LU;
ulong len = bytes.length;
do
{
if (!first)
{
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
}
this.checkConnected();
offset += cast(ulong)((in LibasyncTCPConnection this = this;) , ((in AsyncTCPConnection this = this.m_tcpImpl.conn;)) , ((const(ubyte[]) ub = bytes[offset..__dollar];)) , ((uint ret = (in EventLoop this = this.m_evLoop;) , ((const(int) fd = this.m_socket;) , ((const(ubyte[]) data = ub;))) , this.m_evLoop.send(fd, data);) , cast(int)((in EventLoop this = this.m_evLoop;) , ((StatusInfo __inlineretval16096 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16096)).code == 1 && ((in AsyncTCPConnection this = this;) , ((bool b = true;)) , this.m_impl.writeBlocked = b) , ret));
if ((in LibasyncTCPConnection this = this;) , ((in AsyncTCPConnection this = this.m_tcpImpl.conn;)) , cast(int)((in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16097 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16097)).code != 0 && cast(int)((in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16098 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16098)).code != 1)
{
throw new Exception(this.conn().error(), "core/vibe/core/drivers/libasync.d", 1309LU, null);
}
first = false;
}
while (offset != len);
return len;
}
finally
{
this.m_settings.writer.release();
}
}
override @trusted void flush()
{
logTrace("%s", delegate string() => "Flush");
this.m_settings.writer.acquire();
try
{
this.checkConnected();
}
finally
{
this.m_settings.writer.release();
}
}
override @trusted void finalize()
{
logTrace("%s", delegate string() => "finalize");
this.flush();
}
private @trusted void checkConnected()
{
enforce(((in LibasyncTCPConnection this = this;) , !this.m_closed && this.m_tcpImpl.conn && ((in const(AsyncTCPConnection) this = this.m_tcpImpl.conn;) , this.m_socket != 0)), delegate const(char)[]() => "The remote peer has closed the connection.", "core/vibe/core/drivers/libasync.d", 1335LU);
{
string fmt = "Check Connected";
log(fmt);
}
}
private @trusted bool tryReadBuf()
{
if (this.m_buffer)
{
ubyte[] buf = this.m_buffer[this.m_slice.length..__dollar];
uint ret = (in LibasyncTCPConnection this = this;) , ((in AsyncTCPConnection this = this.m_tcpImpl.conn;)) , ((ref ubyte[] ub = buf;)) , ((in EventLoop this = this.m_evLoop;) , ((const(int) fd = this.m_socket;) , ((ubyte[] data = ub;))) , this.m_evLoop.recv(fd, data));
logTrace("Received: %s", delegate ubyte[]() => buf[0..cast(ulong)ret]);
if (cast(ulong)ret == buf.length)
{
{
string fmt = "Overflow detected, revert to ring buffer";
log(fmt);
}
this.m_slice = null;
{
ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;
ulong new_size = 65536LU;
if (this.m_buffer.length)
{
ubyte[] newbuffer = new ubyte[](new_size);
ubyte[] dst = newbuffer;
ulong newfill = (ulong _param_0 = this.m_fill;) , ((ulong _param_1 = new_size;)) , (alias a = ulong _param_0;
;
, (alias T0 = ulong;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref ulong a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1);
this.read(dst[0..newfill]);
this.m_buffer = newbuffer;
this.m_start = 0LU;
this.m_fill = newfill;
}
else
{
this.m_buffer = new ubyte[](new_size);
}
}
this.m_readBuffer.put(buf);
this.m_buffer = null;
return false;
}
if (this.m_slice.length > 0LU)
{
this.m_slice = (cast(ubyte*)this.m_slice)[0..this.m_slice.length + cast(ulong)ret];
}
else
{
this.m_slice = this.m_buffer[0..cast(ulong)ret];
}
return true;
}
logTrace("TryReadBuf exit with %d bytes in m_slice, %d bytes in m_readBuffer ", delegate ulong() => this.m_slice.length, delegate ulong() => this.m_readBuffer.length());
return false;
}
private @trusted void onRead()
{
this.m_mustRecv = true;
if (this.tryReadBuf())
{
this.m_mustRecv = false;
return ;
}
assert(!this.m_slice);
logTrace("OnRead with %s", delegate ulong() => this.m_readBuffer.freeSpace());
for (; ((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_buffer.length - this.m_fill) > 0LU;)
{
{
ubyte[] dst = (ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_start + this.m_fill < this.m_buffer.length ? this.m_buffer[this.m_start + this.m_fill..__dollar] : this.m_buffer[((ref FixedRingBuffer!(ubyte, 0LU, true) this = this;) , ((ulong n = this.m_start + this.m_fill;)) , n % this.m_buffer.length)..this.m_start];
assert(dst.length <= 2147483647LU);
logTrace("Try to read up to bytes: %s", delegate ulong() => dst.length);
bool read_more = false;
do
{
uint ret = (in LibasyncTCPConnection this = this;) , ((in AsyncTCPConnection this = this.m_tcpImpl.conn;)) , ((ref ubyte[] ub = dst;)) , ((in EventLoop this = this.m_evLoop;) , ((const(int) fd = this.m_socket;) , ((ubyte[] data = ub;))) , this.m_evLoop.recv(fd, data));
if (ret > 0u)
{
logTrace("received bytes: %s", delegate uint() => ret);
{
ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;
ulong n = cast(ulong)ret;
assert(this.m_fill + n <= this.m_buffer.length);
this.m_fill += n;
}
}
read_more = cast(ulong)ret == dst.length;
if (read_more)
{
if (((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_buffer.length - this.m_fill) == 0LU)
{
ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;
ulong new_size = ((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_buffer.length) * 2LU;
if (this.m_buffer.length)
{
ubyte[] newbuffer = new ubyte[](new_size);
ubyte[] dst = newbuffer;
ulong newfill = (ulong _param_0 = this.m_fill;) , ((ulong _param_1 = new_size;)) , (alias a = ulong _param_0;
;
, (alias T0 = ulong;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref ulong a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1);
this.read(dst[0..newfill]);
this.m_buffer = newbuffer;
this.m_start = 0LU;
this.m_fill = newfill;
}
else
{
this.m_buffer = new ubyte[](new_size);
}
}
dst = ((ref FixedRingBuffer!(ubyte, 0LU, true) this = this.m_readBuffer;) , this.m_start + this.m_fill < this.m_buffer.length ? this.m_buffer[this.m_start + this.m_fill..__dollar] : this.m_buffer[((ref FixedRingBuffer!(ubyte, 0LU, true) this = this;) , ((ulong n = this.m_start + this.m_fill;)) , n % this.m_buffer.length)..this.m_start]);
}
}
while (read_more);
if (cast(int)((in LibasyncTCPConnection this = this;) , ((in AsyncTCPConnection this = this.m_tcpImpl.conn;)) , ((StatusInfo __inlineretval16100 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16099 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16099);) , __inlineretval16100)).code == 1)
{
this.m_mustRecv = false;
break;
}
else if (cast(int)((in LibasyncTCPConnection this = this;) , ((in AsyncTCPConnection this = this.m_tcpImpl.conn;)) , ((StatusInfo __inlineretval16101 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16099 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16099);) , __inlineretval16101)).code == 1)
{
this.m_mustRecv = false;
break;
}
else if (cast(int)((in LibasyncTCPConnection this = this;) , ((in AsyncTCPConnection this = this.m_tcpImpl.conn;)) , ((StatusInfo __inlineretval16102 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16099 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16099);) , __inlineretval16102)).code != 0)
{
string err = (in LibasyncTCPConnection this = this;) , ((in AsyncTCPConnection this = this.m_tcpImpl.conn;)) , ((in const(EventLoop) this = this.m_evLoop;) , ((ref const(EventLoopImpl) this = this.m_evLoop;) , ((string* ptr = null;) , (ptr = this.m_error in EPosixMessages) !is null ? *ptr : null)));
logTrace("receive error %s %s", delegate string() => err, delegate Status() => this.conn().status().code);
throw new Exception("Socket error: " ~ to(this.conn().status().code), "core/vibe/core/drivers/libasync.d", 1415LU, null);
}
else
{
this.m_mustRecv = false;
break;
}
}
}
logTrace("OnRead exit with free bytes: %s", delegate ulong() => this.m_readBuffer.freeSpace());
}
private @trusted void onClose(const(string) msg = null, bool wake_ex = true)
{
{
string fmt = "onClose";
log(fmt);
}
if (msg)
this.m_error = msg;
if (!this.m_closed)
{
this.m_closed = true;
if (this.m_tcpImpl.conn && ((in AsyncTCPConnection this = this.m_tcpImpl.conn;) , this.m_socket != 0))
{
this.m_tcpImpl.conn.kill(!getThis().opEquals(Task(null, 0LU)));
this.m_tcpImpl.conn = null;
}
}
if (!getThis().opEquals(Task(null, 0LU)))
{
return ;
}
Exception ex = null;
if (!msg && wake_ex)
ex = new Exception("Connection closed", "core/vibe/core/drivers/libasync.d", 1447LU, null);
else if (wake_ex)
ex = new Exception(msg, "core/vibe/core/drivers/libasync.d", 1448LU, null);
Task reader = this.m_settings.reader.task;
Task writer = this.m_settings.writer.task;
bool hasUniqueReader = this.m_settings.reader.isWaiting;
bool hasUniqueWriter = this.m_settings.writer.isWaiting && !((ref const(Task) other = writer;) , reader.m_fiber is other.m_fiber && reader.m_taskCounter == other.m_taskCounter);
if (hasUniqueWriter && !getThis().opEquals(writer) && wake_ex)
{
(assert(s_driverCore !is null) , s_driverCore).resumeTask(writer, ex);
}
if (hasUniqueReader && !getThis().opEquals(reader))
{
(assert(s_driverCore !is null) , s_driverCore).resumeTask(reader, this.m_settings.reader.noExcept ? null : ex);
}
}
@trusted void onConnect()
{
try
{
if (this.m_tcpImpl.conn && ((in AsyncTCPConnection this = this.m_tcpImpl.conn;) , this.m_socket != 0))
{
bool inbound = (in AsyncTCPConnection this = this.m_tcpImpl.conn;) , this.m_inbound;
try
this.m_settings.onConnect(cast(TCPConnection)this);
catch(Exception e)
{
throw e;
}
catch(Throwable e)
{
logError("%s", delegate string() => e.toString());
throw e;
}
if (inbound)
this.close();
}
{
string fmt = "Finished callback";
log(fmt);
}
}
catch(Throwable __o7659)
{
this.onClose(null, true);
throw __o7659;
}
}
@trusted void handler(TCPEvent ev)
{
{
string fmt = "Handler";
log(fmt);
}
Exception ex = null;
final switch (cast(int)ev)
{
case 1:
{
this.m_closed = false;
if ((in AsyncTCPConnection this = this.m_tcpImpl.conn;) , this.m_inbound)
runTask(&this.onConnect);
else
this.onConnect();
this.m_settings.onConnect = cast(void delegate(TCPConnection) @trusted)null;
break;
}
case 2:
{
try
this.onRead();
catch(Exception e)
{
ex = e;
}
if (this.m_settings.reader.isWaiting)
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_settings.reader.task, ex);
goto case 3;
}
case 3:
{
if (this.m_settings.writer.isWaiting)
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_settings.writer.task, ex);
break;
}
case 4:
{
this.m_closed = false;
this.onClose(null, true);
if (this.m_settings.onConnect)
this.m_settings.onConnect(cast(TCPConnection)this);
this.m_settings.onConnect = cast(void delegate(TCPConnection) @trusted)null;
break;
}
case 0:
{
this.m_closed = false;
this.onClose(((in LibasyncTCPConnection this = this;) , ((in AsyncTCPConnection this = this.m_tcpImpl.conn;)) , ((in const(EventLoop) this = this.m_evLoop;) , ((ref const(EventLoopImpl) this = this.m_evLoop;) , ((string* ptr = null;) , (ptr = this.m_error in EPosixMessages) !is null ? *ptr : null)))), true);
if (this.m_settings.onConnect)
this.m_settings.onConnect(cast(TCPConnection)this);
this.m_settings.onConnect = cast(void delegate(TCPConnection) @trusted)null;
break;
}
}
return ;
}
struct Waiter
{
@trusted Task task;
@trusted bool isWaiting;
@trusted bool noExcept;
@trusted void acquire()
{
assert(!this.isWaiting, "Acquiring waiter that is already in use.");
if (getThis().opEquals(Task(null, 0LU)))
return ;
logTrace("%s", delegate string() => "Acquire waiter");
assert(!((ref Waiter this = this;) , this.isWaiting && ((ref const(Task) this = this.task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) ? true : false), "Failed to acquire waiter in task: " ~ ((TaskFiber _param_0 = getThis().fiber();) , ((TaskFiber value = _param_0;) , ((TaskFiber src = value;) , ((Appender!string w = (Appender!string __inlineretval14687 = Appender(null).this(null);) , __inlineretval14687;) , ((FormatSpec!char f = FormatSpec;)) , ((Appender!string w = w;) , ((TaskFiber val = src;)) , ((ref const(FormatSpec!char) f = f;)) , (enforceValidFormatSpec(f) , val is null ? (ref Appender!string r = w;) , ((string e = "null";)) , ((ref Appender!string r = r;) , ((ref string e = e;)) , ((enum bool usingPut = true;) , r.put(e))) : ((ref Appender!string w = w;) , ((ref TaskFiber val = val;)) , ((ref const(FormatSpec!char) f = f;)) , ((ref Appender!string r = w;) , ((string e = val.toString();)) , ((ref Appender!string r = r;) , ((ref string e = e;)) , ((enum bool usingPut = true;) , r.put(e))))))) , w._data ? cast(string)(*w._data).arr : null)))) ~ ", it was busy with: " ~ ((Task _param_0 = this.task;) , ((Task value = _param_0;) , ((Task src = value;) , ((Appender!string w = (Appender!string __inlineretval14688 = Appender(null).this(null);) , __inlineretval14688;) , ((FormatSpec!char f = FormatSpec;)) , ((Appender!string w = w;) , ((ref Task val = src;)) , ((ref const(FormatSpec!char) f = f;)) , (enforceValidFormatSpec(f) , ((ref Appender!string w = w;) , ((ref Task val = val;)) , ((ref const(FormatSpec!char) f = f;)) , ((ref Appender!string r = w;) , ((string e = val.toString();)) , ((ref Appender!string r = r;) , ((ref string e = e;)) , ((enum bool usingPut = true;) , r.put(e))))))) , w._data ? cast(string)(*w._data).arr : null)))));
this.task = getThis();
this.isWaiting = true;
}
@trusted void release()
{
if (getThis().opEquals(Task(null, 0LU)))
return ;
logTrace("%s", delegate string() => "Release waiter");
assert(((ref Waiter this = this;) , this.isWaiting && ((ref const(Task) this = this.task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) ? true : false));
this.isWaiting = false;
}
const @trusted bool amOwner()
{
if (this.isWaiting && ((ref const(Task) this = this.task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter))
return true;
return false;
}
}
struct Settings
{
@trusted void delegate(TCPConnection) @trusted onConnect;
@trusted Duration readTimeout;
@trusted bool keepAlive;
@trusted bool tcpNoDelay;
@trusted Waiter reader;
@trusted Waiter writer;
}
struct TCPConnectionImpl
{
@trusted NetworkAddress localAddr;
@trusted AsyncTCPConnection conn;
}
}
}
int total_conn;
final class LibasyncUDPConnection : Object, UDPConnection
{
@trusted
{
private
{
@trusted Task m_task;
@trusted AsyncUDPSocket m_udpImpl;
@trusted bool m_canBroadcast;
@trusted NetworkAddress m_peer;
@trusted bool m_waiting;
}
private @property @trusted AsyncUDPSocket socket()
{
return this.m_udpImpl;
}
@trusted this(AsyncUDPSocket conn)
in
{
assert(conn !is null);
}
body
{
this.m_udpImpl = conn;
return this;
}
override const @property @trusted string bindAddress()
{
return ((in const(AsyncUDPSocket) this = this.m_udpImpl;) , ((NetworkAddress __inlineretval16103 = this.m_local;) , __inlineretval16103)).toAddressString();
}
override const @property @trusted NetworkAddress localAddress()
{
return NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , , ).this(((in const(AsyncUDPSocket) this = this.m_udpImpl;) , ((NetworkAddress __inlineretval16104 = this.m_local;) , __inlineretval16104)));
}
override const @property @trusted bool canBroadcast()
{
return this.m_canBroadcast;
}
override @property @trusted void canBroadcast(bool val)
{
((in LibasyncUDPConnection this = this;) , this.m_udpImpl).broadcast(val);
this.m_canBroadcast = val;
}
override @trusted void close()
{
((in LibasyncUDPConnection this = this;) , this.m_udpImpl).kill();
this.m_udpImpl = null;
}
@trusted bool amOwner()
{
return !((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter) && ((ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter);
}
@trusted void acquire()
{
assert(((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Trying to acquire a UDP socket that is currently owned.");
this.m_task = getThis();
}
@trusted void release()
{
assert(!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Trying to release a UDP socket that is not owned.");
assert(((ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Trying to release a foreign UDP socket.");
this.m_task = Task(null, 0LU);
}
override @trusted void connect(string host, ushort port)
{
NetworkAddress addr = ((bool ignore_unloaded = false;) , (assert(ignore_unloaded || s_driver !is null, "No event driver loaded. Did the vibe.core.core module constructor run?") , s_driver)).resolveHost(host, ((in LibasyncUDPConnection this = this;) , ((NetworkAddress __inlineretval16105 = NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , , ).this(((in const(AsyncUDPSocket) this = this.m_udpImpl;) , ((NetworkAddress __inlineretval16104 = this.m_local;) , __inlineretval16104)));)) , __inlineretval16105.addr.sa_family), true);
addr.port(port);
{
in LibasyncUDPConnection this = this;
NetworkAddress addr = addr;
this.m_peer = ((NetworkAddress __retvar16106 = void;) , (__retvar16106 = NetworkAddress , ((ushort val = (ref NetworkAddress this = addr;) , this.addr.sa_family;) , __retvar16106.addr.sa_family = cast(ushort)cast(ubyte)val) , (cast(ubyte*)&__retvar16106.addr)[0..cast(ulong)addr.sockAddrLen()] = (cast(ubyte*)((ref NetworkAddress this = addr;) , &this.addr))[0..cast(ulong)addr.sockAddrLen()] , __retvar16106));
}
}
override @trusted void connect(NetworkAddress addr)
{
this.m_peer = ((NetworkAddress __retvar16106 = void;) , (__retvar16106 = NetworkAddress , ((ushort val = (ref NetworkAddress this = addr;) , this.addr.sa_family;) , __retvar16106.addr.sa_family = cast(ushort)cast(ubyte)val) , (cast(ubyte*)&__retvar16106.addr)[0..cast(ulong)addr.sockAddrLen()] = (cast(ubyte*)((ref NetworkAddress this = addr;) , &this.addr))[0..cast(ulong)addr.sockAddrLen()] , __retvar16106));
}
override @trusted void send(const(ubyte[]) data, const(NetworkAddress*) peer_address = null)
{
assert(data.length <= 2147483647LU);
uint ret = 0u;
ulong retries = 3LU;
{
ulong __key7686 = 0LU;
ulong __limit7687 = retries;
for (; __key7686 < __limit7687; __key7686 += 1LU)
{
ulong i = __key7686;
if (peer_address)
{
NetworkAddress pa = (ref NetworkAddress this = *peer_address;) , (pa = NetworkAddress , ((ushort val = (ref NetworkAddress this = this;) , this.addr.sa_family;) , pa.addr.sa_family = cast(ushort)cast(ubyte)val) , (cast(ubyte*)&pa.addr)[0..cast(ulong)this.sockAddrLen()] = (cast(ubyte*)((ref NetworkAddress this = this;) , &this.addr))[0..cast(ulong)this.sockAddrLen()] , pa);
ret = ((in LibasyncUDPConnection this = this;) , ((in AsyncUDPSocket this = this.m_udpImpl;)) , ((const(ubyte[]) data = data;) , ((const(NetworkAddress) addr = pa;))) , ((in EventLoop this = this.m_evLoop;) , ((const(int) fd = this.m_socket;) , ((const(ubyte[]) data = data;)) , ((const(NetworkAddress) addr = addr;))) , this.m_evLoop.sendTo(fd, data, addr)));
}
else
{
ret = ((in LibasyncUDPConnection this = this;) , ((in AsyncUDPSocket this = this.m_udpImpl;)) , ((const(ubyte[]) data = data;) , ((const(NetworkAddress) addr = this.m_peer;))) , ((in EventLoop this = this.m_evLoop;) , ((const(int) fd = this.m_socket;) , ((const(ubyte[]) data = data;)) , ((const(NetworkAddress) addr = addr;))) , this.m_evLoop.sendTo(fd, data, addr)));
}
if (cast(int)((in LibasyncUDPConnection this = this;) , ((in AsyncUDPSocket this = this.m_udpImpl;)) , ((StatusInfo __inlineretval16108 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16107 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16107);) , __inlineretval16108)).code == 1)
{
this.m_waiting = true;
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
}
else
break;
}
}
logTrace("send ret: %s, %s", delegate uint() => ret, delegate string() => this.socket().status().text);
enforce(cast(int)((in LibasyncUDPConnection this = this;) , ((in AsyncUDPSocket this = this.m_udpImpl;)) , ((StatusInfo __inlineretval16109 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16107 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16107);) , __inlineretval16109)).code == 0, delegate const(char)[]() => "Error sending UDP packet: " ~ this.socket().status().text, "core/vibe/core/drivers/libasync.d", 1665LU);
enforce(cast(ulong)ret == data.length, delegate const(char)[]() => "Unable to send full packet.", "core/vibe/core/drivers/libasync.d", 1667LU);
}
override @trusted ubyte[] recv(ubyte[] buf = null, NetworkAddress* peer_address = null)
{
return this.recv(((Duration __inlineretval16110 = (ref Duration this = Duration(0L);) , ((long hnsecs = 9223372036854775807L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval16110), buf, peer_address);
}
override @trusted ubyte[] recv(Duration timeout, ubyte[] buf = null, NetworkAddress* peer_address = null)
{
ulong tm = 18446744073709551615LU;
LibasyncDriver m_driver = (bool ignore_unloaded = false;) , (assert(ignore_unloaded || s_driver !is null, "No event driver loaded. Did the vibe.core.core module constructor run?") , s_driver);
if (timeout !is ((Duration __inlineretval16111 = (ref Duration this = Duration(0L);) , ((long hnsecs = 9223372036854775807L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval16111) && timeout.opCmp(((long length = 0L;) , ((Duration __inlineretval16112 = (ref Duration this = Duration(0L);) , ((long hnsecs = (long value = length;) , 10000000L * value / 1L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval16112))) > 0)
{
tm = ((void delegate() @safe callback = cast(void delegate() @safe)null;) , m_driver.m_timers.create(((ref TimerInfo this = TimerInfo(1LU, null, Task(null, 0LU));) , ((void delegate() callback = cast(void delegate())callback;)) , (this.callback = callback , this))));
m_driver.rearmTimer(tm, timeout, false);
{
ulong timer_id = tm;
((ref TimerQueue!(TimerInfo, 10000L) this = m_driver.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15517 = ((ref inout(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15516 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15516)).data;) , __inlineretval15517)).refCount++;
}
}
{
in LibasyncUDPConnection this = this;
assert(((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Trying to acquire a UDP socket that is currently owned.");
this.m_task = getThis();
}
try
{
assert(buf.length <= 2147483647LU);
if (buf.length == 0LU)
buf.length = 65507LU;
NetworkAddress from = NetworkAddress;
{
ushort val = (in LibasyncUDPConnection this = this;) , ((NetworkAddress __inlineretval16113 = NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , , ).this(((in const(AsyncUDPSocket) this = this.m_udpImpl;) , ((NetworkAddress __inlineretval16104 = this.m_local;) , __inlineretval16104)));)) , __inlineretval16113.addr.sa_family;
from.addr.sa_family = cast(ushort)cast(ubyte)val;
}
for (; true;)
{
{
uint ret = (in LibasyncUDPConnection this = this;) , ((in AsyncUDPSocket this = this.m_udpImpl;)) , ((ref ubyte[] data = buf;) , ((ref NetworkAddress addr = from;))) , ((in EventLoop this = this.m_evLoop;) , ((const(int) fd = this.m_socket;) , ((ubyte[] data = data;)) , ((ref NetworkAddress addr = addr;))) , this.m_evLoop.recvFrom(fd, data, addr));
if (ret > 0u)
{
if (peer_address)
*peer_address = NetworkAddress(sockaddr(cast(ushort)0u, [cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0, cast(byte)0]), , , ).this(from);
return buf[0..cast(ulong)ret];
}
else if (cast(int)((in LibasyncUDPConnection this = this;) , ((in AsyncUDPSocket this = this.m_udpImpl;)) , ((StatusInfo __inlineretval16114 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16107 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16107);) , __inlineretval16114)).code != 0)
{
string err = ((in LibasyncUDPConnection this = this;) , ((in AsyncUDPSocket this = this.m_udpImpl;)) , ((StatusInfo __inlineretval16115 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16107 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16107);) , __inlineretval16115)).text;
logDebug("UDP recv err: %s", delegate string() => err);
enforce(cast(int)((in LibasyncUDPConnection this = this;) , ((in AsyncUDPSocket this = this.m_udpImpl;)) , ((StatusInfo __inlineretval16116 = (in const(EventLoop) this = this.m_evLoop;) , ((StatusInfo __inlineretval16107 = (ref const(EventLoopImpl) this = this.m_evLoop;) , ((const(StatusInfo) __inlineretval15567 = this.m_status;) , __inlineretval15567);) , __inlineretval16107);) , __inlineretval16116)).code == 1, delegate const(char)[]() => "Error receiving UDP packet", "core/vibe/core/drivers/libasync.d", 1704LU);
if (timeout !is ((Duration __inlineretval16117 = (ref Duration this = Duration(0L);) , ((long hnsecs = 9223372036854775807L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval16117))
{
enforce(timeout.opCmp(((long length = 0L;) , ((Duration __inlineretval16118 = (ref Duration this = Duration(0L);) , ((long hnsecs = (long value = length;) , 10000000L * value / 1L;)) , (this._hnsecs = hnsecs , this);) , __inlineretval16118))) > 0 && ((ulong timer_id = tm;) , ((ref TimerQueue!(TimerInfo, 10000L) this = m_driver.m_timers;) , ((ulong timer_id = timer_id;)) , ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , this.m_length) > 0LU && ((ref const(HashMap!(ulong, TimerInfo, DefaultHashMapTraits!ulong)) this = this.m_timers;) , ((ulong key = timer_id;)) , ((ref inout(TimerInfo) __inlineretval15519 = (ulong idx = this.findIndex(key);) , assert(idx != 18446744073709551615LU, "Accessing non-existent key.") , this.m_table[idx].value;) , __inlineretval15519)).pending)), delegate const(char)[]() => "UDP receive timeout.", "core/vibe/core/drivers/libasync.d", 1707LU);
}
}
this.m_waiting = true;
(assert(s_driverCore !is null) , s_driverCore).yieldForEvent();
}
}
}
finally
{
{
{
in LibasyncUDPConnection this = this;
assert(!((ref Task this = this.m_task;) , ((const(Task) other = Task(null, 0LU);)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Trying to release a UDP socket that is not owned.");
assert(((ref Task this = this.m_task;) , ((const(Task) other = getThis();)) , this.m_fiber is other.m_fiber && this.m_taskCounter == other.m_taskCounter), "Trying to release a foreign UDP socket.");
this.m_task = Task(null, 0LU);
}
if (tm != 18446744073709551615LU)
m_driver.releaseTimer(tm);
}
}
}
private @trusted void handler(UDPEvent ev)
{
logTrace("UDPConnection %p event", delegate LibasyncUDPConnection() => this);
Exception ex = null;
final switch (cast(int)ev)
{
case 1:
{
if (this.m_waiting)
{
this.m_waiting = false;
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_task, null);
}
break;
}
case 2:
{
if (this.m_waiting)
{
this.m_waiting = false;
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_task, null);
}
break;
}
case 0:
{
(assert(s_driverCore !is null) , s_driverCore).resumeTask(this.m_task, new Exception(this.socket().error(), "core/vibe/core/drivers/libasync.d", 1734LU, null));
break;
}
}
}
}
}
import std.container : Array;
Array!(Array!(Task)) s_eventWaiters;
__gshared Array!ulong gs_availID;
__gshared ulong gs_maxID;
__gshared Mutex gs_mutex;
private nothrow @trusted ulong generateID()
{
ulong idx = 0LU;
import std.algorithm : max;
try
{
@system ulong getIdx()
{
if (!(!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(RefCountedStore) __inlineretval16119 = this._refCounted;)) , __inlineretval16119._store !is null) || ((const(ulong[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(Payload) __inlineretval16120 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16120))._payload;) , !a.length)))
{
immutable immutable(ulong) ret = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(RefCountedStore) __inlineretval16121 = this._refCounted;)) , __inlineretval16121._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(Payload) __inlineretval16122 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16122))._payload[__dollar - 1LU];
gs_availID.removeBack();
return ret;
}
return 0LU;
}
Mutex __sync7727 = gs_mutex;
_d_monitorenter(__sync7727);
try
{
{
idx = !(!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(RefCountedStore) __inlineretval16119 = this._refCounted;)) , __inlineretval16119._store !is null) || ((const(ulong[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(Payload) __inlineretval16120 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16120))._payload;) , !a.length)) ? (immutable immutable(ulong) ret = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(RefCountedStore) __inlineretval16121 = this._refCounted;)) , __inlineretval16121._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(Payload) __inlineretval16122 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16122))._payload[__dollar - 1LU];) , gs_availID.removeBack() , ret : 0LU;
if (idx == 0LU)
{
import std.range : iota;
gs_availID.insertBack(iota(gs_maxID + 1LU, ((int _param_0 = 32;) , ((ulong _param_1 = gs_maxID * 2LU + 1LU;)) , (alias a = int _param_0;
;
, (alias T0 = int;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseB = (ref int a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < 0 || ((int a = a;) , ((ulong b = b;)) , (alias T = ulong;
, cast(ulong)a < b));) , result);)) , chooseB ? _param_1 : cast(ulong)_param_0)), 1));
gs_maxID = ((ulong __dollar = (ref const(Array!ulong) this = gs_availID;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU;) , ((ulong i = __dollar - 1LU;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i])));
idx = !(!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(RefCountedStore) __inlineretval16119 = this._refCounted;)) , __inlineretval16119._store !is null) || ((const(ulong[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(Payload) __inlineretval16120 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16120))._payload;) , !a.length)) ? (immutable immutable(ulong) ret = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(RefCountedStore) __inlineretval16121 = this._refCounted;)) , __inlineretval16121._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = gs_availID._data;) , ((ref inout(Payload) __inlineretval16122 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16122))._payload[__dollar - 1LU];) , gs_availID.removeBack() , ret : 0LU;
}
}
}
finally
{
_d_monitorexit(__sync7727);
}
}
catch(Exception e)
{
halt;
}
return idx - 1LU;
}
nothrow @trusted void recycleID(ulong id)
{
try
{
Mutex __sync7729 = gs_mutex;
_d_monitorenter(__sync7729);
gs_availID.insertBack(id + 1LU);
_d_monitorexit(__sync7729);
}
catch(Exception e)
{
halt;
}
}
}
static __gshared TypeInfo_Const _D78TypeInfo_xS3std9container5array39__T5ArrayTS8libasync7watcher9WatchInfoZ5Array6__initZ;
static __gshared TypeInfo_Const _D38TypeInfo_xS8libasync7watcher9WatchInfo6__initZ;
static __gshared TypeInfo_Const _D80TypeInfo_xG1S3std9container5array39__T5ArrayTS8libasync7watcher9WatchInfoZ5Array6__initZ;
static __gshared TypeInfo_Const _D11TypeInfo_xm6__initZ;
static __gshared TypeInfo_Struct _D77TypeInfo_S3std9container5array39__T5ArrayTS8libasync7watcher9WatchInfoZ5Array6__initZ;
static __gshared TypeInfo_Struct _D37TypeInfo_S8libasync7watcher9WatchInfo6__initZ;
static __gshared TypeInfo_Invariant _D78TypeInfo_yS3std9container5array39__T5ArrayTS8libasync7watcher9WatchInfoZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D80TypeInfo_yG1S3std9container5array39__T5ArrayTS8libasync7watcher9WatchInfoZ5Array6__initZ;
Array!(TimeoutEntry)
struct Array
{
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memmove, memset;
import core.memory : GC;
import std.exception : enforce;
import std.typecons : RefCounted, RefCountedAutoInitialize;
private struct Payload
{
ulong _capacity;
TimeoutEntry[] _payload;
pure nothrow @nogc @safe this(TimeoutEntry[] p)
{
this._capacity = p.length;
this._payload = p;
return this;
}
~this()
{
free(cast(void*)cast(TimeoutEntry*)this._payload);
}
this(this)
{
halt;
}
nothrow @nogc @system void opAssign(Payload rhs)
{
try
{
halt;
}
finally
{
{
free(cast(void*)cast(TimeoutEntry*)rhs._payload);
}
}
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._payload.length;
}
nothrow @nogc @property @system void length(ulong newLength)
{
import std.algorithm.mutation : initializeAll;
if (((ref Payload this = this;) , this._payload.length) >= newLength)
{
this._payload = (cast(TimeoutEntry*)this._payload)[0..newLength];
return ;
}
immutable immutable(ulong) startEmplace = (ref Payload this = this;) , this._payload.length;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) nbytes = (ulong x = newLength;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
this._payload = (cast(TimeoutEntry*)realloc(cast(void*)cast(TimeoutEntry*)this._payload, nbytes))[0..newLength];
{
TimeoutEntry[] range = (cast(TimeoutEntry*)this._payload)[startEmplace..newLength];
alias T = TimeoutEntry;
{
(ref TimeoutEntry[] range = range;) , ((TimeoutEntry value = TimeoutEntry(0L, 0LU);));
alias T = TimeoutEntry;
range[] = value;
}
}
this._capacity = newLength;
}
const pure nothrow @nogc @property @safe ulong capacity()
{
return this._capacity;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (elements <= ((ref Payload this = this;) , this._capacity))
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
TimeoutEntry* newPayloadPtr = cast(TimeoutEntry*)realloc(cast(void*)cast(TimeoutEntry*)this._payload, sz);
newPayloadPtr || halt;
TimeoutEntry[] newPayload = newPayloadPtr[0..((ref Payload this = this;) , this._payload.length)];
this._payload = newPayload;
this._capacity = elements;
}
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
if (_capacity == length)
{
reserve(1 + capacity * 3 / 2);
}
assert(capacity > length && _payload.ptr);
emplace(_payload.ptr + _payload.length, stuff);
_payload = _payload.ptr[0.._payload.length + 1];
return 1;
}
size_t insertBack(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
static if (hasLength!Stuff
)
{
immutable oldLength = length;
reserve(oldLength + stuff.length);
}
size_t result;
foreach (item; stuff)
{
insertBack(item);
++result;
}
static if (hasLength!Stuff
)
{
assert(length == oldLength + stuff.length);
}
return result;
}
alias __xdtor = ~this()
{
free(cast(void*)cast(TimeoutEntry*)this._payload);
}
;
alias __xpostblit = this(this)
{
halt;
}
;
}
private alias Data = RefCounted!(Payload, cast(RefCountedAutoInitialize)0);
private RefCounted!(Payload, cast(RefCountedAutoInitialize)0) _data;
this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)
)
{
import std.conv : emplace;
import core.checkedint : mulu;
bool overflow;
const nbytes = mulu(values.length, T.sizeof, overflow);
if (overflow)
assert(0);
auto p = cast(T*)malloc(nbytes);
static if (hasIndirections!T
)
{
if (p)
GC.addRange(p, T.sizeof * values.length);
}
foreach (i, e; values)
{
emplace(p + i, e);
}
_data = Data(p[0..values.length]);
}
this(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
&& !is(Stuff == T[]))
{
insertBack(stuff);
}
const nothrow @nogc @system bool opEquals(const(Array!(TimeoutEntry)) rhs)
{
try
{
return this.opEquals(rhs);
}
finally
{
{
rhs._data.~this();
}
}
}
const pure nothrow @nogc @safe bool opEquals(ref const(Array!(TimeoutEntry)) rhs)
{
if ((ref const(Array!(TimeoutEntry)) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16123 = this._refCounted;)) , __inlineretval16123._store !is null) || ((const(TimeoutEntry[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16124 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16124))._payload;) , !a.length))
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16123 = this._refCounted;)) , __inlineretval16123._store !is null) || ((const(TimeoutEntry[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16124 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16124))._payload;) , !a.length);
if (!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16123 = this._refCounted;)) , __inlineretval16123._store !is null) || ((const(TimeoutEntry[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16124 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16124))._payload;) , !a.length))
return false;
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16125 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16125))._payload == ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16126 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16126))._payload;
}
alias Range = RangeT!(Array!(TimeoutEntry));
alias ConstRange = RangeT!(const(Array!(TimeoutEntry)));
alias ImmutableRange = RangeT!(immutable(Array!(TimeoutEntry)));
nothrow @nogc @property @system Array!(TimeoutEntry) dup()
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16127 = this._refCounted;)) , __inlineretval16127._store !is null))
return (Array!(TimeoutEntry) __copytmp4821 = (ref Array!(TimeoutEntry) this = __copytmp4821 = this;) , this._data.__postblit();) , __copytmp4821;
return ((Array!(TimeoutEntry) __slArray4820 = Array(RefCounted(RefCountedStore(null)));) , __slArray4820).this(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16128 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16128))._payload);
}
const pure nothrow @nogc @property @safe bool empty()
{
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16123 = this._refCounted;)) , __inlineretval16123._store !is null) || ((const(TimeoutEntry[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16124 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16124))._payload;) , !a.length);
}
const pure nothrow @nogc @property @safe ulong length()
{
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU;
}
const pure nothrow @nogc @safe ulong opDollar()
{
return (ref const(Array!(TimeoutEntry)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU;
}
pure nothrow @nogc @property @safe ulong capacity()
{
return ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16131 = this._refCounted;)) , __inlineretval16131._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16132 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16132))._capacity : 0LU;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16133 = this._refCounted;)) , __inlineretval16133._store !is null))
{
if (!elements)
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
void* p = malloc(sz);
p || halt;
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = ((RefCounted!(Payload, cast(RefCountedAutoInitialize)0) __slRefCo7730 = RefCounted(RefCountedStore(null));) , __slRefCo7730).this(cast(TimeoutEntry[])p[0..0]);
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16134 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16134))._capacity = elements;
}
else
{
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16135 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16135)).reserve(elements);
}
}
nothrow @nogc @system RangeT!(Array!(TimeoutEntry)) opSlice()
{
return (RangeT!(Array!(TimeoutEntry)) __slRange4693 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(TimeoutEntry) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref Array!(TimeoutEntry) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU;))) , (__slRange4693._outer_[] = data , __slRange4693._a = a , __slRange4693._b = b , __slRange4693);
}
const nothrow @nogc @system RangeT!(const(Array!(TimeoutEntry))) opSlice()
{
return (RangeT!(const(Array!(TimeoutEntry))) __slRange7731 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(TimeoutEntry)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref const(Array!(TimeoutEntry)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU;))) , (__slRange7731._outer_[] = data , __slRange7731._a = a , __slRange7731._b = b , __slRange7731);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(TimeoutEntry))) opSlice()
{
return (RangeT!(immutable(Array!(TimeoutEntry))) __slRange7732 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(TimeoutEntry)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref immutable(Array!(TimeoutEntry)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU;))) , (__slRange7732._outer_[] = data , __slRange7732._a = a , __slRange7732._b = b , __slRange7732);
}
nothrow @nogc @system RangeT!(Array!(TimeoutEntry)) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref Array!(TimeoutEntry) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU));
return (RangeT!(Array!(TimeoutEntry)) __slRange7733 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(TimeoutEntry) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7733._outer_[] = data , __slRange7733._a = a , __slRange7733._b = b , __slRange7733);
}
const nothrow @nogc @system RangeT!(const(Array!(TimeoutEntry))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref const(Array!(TimeoutEntry)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU));
return (RangeT!(const(Array!(TimeoutEntry))) __slRange7734 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(TimeoutEntry)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7734._outer_[] = data , __slRange7734._a = a , __slRange7734._b = b , __slRange7734);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(TimeoutEntry))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref immutable(Array!(TimeoutEntry)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU));
return (RangeT!(immutable(Array!(TimeoutEntry))) __slRange7735 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(TimeoutEntry)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7735._outer_[] = data , __slRange7735._a = a , __slRange7735._b = b , __slRange7735);
}
inout pure nothrow @nogc @property ref @safe inout(TimeoutEntry) front()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];
}
inout pure nothrow @nogc @property ref @safe inout(TimeoutEntry) back()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16138 = this._refCounted;)) , __inlineretval16138._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16139 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16139))._payload[__dollar - 1LU];
}
inout pure nothrow @nogc ref @safe inout(TimeoutEntry) opIndex(ulong i)
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];
}
pure nothrow @nogc @safe void opSliceAssign(TimeoutEntry value)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16140 = this._refCounted;)) , __inlineretval16140._store !is null))
return ;
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16141 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16141))._payload[] = value;
}
pure nothrow @nogc @safe void opSliceAssign(TimeoutEntry value, ulong i, ulong j)
{
TimeoutEntry[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16142 = this._refCounted;)) , __inlineretval16142._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16143 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16143))._payload : null;
slice[i..j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin(op ~ "_data._payload[];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin(op ~ "slice[i .. j];");
}
void opSliceOpAssign(string op)(T value)
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin("_data._payload[] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(T value, size_t i, size_t j)
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin("slice[i .. j] " ~ op ~ "= value;");
}
Array opBinary(string op, Stuff)(Stuff stuff) if (op == "~")
{
Array result;
result ~= this[];
assert(result.length == length);
result ~= stuff[];
return result;
}
void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~")
{
static if (is(typeof(stuff[])))
{
insertBack(stuff[]);
}
else
{
insertBack(stuff);
}
}
nothrow @nogc @system void clear()
{
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
nothrow @nogc @property @system void length(ulong newLength)
{
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16144 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16144;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16144;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16145 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16145)).length(newLength);
}
pure @safe TimeoutEntry removeAny()
{
TimeoutEntry result = (ref Array!(TimeoutEntry) this = this;) , ((ref inout(TimeoutEntry) __inlineretval16146 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16138 = this._refCounted;)) , __inlineretval16138._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16139 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16139))._payload[__dollar - 1LU];) , __inlineretval16146);
this.removeBack();
return result;
}
alias stableRemoveAny = pure @safe TimeoutEntry removeAny()
{
TimeoutEntry result = (ref Array!(TimeoutEntry) this = this;) , ((ref inout(TimeoutEntry) __inlineretval16146 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16138 = this._refCounted;)) , __inlineretval16138._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16139 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16139))._payload[__dollar - 1LU];) , __inlineretval16146);
this.removeBack();
return result;
}
;
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
alias insert = size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
;
pure @safe void removeBack()
{
enforce(!((ref Array!(TimeoutEntry) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16123 = this._refCounted;)) , __inlineretval16123._store !is null) || ((const(TimeoutEntry[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16124 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16124))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16147 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16147))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16148 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16148))._payload[0..__dollar - 1LU];
}
alias stableRemoveBack = void stableRemoveBack();
;
pure nothrow @nogc @safe ulong removeBack(ulong howMany)
{
if (howMany > ((ref Array!(TimeoutEntry) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU))
howMany = ((ref Array!(TimeoutEntry) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16149 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16149))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16150 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16150))._payload[0..__dollar - howMany];
return howMany;
}
alias stableRemoveBack = pure @safe void removeBack()
{
enforce(!((ref Array!(TimeoutEntry) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16123 = this._refCounted;)) , __inlineretval16123._store !is null) || ((const(TimeoutEntry[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16124 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16124))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16147 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16147))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16148 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16148))._payload[0..__dollar - 1LU];
}
;
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
reserve(length + 1);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + 1, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
emplace(_data._payload.ptr + r._a, stuff);
_data._payload = _data._payload.ptr[0.._data._payload.length + 1];
return 1;
}
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
static if (isForwardRange!Stuff
)
{
auto extra = walkLength(stuff);
if (!extra)
return 0;
reserve(length + extra);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + extra, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
foreach (p; _data._payload.ptr + r._a .. _data._payload.ptr + r._a + extra)
{
emplace(p, stuff.front);
stuff.popFront();
}
_data._payload = _data._payload.ptr[0.._data._payload.length + extra];
return extra;
}
else
{
import std.algorithm.mutation : bringToFront;
enforce(_data);
immutable offset = r._a;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
}
size_t insertAfter(Stuff)(Range r, Stuff stuff)
{
import std.algorithm.mutation : bringToFront;
enforce(r._outer._data is _data);
immutable offset = r._b;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
enforce(r._outer._data is _data);
size_t result;
for (; !stuff.empty; stuff.popFront())
{
{
if (r.empty)
{
return result + insertBefore(r, stuff);
}
r.front = stuff.front;
r.popFront();
++result;
}
}
linearRemove(r);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
enforce(r._outer._data is _data);
if (r.empty)
{
insertBefore(r, stuff);
}
else
{
r.front = stuff;
r.popFront();
linearRemove(r);
}
return 1;
}
@system RangeT!(Array!(TimeoutEntry)) linearRemove(RangeT!(Array!(TimeoutEntry)) r)
{
try
{
import std.algorithm.mutation : copy;
enforce(((ref inout(Array!(TimeoutEntry)) __inlineretval16151 = r._outer_[0];) , __inlineretval16151)._data is this._data, delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 988LU);
enforce(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16152 = this._refCounted;)) , __inlineretval16152._store !is null), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 989LU);
enforce(r._a <= r._b && r._b <= ((ref Array!(TimeoutEntry) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 990LU);
immutable immutable(ulong) offset1 = r._a;
immutable immutable(ulong) offset2 = r._b;
immutable immutable(ulong) tailLength = ((ref Array!(TimeoutEntry) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU) - offset2;
(RangeT!(Array!(TimeoutEntry)) __tmpfordtor7739 = copy(this.opSlice(offset2, ((ref Array!(TimeoutEntry) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU)), this.opSlice(offset1, offset1 + tailLength));) , __tmpfordtor7739;
{
ref Array!(TimeoutEntry) this = this;
ulong newLength = offset1 + tailLength;
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16144 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16144;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16144;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16145 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16145)).length(newLength);
}
return this.opSlice(((ref Array!(TimeoutEntry) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU) - tailLength, ((ref Array!(TimeoutEntry) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU));
}
finally
{
{
{
Array!(TimeoutEntry)[] a = (&r._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
}
}
~this()
{
this._data.~this();
}
alias __xdtor = ~this()
{
this._data.~this();
}
;
this(this)
{
this._data.__postblit();
}
alias __xpostblit = this(this)
{
this._data.__postblit();
}
;
nothrow @nogc ref return @system Array!(TimeoutEntry) opAssign(Array!(TimeoutEntry) p)
{
(Array!(TimeoutEntry) __swap4660 = void;) , __swap4660 = this , this = p;
{
__swap4660._data.~this();
}
return this;
}
}
RangeT!(Array!(TimeoutEntry))
struct RangeT
{
private Array!(TimeoutEntry)[1] _outer_;
private inout pure nothrow @nogc @property ref @safe inout(Array!(TimeoutEntry)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = TimeoutEntry;
private nothrow @nogc @system this(ref Array!(TimeoutEntry) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(Array!(TimeoutEntry)) save()
{
return (RangeT!(Array!(TimeoutEntry)) __copytmp4675 = (__copytmp4675 = this).__fieldPostblit();) , __copytmp4675;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(TimeoutEntry) front()
{
assert(!((ref inout(RangeT!(Array!(TimeoutEntry))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
inout ref inout(Array!(TimeoutEntry)) __dop4676 = (ref inout(RangeT!(Array!(TimeoutEntry))) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval14689 = this._outer_[0];) , __inlineretval14689);
return (ulong i = this._a;) , ((ref inout(TimeoutEntry) __inlineretval14692 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4676._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4676._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval14692);
}
inout pure nothrow @nogc @property ref @safe inout(TimeoutEntry) back()
{
assert(!((ref inout(RangeT!(Array!(TimeoutEntry))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
inout ref inout(Array!(TimeoutEntry)) __dop4677 = (ref inout(RangeT!(Array!(TimeoutEntry))) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16153 = this._outer_[0];) , __inlineretval16153);
return (ulong i = this._b - 1LU;) , ((ref inout(TimeoutEntry) __inlineretval16154 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4677._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4677._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16154);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(Array!(TimeoutEntry)) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(Array!(TimeoutEntry)) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(Array!(TimeoutEntry))
enum bool isMutable = true;
)
{
import std.algorithm.mutation : move;
pure nothrow @nogc @safe TimeoutEntry moveFront()
{
assert(!((ref RangeT!(Array!(TimeoutEntry)) this = this;) , this._a >= this._b) && this._a < ((ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16155 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16155._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16155._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU));
return (ref TimeoutEntry source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16156 = this._outer_[0];) , __inlineretval16156))._data;) , ((ref inout(Payload) __inlineretval16157 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16157))._payload[this._a];) , ((TimeoutEntry __inlineretval16158 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16158);
}
pure nothrow @nogc @safe TimeoutEntry moveBack()
{
assert(!((ref RangeT!(Array!(TimeoutEntry)) this = this;) , this._a >= this._b) && this._b <= ((ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16159 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16159._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16159._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU));
return (ref TimeoutEntry source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16160 = this._outer_[0];) , __inlineretval16160))._data;) , ((ref inout(Payload) __inlineretval16161 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16161))._payload[this._b - 1LU];) , ((TimeoutEntry __inlineretval16162 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16162);
}
pure nothrow @nogc @safe TimeoutEntry moveAt(ulong i)
{
assert(this._a + i < this._b && this._a + i < ((ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16163 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16163._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16163._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU));
return (ref TimeoutEntry source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16164 = this._outer_[0];) , __inlineretval16164))._data;) , ((ref inout(Payload) __inlineretval16165 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16165))._payload[this._a + i];) , ((TimeoutEntry __inlineretval16166 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16166);
}
}
inout pure nothrow @nogc ref @safe inout(TimeoutEntry) opIndex(ulong i)
{
assert(this._a + i < this._b);
inout ref inout(Array!(TimeoutEntry)) __dop4679 = (ref inout(RangeT!(Array!(TimeoutEntry))) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval15034 = this._outer_[0];) , __inlineretval15034);
return (ulong i = this._a + i;) , ((ref inout(TimeoutEntry) __inlineretval15035 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4679._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4679._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval15035);
}
nothrow @nogc @system RangeT!(Array!(TimeoutEntry)) opSlice()
{
return (RangeT!(Array!(TimeoutEntry)) __slRange4680 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(TimeoutEntry) data = (ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16167 = this._outer_[0];) , __inlineretval16167);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4680._outer_[] = data , __slRange4680._a = a , __slRange4680._b = b , __slRange4680);
}
nothrow @nogc @system RangeT!(Array!(TimeoutEntry)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(Array!(TimeoutEntry)) __slRange4681 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(TimeoutEntry) data = (ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16168 = this._outer_[0];) , __inlineretval16168);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4681._outer_[] = data , __slRange4681._a = a , __slRange4681._b = b , __slRange4681);
}
const nothrow @nogc @system RangeT!(const(Array!(TimeoutEntry))) opSlice()
{
return (RangeT!(const(Array!(TimeoutEntry))) __slRange4682 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(TimeoutEntry)) data = (ref const(RangeT!(Array!(TimeoutEntry))) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16169 = this._outer_[0];) , __inlineretval16169);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4682._outer_[] = data , __slRange4682._a = a , __slRange4682._b = b , __slRange4682);
}
const nothrow @nogc @system RangeT!(const(Array!(TimeoutEntry))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(TimeoutEntry))) __slRange4683 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(TimeoutEntry)) data = (ref const(RangeT!(Array!(TimeoutEntry))) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16170 = this._outer_[0];) , __inlineretval16170);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4683._outer_[] = data , __slRange4683._a = a , __slRange4683._b = b , __slRange4683);
}
static if (isMutable!(Array!(TimeoutEntry))
)
{
pure nothrow @nogc @safe void opSliceAssign(TimeoutEntry value)
{
assert(this._b <= ((ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16171 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16171._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16171._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU));
{
(ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16172 = this._outer_[0];));
(TimeoutEntry value = value;) , ((ulong i = this._a;)) , ((ulong j = this._b;));
TimeoutEntry[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16172._data;) , ((ref inout(RefCountedStore) __inlineretval16142 = this._refCounted;)) , __inlineretval16142._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16172._data;) , ((ref inout(Payload) __inlineretval16143 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16143))._payload : null;
slice[i..j] = value;
}
}
pure nothrow @nogc @safe void opSliceAssign(TimeoutEntry value, ulong i, ulong j)
{
assert(this._a + j <= this._b);
{
(ref RangeT!(Array!(TimeoutEntry)) this = this;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16173 = this._outer_[0];));
(TimeoutEntry value = value;) , ((ulong i = this._a + i;)) , ((ulong j = this._a + j;));
TimeoutEntry[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16173._data;) , ((ref inout(RefCountedStore) __inlineretval16142 = this._refCounted;)) , __inlineretval16142._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16173._data;) , ((ref inout(Payload) __inlineretval16143 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16143))._payload : null;
slice[i..j] = value;
}
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(TimeoutEntry)[] a = (&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(TimeoutEntry)[] a = (&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(TimeoutEntry)[] a = (&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4663 = a[];
ulong __key4664 = 0LU;
for (; __key4664 < __r4663.length; __key4664 += 1LU)
{
ref Array!(TimeoutEntry) e = __r4663[__key4664];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(TimeoutEntry)[] a = (&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4663 = a[];
ulong __key4664 = 0LU;
for (; __key4664 < __r4663.length; __key4664 += 1LU)
{
ref Array!(TimeoutEntry) e = __r4663[__key4664];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(Array!(TimeoutEntry)) opAssign(RangeT!(Array!(TimeoutEntry)) p)
{
(RangeT!(Array!(TimeoutEntry)) __swap4674 = void;) , __swap4674 = this , this = p;
{
{
Array!(TimeoutEntry)[] a = (&__swap4674._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(const(Array!(TimeoutEntry)))
struct RangeT
{
private const const(Array!(TimeoutEntry)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe inout(const(Array!(TimeoutEntry))) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = const(TimeoutEntry);
private nothrow @nogc @system this(ref const(Array!(TimeoutEntry)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(const(Array!(TimeoutEntry))) save()
{
return (RangeT!(const(Array!(TimeoutEntry))) __copytmp4662 = (__copytmp4662 = this).__fieldPostblit();) , __copytmp4662;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(const(TimeoutEntry)) front()
{
assert(!((ref inout(RangeT!(const(Array!(TimeoutEntry)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
const ref inout(const(Array!(TimeoutEntry))) __dop4667 = (ref inout(RangeT!(const(Array!(TimeoutEntry)))) this = this;) , ((ref inout(const(Array!(TimeoutEntry))) __inlineretval16174 = this._outer_[0];) , __inlineretval16174);
return (ulong i = this._a;) , ((ref inout(TimeoutEntry) __inlineretval16175 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4667._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4667._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16175);
}
inout pure nothrow @nogc @property ref @safe inout(const(TimeoutEntry)) back()
{
assert(!((ref inout(RangeT!(const(Array!(TimeoutEntry)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
const ref inout(const(Array!(TimeoutEntry))) __dop4668 = (ref inout(RangeT!(const(Array!(TimeoutEntry)))) this = this;) , ((ref inout(const(Array!(TimeoutEntry))) __inlineretval16176 = this._outer_[0];) , __inlineretval16176);
return (ulong i = this._b - 1LU;) , ((ref inout(TimeoutEntry) __inlineretval16177 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4668._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4668._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16177);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(const(Array!(TimeoutEntry))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(const(Array!(TimeoutEntry))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(const(Array!(TimeoutEntry)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe inout(const(TimeoutEntry)) opIndex(ulong i)
{
assert(this._a + i < this._b);
const ref inout(const(Array!(TimeoutEntry))) __dop4669 = (ref inout(RangeT!(const(Array!(TimeoutEntry)))) this = this;) , ((ref inout(const(Array!(TimeoutEntry))) __inlineretval16178 = this._outer_[0];) , __inlineretval16178);
return (ulong i = this._a + i;) , ((ref inout(TimeoutEntry) __inlineretval16179 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4669._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4669._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16179);
}
nothrow @nogc @system RangeT!(const(Array!(TimeoutEntry))) opSlice()
{
return (RangeT!(const(Array!(TimeoutEntry))) __slRange4670 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(TimeoutEntry)) data = (ref RangeT!(const(Array!(TimeoutEntry))) this = this;) , ((ref inout(const(Array!(TimeoutEntry))) __inlineretval16180 = this._outer_[0];) , __inlineretval16180);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4670._outer_[] = data , __slRange4670._a = a , __slRange4670._b = b , __slRange4670);
}
nothrow @nogc @system RangeT!(const(Array!(TimeoutEntry))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(TimeoutEntry))) __slRange4671 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(TimeoutEntry)) data = (ref RangeT!(const(Array!(TimeoutEntry))) this = this;) , ((ref inout(const(Array!(TimeoutEntry))) __inlineretval16181 = this._outer_[0];) , __inlineretval16181);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4671._outer_[] = data , __slRange4671._a = a , __slRange4671._b = b , __slRange4671);
}
const nothrow @nogc @system RangeT!(const(Array!(TimeoutEntry))) opSlice()
{
return (RangeT!(const(Array!(TimeoutEntry))) __slRange4672 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(TimeoutEntry)) data = (ref const(RangeT!(const(Array!(TimeoutEntry)))) this = this;) , ((ref inout(const(Array!(TimeoutEntry))) __inlineretval16182 = this._outer_[0];) , __inlineretval16182);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4672._outer_[] = data , __slRange4672._a = a , __slRange4672._b = b , __slRange4672);
}
const nothrow @nogc @system RangeT!(const(Array!(TimeoutEntry))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(TimeoutEntry))) __slRange4673 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(TimeoutEntry)) data = (ref const(RangeT!(const(Array!(TimeoutEntry)))) this = this;) , ((ref inout(const(Array!(TimeoutEntry))) __inlineretval16183 = this._outer_[0];) , __inlineretval16183);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4673._outer_[] = data , __slRange4673._a = a , __slRange4673._b = b , __slRange4673);
}
static if (isMutable!(const(Array!(TimeoutEntry)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(TimeoutEntry)[] a = (&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(TimeoutEntry)[] a = (&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(TimeoutEntry)[] a = (&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4663 = a[];
ulong __key4664 = 0LU;
for (; __key4664 < __r4663.length; __key4664 += 1LU)
{
ref Array!(TimeoutEntry) e = __r4663[__key4664];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(TimeoutEntry)[] a = (&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4663 = a[];
ulong __key4664 = 0LU;
for (; __key4664 < __r4663.length; __key4664 += 1LU)
{
ref Array!(TimeoutEntry) e = __r4663[__key4664];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(const(Array!(TimeoutEntry))) opAssign(RangeT!(const(Array!(TimeoutEntry))) p)
{
(RangeT!(const(Array!(TimeoutEntry))) __swap4661 = void;) , __swap4661 = this , this = p;
{
{
Array!(TimeoutEntry)[] a = (&__swap4661._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(immutable(Array!(TimeoutEntry)))
struct RangeT
{
private immutable immutable(Array!(TimeoutEntry)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe immutable(Array!(TimeoutEntry)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = immutable(TimeoutEntry);
private nothrow @nogc @system this(ref immutable(Array!(TimeoutEntry)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(immutable(Array!(TimeoutEntry))) save()
{
return (RangeT!(immutable(Array!(TimeoutEntry))) __copytmp4685 = (__copytmp4685 = this).__fieldPostblit();) , __copytmp4685;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe immutable(TimeoutEntry) front()
{
assert(!((ref inout(RangeT!(immutable(Array!(TimeoutEntry)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
immutable ref immutable(Array!(TimeoutEntry)) __dop4686 = (ref inout(RangeT!(immutable(Array!(TimeoutEntry)))) this = this;) , ((ref immutable(Array!(TimeoutEntry)) __inlineretval16184 = this._outer_[0];) , __inlineretval16184);
return (ulong i = this._a;) , ((ref inout(TimeoutEntry) __inlineretval16185 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4686._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4686._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16185);
}
inout pure nothrow @nogc @property ref @safe immutable(TimeoutEntry) back()
{
assert(!((ref inout(RangeT!(immutable(Array!(TimeoutEntry)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
immutable ref immutable(Array!(TimeoutEntry)) __dop4687 = (ref inout(RangeT!(immutable(Array!(TimeoutEntry)))) this = this;) , ((ref immutable(Array!(TimeoutEntry)) __inlineretval16186 = this._outer_[0];) , __inlineretval16186);
return (ulong i = this._b - 1LU;) , ((ref inout(TimeoutEntry) __inlineretval16187 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4687._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4687._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16187);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(immutable(Array!(TimeoutEntry))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(immutable(Array!(TimeoutEntry))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(immutable(Array!(TimeoutEntry)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe immutable(TimeoutEntry) opIndex(ulong i)
{
assert(this._a + i < this._b);
immutable ref immutable(Array!(TimeoutEntry)) __dop4688 = (ref inout(RangeT!(immutable(Array!(TimeoutEntry)))) this = this;) , ((ref immutable(Array!(TimeoutEntry)) __inlineretval16188 = this._outer_[0];) , __inlineretval16188);
return (ulong i = this._a + i;) , ((ref inout(TimeoutEntry) __inlineretval16189 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4688._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4688._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16189);
}
nothrow @nogc @system RangeT!(immutable(Array!(TimeoutEntry))) opSlice()
{
return (RangeT!(immutable(Array!(TimeoutEntry))) __slRange4689 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(TimeoutEntry)) data = (ref RangeT!(immutable(Array!(TimeoutEntry))) this = this;) , ((ref immutable(Array!(TimeoutEntry)) __inlineretval16190 = this._outer_[0];) , __inlineretval16190);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4689._outer_[] = data , __slRange4689._a = a , __slRange4689._b = b , __slRange4689);
}
nothrow @nogc @system RangeT!(immutable(Array!(TimeoutEntry))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(TimeoutEntry))) __slRange4690 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(TimeoutEntry)) data = (ref RangeT!(immutable(Array!(TimeoutEntry))) this = this;) , ((ref immutable(Array!(TimeoutEntry)) __inlineretval16191 = this._outer_[0];) , __inlineretval16191);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4690._outer_[] = data , __slRange4690._a = a , __slRange4690._b = b , __slRange4690);
}
const nothrow @nogc @system RangeT!(immutable(Array!(TimeoutEntry))) opSlice()
{
return (RangeT!(immutable(Array!(TimeoutEntry))) __slRange4691 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(TimeoutEntry)) data = (ref const(RangeT!(immutable(Array!(TimeoutEntry)))) this = this;) , ((ref immutable(Array!(TimeoutEntry)) __inlineretval16192 = this._outer_[0];) , __inlineretval16192);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4691._outer_[] = data , __slRange4691._a = a , __slRange4691._b = b , __slRange4691);
}
const nothrow @nogc @system RangeT!(immutable(Array!(TimeoutEntry))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(TimeoutEntry))) __slRange4692 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(TimeoutEntry)) data = (ref const(RangeT!(immutable(Array!(TimeoutEntry)))) this = this;) , ((ref immutable(Array!(TimeoutEntry)) __inlineretval16193 = this._outer_[0];) , __inlineretval16193);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4692._outer_[] = data , __slRange4692._a = a , __slRange4692._b = b , __slRange4692);
}
static if (isMutable!(immutable(Array!(TimeoutEntry)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(TimeoutEntry)[] a = (cast(Array!(TimeoutEntry)*)&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(TimeoutEntry)[] a = (cast(Array!(TimeoutEntry)*)&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(TimeoutEntry)[] a = (cast(Array!(TimeoutEntry)*)&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4663 = a[];
ulong __key4664 = 0LU;
for (; __key4664 < __r4663.length; __key4664 += 1LU)
{
ref Array!(TimeoutEntry) e = __r4663[__key4664];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(TimeoutEntry)[] a = (cast(Array!(TimeoutEntry)*)&this._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4663 = a[];
ulong __key4664 = 0LU;
for (; __key4664 < __r4663.length; __key4664 += 1LU)
{
ref Array!(TimeoutEntry) e = __r4663[__key4664];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(immutable(Array!(TimeoutEntry))) opAssign(RangeT!(immutable(Array!(TimeoutEntry))) p)
{
(RangeT!(immutable(Array!(TimeoutEntry))) __swap4684 = void;) , __swap4684 = this , this = p;
{
{
Array!(TimeoutEntry)[] a = (cast(Array!(TimeoutEntry)*)&__swap4684._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
static __gshared TypeInfo_Const _D95TypeInfo_xS3std9container5array56__T5ArrayTS4vibe4core7drivers10timerqueue12TimeoutEntryZ5Array6__initZ;
static __gshared TypeInfo_Const _D55TypeInfo_xS4vibe4core7drivers10timerqueue12TimeoutEntry6__initZ;
static __gshared TypeInfo_Const _D97TypeInfo_xG1S3std9container5array56__T5ArrayTS4vibe4core7drivers10timerqueue12TimeoutEntryZ5Array6__initZ;
static __gshared TypeInfo_Struct _D94TypeInfo_S3std9container5array56__T5ArrayTS4vibe4core7drivers10timerqueue12TimeoutEntryZ5Array6__initZ;
static __gshared TypeInfo_Struct _D54TypeInfo_S4vibe4core7drivers10timerqueue12TimeoutEntry6__initZ;
static __gshared TypeInfo_Invariant _D95TypeInfo_yS3std9container5array56__T5ArrayTS4vibe4core7drivers10timerqueue12TimeoutEntryZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D97TypeInfo_yG1S3std9container5array56__T5ArrayTS4vibe4core7drivers10timerqueue12TimeoutEntryZ5Array6__initZ;
BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout")
struct BinaryHeap
{
import std.functional : binaryFun;
import std.exception : enforce;
import std.algorithm.comparison : min;
import std.algorithm.mutation : move, swapAt;
import std.algorithm.sorting : HeapOps;
import std.typecons : RefCounted, RefCountedAutoInitialize;
static if (isRandomAccessRange!(Array!(TimeoutEntry))
)
{
alias Range = Store;
}
else
{
alias Range = RangeT!(Array!(TimeoutEntry));
}
alias percolate = void percolate()(Range r, size_t parent, immutable size_t end)
{
immutable root = parent;
for (;;)
{
{
auto child = (parent + 1) * 2;
if (child >= end)
{
if (child == end)
{
--child;
r.swapAt(parent, child);
parent = child;
}
break;
}
auto leftChild = child - 1;
if (lessFun(r[child], r[leftChild]))
child = leftChild;
r.swapAt(parent, child);
parent = child;
}
}
for (auto child = parent;
child > root; child = parent)
{
{
parent = (child - 1) / 2;
if (!lessFun(r[parent], r[child]))
break;
r.swapAt(parent, child);
}
}
}
;
alias buildHeap = void buildHeap()(Range r)
{
immutable n = r.length;
for (size_t i = n / 2;
i-- > 0;)
{
{
siftDown(r, i, n);
}
}
assert(isHeap(r));
}
;
private static struct Data
{
Array!(TimeoutEntry) _store;
ulong _length;
~this()
{
{
ref Array!(TimeoutEntry) this = this._store;
this._data.~this();
}
}
alias __xdtor = ~this()
{
{
ref Array!(TimeoutEntry) this = this._store;
this._data.~this();
}
}
;
this(this)
{
{
ref Array!(TimeoutEntry) this = this._store;
this._data.__postblit();
}
}
alias __xpostblit = this(this)
{
{
ref Array!(TimeoutEntry) this = this._store;
this._data.__postblit();
}
}
;
nothrow @nogc ref return @system Data opAssign(Data p)
{
(Data __swap4810 = void;) , __swap4810 = this , this = p;
{
{
ref Array!(TimeoutEntry) this = __swap4810._store;
this._data.~this();
}
}
return this;
}
}
private RefCounted!(Data, cast(RefCountedAutoInitialize)0) _payload;
private alias comp = auto binaryFun(ElementType1, ElementType2)(auto ref ElementType1 __a, auto ref ElementType2 __b)
{
mixin("alias " ~ parm1Name ~ " = __a ;");
mixin("alias " ~ parm2Name ~ " = __b ;");
return mixin(fun);
}
;
private pure nothrow @nogc @property ref return @safe Array!(TimeoutEntry) _store()
{
assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null));
return ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;
}
private pure nothrow @nogc @property ref return @safe ulong _length()
{
assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null));
return ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length;
}
private pure nothrow @nogc @safe void assertValid()
{
}
nothrow @nogc @system void pop(Array!(TimeoutEntry) store)
{
try
{
assert(!(!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16123 = this._refCounted;)) , __inlineretval16123._store !is null) || ((const(TimeoutEntry[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16124 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16124))._payload;) , !a.length)), "Cannot pop an empty store.");
if ((((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU) == 1LU)
return ;
TimeoutEntry t1 = (RangeT!(Array!(TimeoutEntry)) __tmpfordtor7740 = store.opSlice();) , ((TimeoutEntry __inlineretval16196 = assert(!((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7740;) , this._a >= this._b) && __tmpfordtor7740._a < ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7740;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16155 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16155._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16155._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU)) , ((ref TimeoutEntry source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7740;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16156 = this._outer_[0];) , __inlineretval16156))._data;) , ((ref inout(Payload) __inlineretval16157 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16157))._payload[__tmpfordtor7740._a];) , ((TimeoutEntry __inlineretval16158 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16158));) , __inlineretval16196);
TimeoutEntry t2 = (RangeT!(Array!(TimeoutEntry)) __tmpfordtor7741 = store.opSlice();) , ((TimeoutEntry __inlineretval16197 = assert(!((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7741;) , this._a >= this._b) && __tmpfordtor7741._b <= ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7741;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16159 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16159._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16159._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU)) , ((ref TimeoutEntry source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7741;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16160 = this._outer_[0];) , __inlineretval16160))._data;) , ((ref inout(Payload) __inlineretval16161 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16161))._payload[__tmpfordtor7741._b - 1LU];) , ((TimeoutEntry __inlineretval16162 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16162));) , __inlineretval16197);
((ref inout(TimeoutEntry) __inlineretval16198 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];) , __inlineretval16198) = ((ref TimeoutEntry source = t2;) , ((TimeoutEntry __inlineretval16199 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16199));
((ref inout(TimeoutEntry) __inlineretval16200 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16138 = this._refCounted;)) , __inlineretval16138._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16139 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16139))._payload[__dollar - 1LU];) , __inlineretval16200) = ((ref TimeoutEntry source = t1;) , ((TimeoutEntry __inlineretval16201 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16201));
percolate(store.opSlice(), 0LU, (((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU) - 1LU);
}
finally
{
{
store._data.~this();
}
}
}
public
{
nothrow @nogc @system this(Array!(TimeoutEntry) s, ulong initialSize = 18446744073709551615LU)
{
try
{
this.acquire(((Array!(TimeoutEntry) __copytmp7748 = (ref Array!(TimeoutEntry) this = __copytmp7748 = s;) , this._data.__postblit();) , __copytmp7748), initialSize);
return this;
}
finally
{
{
s._data.~this();
}
}
}
nothrow @nogc @system void acquire(Array!(TimeoutEntry) s, ulong initialSize = 18446744073709551615LU)
{
try
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16202 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16202;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16202;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16203 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16203)).opAssign(((ref Array!(TimeoutEntry) source = s;) , ((Array!(TimeoutEntry) __inlineretval16204 = moveImpl(source);) , __inlineretval16204)));
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) = ((ulong _param_0 = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16205 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16205._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16205._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU;) , ((ulong _param_1 = initialSize;)) , (alias a = ulong _param_0;
;
, (alias T0 = ulong;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref ulong a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1));
if (((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) < 2LU)
return ;
{
RangeT!(Array!(TimeoutEntry)) r = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16206 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16206)).opSlice();
immutable immutable(ulong) n = r._b - r._a;
{
ulong i = n / 2LU;
for (; i-- > 0LU;)
{
{
siftDown(((RangeT!(Array!(TimeoutEntry)) __copytmp7744 = (__copytmp7744 = r).__fieldPostblit();) , __copytmp7744), i, n);
}
}
}
assert(isHeap(((RangeT!(Array!(TimeoutEntry)) __copytmp7747 = (__copytmp7747 = r).__fieldPostblit();) , __copytmp7747)));
{
{
Array!(TimeoutEntry)[] a = (&r._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
}
{
ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;
}
}
finally
{
{
s._data.~this();
}
}
}
nothrow @nogc @system void assume(Array!(TimeoutEntry) s, ulong initialSize = 18446744073709551615LU)
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16207 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16207;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16207;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16208 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16208)).opAssign(((Array!(TimeoutEntry) __copytmp7749 = (ref Array!(TimeoutEntry) this = __copytmp7749 = s;) , this._data.__postblit();) , __copytmp7749));
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) = ((ulong _param_0 = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16209 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16209._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16209._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU;) , ((ulong _param_1 = initialSize;)) , (alias a = ulong _param_0;
;
, (alias T0 = ulong;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref ulong a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1));
{
ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;
}
{
s._data.~this();
}
}
auto nothrow @nogc @system RangeT!(Array!(TimeoutEntry)) release()
{
if (!((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16210 = this._refCounted;)) , __inlineretval16210._store !is null))
{
return RangeT([Array(RefCounted(RefCountedStore(null)))], 0LU, 0LU);
}
{
ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;
}
RangeT!(Array!(TimeoutEntry)) result = (ref Array!(TimeoutEntry) __dop7751 = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16211 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16211);) , result = __dop7751.opSlice(0LU, ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)));
try
{
{
ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;
RefCounted!(Data, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
return (RangeT!(Array!(TimeoutEntry)) __copytmp7752 = (__copytmp7752 = result).__fieldPostblit();) , __copytmp7752;
}
finally
{
{
{
Array!(TimeoutEntry)[] a = (&result._outer_)[0..1];
{
Array!(TimeoutEntry)[] __r4665 = a[];
ulong __key4666 = __r4665.length;
for (; __key4666--;)
{
ref Array!(TimeoutEntry) e = __r4665[__key4666];
{
e._data.~this();
}
}
}
}
}
}
}
pure nothrow @nogc @property @safe bool empty()
{
return !((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU);
}
static if (is(Array!(TimeoutEntry) == Array!(TimeoutEntry)))
{
nothrow @nogc @property @system BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") dup()
{
BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") result = 0;
try
if (!((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16212 = this._refCounted;)) , __inlineretval16212._store !is null))
return result;
result.assume(((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16213 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16213)).dup(), ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU));
return result;
catch(Throwable __o7753)
{
{
result._payload.~this();
}
throw __o7753;
}
}
}
pure nothrow @nogc @property @safe ulong length()
{
return ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU;
}
pure nothrow @nogc @property @safe ulong capacity()
{
if (!((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16214 = this._refCounted;)) , __inlineretval16214._store !is null))
return 0LU;
return (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16215 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16215._data;) , ((ref inout(RefCountedStore) __inlineretval16131 = this._refCounted;)) , __inlineretval16131._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16215._data;) , ((ref inout(Payload) __inlineretval16132 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16132))._capacity : 0LU;
}
pure @property @safe TimeoutEntry front()
{
enforce(!((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , !((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU)), delegate const(char)[]() => "Cannot call front on an empty heap.", "/usr/include/dmd/phobos/std/container/binaryheap.d", 248LU);
return (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16216 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref inout(TimeoutEntry) __inlineretval16217 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16216._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16216._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];) , __inlineretval16217);
}
nothrow @nogc @system void clear()
{
{
ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;
RefCounted!(Data, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
nothrow @nogc @system ulong insert(TimeoutEntry value)
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16218 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16218;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16218;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
if (((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU) == ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16219 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16219._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16219._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU))
{
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16220 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16220)).insertBack(value);
}
else
{
((ref Array!(TimeoutEntry) __dop7069 = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16221 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16221);) , ((ulong i = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length);) , ((ref inout(TimeoutEntry) __inlineretval16222 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7069._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7069._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16222))) = value;
}
{
ulong n = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length);
for (; n;)
{
{
ulong parentIdx = (n - 1LU) / 2LU;
if (!((ref TimeoutEntry __a = (ref Array!(TimeoutEntry) __dop7070 = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16223 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16223);) , ((ulong i = parentIdx;) , ((ref inout(TimeoutEntry) __inlineretval16224 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7070._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7070._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16224));) , ((ref TimeoutEntry __b = (ref Array!(TimeoutEntry) __dop7071 = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16225 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16225);) , ((ulong i = n;) , ((ref inout(TimeoutEntry) __inlineretval16226 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7071._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7071._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16226));)) , (alias a = ref TimeoutEntry __a;
;
, (alias b = ref TimeoutEntry __b;
;
) , __a.timeout > __b.timeout)))
break;
{
(ref Array!(TimeoutEntry) r = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16227 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16227);) , ((ulong i1 = parentIdx;)) , ((ulong i2 = n;));
{
(ref TimeoutEntry lhs = (ulong i = i1;) , ((ref inout(TimeoutEntry) __inlineretval15032 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = r._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = r._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval15032);) , ((ref TimeoutEntry rhs = (ulong i = i2;) , ((ref inout(TimeoutEntry) __inlineretval15033 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = r._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = r._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval15033);));
TimeoutEntry tmp = lhs;
lhs = rhs;
rhs = tmp;
}
}
n = parentIdx;
}
}
}
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) += 1LU;
return 1LU;
}
@system void removeFront()
{
enforce(!((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , !((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU)), delegate const(char)[]() => "Cannot call removeFront on an empty heap.", "/usr/include/dmd/phobos/std/container/binaryheap.d", 318LU);
if (((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) > 1LU)
{
TimeoutEntry t1 = (RangeT!(Array!(TimeoutEntry)) __tmpfordtor7091 = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16228 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16228)).opSlice();) , ((TimeoutEntry __inlineretval16229 = assert(!((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7091;) , this._a >= this._b) && __tmpfordtor7091._a < ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7091;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16155 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16155._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16155._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU)) , ((ref TimeoutEntry source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7091;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16156 = this._outer_[0];) , __inlineretval16156))._data;) , ((ref inout(Payload) __inlineretval16157 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16157))._payload[__tmpfordtor7091._a];) , ((TimeoutEntry __inlineretval16158 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16158));) , __inlineretval16229);
TimeoutEntry t2 = (RangeT!(Array!(TimeoutEntry)) __tmpfordtor7092 = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16230 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16230)).opSlice();) , ((ulong i = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) - 1LU;)) , ((TimeoutEntry __inlineretval16231 = assert(__tmpfordtor7092._a + i < __tmpfordtor7092._b && __tmpfordtor7092._a + i < ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7092;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16163 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16163._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16163._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU)) , ((ref TimeoutEntry source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7092;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16164 = this._outer_[0];) , __inlineretval16164))._data;) , ((ref inout(Payload) __inlineretval16165 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16165))._payload[__tmpfordtor7092._a + i];) , ((TimeoutEntry __inlineretval16166 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16166));) , __inlineretval16231);
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16232 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref inout(TimeoutEntry) __inlineretval16233 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16232._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16232._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];) , __inlineretval16233)) = ((ref TimeoutEntry source = t2;) , ((TimeoutEntry __inlineretval16234 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16234));
((ref Array!(TimeoutEntry) __dop7093 = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16235 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16235);) , ((ulong i = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) - 1LU;) , ((ref inout(TimeoutEntry) __inlineretval16236 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7093._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7093._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16236))) = ((ref TimeoutEntry source = t1;) , ((TimeoutEntry __inlineretval16237 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16237));
}
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) -= 1LU;
percolate(((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16238 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16238)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)));
}
alias popFront = @system void removeFront()
{
enforce(!((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , !((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU)), delegate const(char)[]() => "Cannot call removeFront on an empty heap.", "/usr/include/dmd/phobos/std/container/binaryheap.d", 318LU);
if (((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) > 1LU)
{
TimeoutEntry t1 = (RangeT!(Array!(TimeoutEntry)) __tmpfordtor7091 = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16228 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16228)).opSlice();) , ((TimeoutEntry __inlineretval16229 = assert(!((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7091;) , this._a >= this._b) && __tmpfordtor7091._a < ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7091;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16155 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16155._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16155._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU)) , ((ref TimeoutEntry source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7091;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16156 = this._outer_[0];) , __inlineretval16156))._data;) , ((ref inout(Payload) __inlineretval16157 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16157))._payload[__tmpfordtor7091._a];) , ((TimeoutEntry __inlineretval16158 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16158));) , __inlineretval16229);
TimeoutEntry t2 = (RangeT!(Array!(TimeoutEntry)) __tmpfordtor7092 = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16230 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16230)).opSlice();) , ((ulong i = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) - 1LU;)) , ((TimeoutEntry __inlineretval16231 = assert(__tmpfordtor7092._a + i < __tmpfordtor7092._b && __tmpfordtor7092._a + i < ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7092;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16163 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16163._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16163._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU)) , ((ref TimeoutEntry source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(TimeoutEntry)) this = __tmpfordtor7092;) , ((ref inout(Array!(TimeoutEntry)) __inlineretval16164 = this._outer_[0];) , __inlineretval16164))._data;) , ((ref inout(Payload) __inlineretval16165 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16165))._payload[__tmpfordtor7092._a + i];) , ((TimeoutEntry __inlineretval16166 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16166));) , __inlineretval16231);
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16232 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref inout(TimeoutEntry) __inlineretval16233 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16232._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16232._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];) , __inlineretval16233)) = ((ref TimeoutEntry source = t2;) , ((TimeoutEntry __inlineretval16234 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16234));
((ref Array!(TimeoutEntry) __dop7093 = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16235 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16235);) , ((ulong i = ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) - 1LU;) , ((ref inout(TimeoutEntry) __inlineretval16236 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7093._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7093._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16236))) = ((ref TimeoutEntry source = t1;) , ((TimeoutEntry __inlineretval16237 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14758 = (ref TimeoutEntry source = source;) , ((TimeoutEntry __inlineretval14757 = (TimeoutEntry result = void;) , ((ref TimeoutEntry source = source;) , ((ref TimeoutEntry target = result;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14757);) , __inlineretval14758);) , __inlineretval16237));
}
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) -= 1LU;
percolate(((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16238 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16238)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)));
}
;
@system TimeoutEntry removeAny()
{
this.removeFront();
ref Array!(TimeoutEntry) __dop7754 = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16239 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16239);
return (ulong i = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length);) , ((ref inout(TimeoutEntry) __inlineretval16240 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7754._data;) , ((ref inout(RefCountedStore) __inlineretval14690 = this._refCounted;)) , __inlineretval14690._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7754._data;) , ((ref inout(Payload) __inlineretval14691 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14691))._payload[i];) , __inlineretval16240);
}
nothrow @nogc @system void replaceFront(TimeoutEntry value)
{
assert(!((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , !((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15524 = this._refCounted;)) , __inlineretval15524._store !is null) ? (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length) : 0LU)), "Cannot call replaceFront on an empty heap.");
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16241 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref inout(TimeoutEntry) __inlineretval16242 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16241._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16241._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];) , __inlineretval16242)) = value;
percolate(((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16243 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16243)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)));
}
nothrow @nogc @system bool conditionalInsert(TimeoutEntry value)
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16244 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16244;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16244;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
if (((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) < ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16245 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16245._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16245._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU))
{
this.insert(value);
return true;
}
assert(!((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16246 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16246._data;) , ((ref inout(RefCountedStore) __inlineretval16123 = this._refCounted;)) , __inlineretval16123._store !is null) || ((const(TimeoutEntry[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16246._data;) , ((ref inout(Payload) __inlineretval16124 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16124))._payload;) , !a.length)), "Cannot replace front of an empty heap.");
if (!((ref TimeoutEntry __a = value;) , ((ref TimeoutEntry __b = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16247 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref inout(TimeoutEntry) __inlineretval16248 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16247._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16247._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];) , __inlineretval16248);)) , (alias a = ref TimeoutEntry __a;
;
, (alias b = ref TimeoutEntry __b;
;
) , __a.timeout > __b.timeout)))
return false;
((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16249 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref inout(TimeoutEntry) __inlineretval16250 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16249._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16249._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];) , __inlineretval16250)) = value;
percolate(((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16251 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16251)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)));
return true;
}
nothrow @nogc @system bool conditionalSwap(ref TimeoutEntry value)
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16252 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16252;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16252;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
assert(((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)) == ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16253 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16253._data;) , ((ref inout(RefCountedStore) __inlineretval16129 = this._refCounted;)) , __inlineretval16129._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16253._data;) , ((ref inout(Payload) __inlineretval16130 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16130))._payload.length : 0LU));
assert(!((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16254 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16254._data;) , ((ref inout(RefCountedStore) __inlineretval16123 = this._refCounted;)) , __inlineretval16123._store !is null) || ((const(TimeoutEntry[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16254._data;) , ((ref inout(Payload) __inlineretval16124 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16124))._payload;) , !a.length)), "Cannot swap front of an empty heap.");
if (!((ref TimeoutEntry __a = value;) , ((ref TimeoutEntry __b = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16255 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref inout(TimeoutEntry) __inlineretval16256 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16255._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16255._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];) , __inlineretval16256);)) , (alias a = ref TimeoutEntry __a;
;
, (alias b = ref TimeoutEntry __b;
;
) , __a.timeout > __b.timeout)))
return false;
import std.algorithm.mutation : swap;
{
(ref TimeoutEntry lhs = (ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16257 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;)) , ((ref inout(TimeoutEntry) __inlineretval16258 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16257._data;) , ((ref inout(RefCountedStore) __inlineretval16136 = this._refCounted;)) , __inlineretval16136._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16257._data;) , ((ref inout(Payload) __inlineretval16137 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16137))._payload[0];) , __inlineretval16258);) , ((ref TimeoutEntry rhs = value;));
TimeoutEntry tmp = lhs;
lhs = rhs;
rhs = tmp;
}
percolate(((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , ((ref Array!(TimeoutEntry) __inlineretval16259 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16194 = this._refCounted;)) , __inlineretval16194._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16195 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16195))._store;) , __inlineretval16259)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval15525 = this._refCounted;)) , __inlineretval15525._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval15526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15526))._length)));
return true;
}
}
~this()
{
this._payload.~this();
}
alias __xdtor = ~this()
{
this._payload.~this();
}
;
this(this)
{
this._payload.__postblit();
}
alias __xpostblit = this(this)
{
this._payload.__postblit();
}
;
nothrow @nogc ref return @system BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") opAssign(BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") p)
{
(BinaryHeap!(Array!(TimeoutEntry), "a.timeout > b.timeout") __swap4824 = void;) , __swap4824 = this , this = p;
{
__swap4824._payload.~this();
}
return this;
}
}
__ctor!(TimeoutEntry)
nothrow @nogc @system this(TimeoutEntry[] values...)
{
import std.conv : emplace;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) nbytes = (ulong x = values.length;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
TimeoutEntry* p = cast(TimeoutEntry*)malloc(nbytes);
{
TimeoutEntry[] __r4813 = values[];
ulong __key4812 = 0LU;
for (; __key4812 < __r4813.length; __key4812 += 1LU)
{
TimeoutEntry e = __r4813[__key4812];
ulong i = __key4812;
emplace(p + cast(long)i * 16L, e);
}
}
this._data = 0 , this._data.this(p[0..values.length]);
return this;
}
Array!(void*)
struct Array
{
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memmove, memset;
import core.memory : GC;
import std.exception : enforce;
import std.typecons : RefCounted, RefCountedAutoInitialize;
private struct Payload
{
ulong _capacity;
void*[] _payload;
pure nothrow @nogc @safe this(void*[] p)
{
this._capacity = p.length;
this._payload = p;
return this;
}
~this()
{
{
const(void*) p = cast(const(void*))cast(void**)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(void**)this._payload);
}
this(this)
{
halt;
}
nothrow @nogc @system void opAssign(Payload rhs)
{
try
{
halt;
}
finally
{
{
{
const(void*) p = cast(const(void*))cast(void**)rhs._payload;
gc_removeRange(p);
}
free(cast(void*)cast(void**)rhs._payload);
}
}
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._payload.length;
}
nothrow @nogc @property @system void length(ulong newLength)
{
import std.algorithm.mutation : initializeAll;
if (((ref Payload this = this;) , this._payload.length) >= newLength)
{
this._payload = (cast(void**)this._payload)[0..newLength];
return ;
}
immutable immutable(ulong) startEmplace = (ref Payload this = this;) , this._payload.length;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) nbytes = (ulong x = newLength;) , ((ulong y = 8LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
this._payload = (cast(void**)realloc(cast(void*)cast(void**)this._payload, nbytes))[0..newLength];
{
void*[] range = (cast(void**)this._payload)[startEmplace..newLength];
alias T = void*;
{
(ref void*[] range = range;) , ((void* value = null;));
alias T = void*;
range[] = value;
}
}
this._capacity = newLength;
}
const pure nothrow @nogc @property @safe ulong capacity()
{
return this._capacity;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (elements <= ((ref Payload this = this;) , this._capacity))
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 8LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
immutable immutable(ulong) oldLength = (ref Payload this = this;) , this._payload.length;
void** newPayloadPtr = cast(void**)malloc(sz);
newPayloadPtr || halt;
void*[] newPayload = newPayloadPtr[0..oldLength];
memcpy(cast(void*)cast(void**)newPayload, cast(const(void*))cast(void**)this._payload, 8LU * oldLength);
memset(cast(void*)(cast(void**)newPayload + cast(long)oldLength * 8L), 0, (elements - oldLength) * 8LU);
{
(const(void*) p = cast(const(void*))cast(void**)newPayload;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
const(void*) p = cast(const(void*))cast(void**)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(void**)this._payload);
this._payload = newPayload;
this._capacity = elements;
}
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
if (_capacity == length)
{
reserve(1 + capacity * 3 / 2);
}
assert(capacity > length && _payload.ptr);
emplace(_payload.ptr + _payload.length, stuff);
_payload = _payload.ptr[0.._payload.length + 1];
return 1;
}
size_t insertBack(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
static if (hasLength!Stuff
)
{
immutable oldLength = length;
reserve(oldLength + stuff.length);
}
size_t result;
foreach (item; stuff)
{
insertBack(item);
++result;
}
static if (hasLength!Stuff
)
{
assert(length == oldLength + stuff.length);
}
return result;
}
alias __xdtor = ~this()
{
{
const(void*) p = cast(const(void*))cast(void**)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(void**)this._payload);
}
;
alias __xpostblit = this(this)
{
halt;
}
;
}
private alias Data = RefCounted!(Payload, cast(RefCountedAutoInitialize)0);
private RefCounted!(Payload, cast(RefCountedAutoInitialize)0) _data;
this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)
)
{
import std.conv : emplace;
import core.checkedint : mulu;
bool overflow;
const nbytes = mulu(values.length, T.sizeof, overflow);
if (overflow)
assert(0);
auto p = cast(T*)malloc(nbytes);
static if (hasIndirections!T
)
{
if (p)
GC.addRange(p, T.sizeof * values.length);
}
foreach (i, e; values)
{
emplace(p + i, e);
}
_data = Data(p[0..values.length]);
}
this(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
&& !is(Stuff == T[]))
{
insertBack(stuff);
}
const nothrow @nogc @system bool opEquals(const(Array!(void*)) rhs)
{
try
{
return this.opEquals(rhs);
}
finally
{
{
rhs._data.~this();
}
}
}
const pure nothrow @nogc @safe bool opEquals(ref const(Array!(void*)) rhs)
{
if ((ref const(Array!(void*)) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16260 = this._refCounted;)) , __inlineretval16260._store !is null) || ((const(void*[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16261 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16261))._payload;) , !a.length))
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16260 = this._refCounted;)) , __inlineretval16260._store !is null) || ((const(void*[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16261 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16261))._payload;) , !a.length);
if (!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16260 = this._refCounted;)) , __inlineretval16260._store !is null) || ((const(void*[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16261 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16261))._payload;) , !a.length))
return false;
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16262 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16262))._payload == ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16263 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16263))._payload;
}
alias Range = RangeT!(Array!(void*));
alias ConstRange = RangeT!(const(Array!(void*)));
alias ImmutableRange = RangeT!(immutable(Array!(void*)));
nothrow @nogc @property @system Array!(void*) dup()
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16264 = this._refCounted;)) , __inlineretval16264._store !is null))
return (Array!(void*) __copytmp7765 = (ref Array!(void*) this = __copytmp7765 = this;) , this._data.__postblit();) , __copytmp7765;
return ((Array!(void*) __slArray7764 = Array(RefCounted(RefCountedStore(null)));) , __slArray7764).this(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16265 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16265))._payload);
}
const pure nothrow @nogc @property @safe bool empty()
{
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16260 = this._refCounted;)) , __inlineretval16260._store !is null) || ((const(void*[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16261 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16261))._payload;) , !a.length);
}
const pure nothrow @nogc @property @safe ulong length()
{
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU;
}
const pure nothrow @nogc @safe ulong opDollar()
{
return (ref const(Array!(void*)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU;
}
pure nothrow @nogc @property @safe ulong capacity()
{
return ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16266 = this._refCounted;)) , __inlineretval16266._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16267 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16267))._capacity : 0LU;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16268 = this._refCounted;)) , __inlineretval16268._store !is null))
{
if (!elements)
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 8LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
void* p = malloc(sz);
p || halt;
{
(const(void*) p = p;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = ((RefCounted!(Payload, cast(RefCountedAutoInitialize)0) __slRefCo7766 = RefCounted(RefCountedStore(null));) , __slRefCo7766).this(cast(void*[])p[0..0]);
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16269 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16269))._capacity = elements;
}
else
{
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16270 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16270)).reserve(elements);
}
}
nothrow @nogc @system RangeT!(Array!(void*)) opSlice()
{
return (RangeT!(Array!(void*)) __slRange7213 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(void*) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref Array!(void*) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU;))) , (__slRange7213._outer_[] = data , __slRange7213._a = a , __slRange7213._b = b , __slRange7213);
}
const nothrow @nogc @system RangeT!(const(Array!(void*))) opSlice()
{
return (RangeT!(const(Array!(void*))) __slRange7767 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(void*)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref const(Array!(void*)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU;))) , (__slRange7767._outer_[] = data , __slRange7767._a = a , __slRange7767._b = b , __slRange7767);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(void*))) opSlice()
{
return (RangeT!(immutable(Array!(void*))) __slRange7768 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(void*)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref immutable(Array!(void*)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU;))) , (__slRange7768._outer_[] = data , __slRange7768._a = a , __slRange7768._b = b , __slRange7768);
}
nothrow @nogc @system RangeT!(Array!(void*)) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref Array!(void*) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU));
return (RangeT!(Array!(void*)) __slRange7345 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(void*) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7345._outer_[] = data , __slRange7345._a = a , __slRange7345._b = b , __slRange7345);
}
const nothrow @nogc @system RangeT!(const(Array!(void*))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref const(Array!(void*)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU));
return (RangeT!(const(Array!(void*))) __slRange7769 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(void*)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7769._outer_[] = data , __slRange7769._a = a , __slRange7769._b = b , __slRange7769);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(void*))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref immutable(Array!(void*)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU));
return (RangeT!(immutable(Array!(void*))) __slRange7770 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(void*)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7770._outer_[] = data , __slRange7770._a = a , __slRange7770._b = b , __slRange7770);
}
inout pure nothrow @nogc @property ref @safe inout(void*) front()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16271 = this._refCounted;)) , __inlineretval16271._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16272 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16272))._payload[0];
}
inout pure nothrow @nogc @property ref @safe inout(void*) back()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16273 = this._refCounted;)) , __inlineretval16273._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16274 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16274))._payload[__dollar - 1LU];
}
inout pure nothrow @nogc ref @safe inout(void*) opIndex(ulong i)
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i];
}
pure nothrow @nogc @safe void opSliceAssign(void* value)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16275 = this._refCounted;)) , __inlineretval16275._store !is null))
return ;
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16276 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16276))._payload[] = value;
}
pure nothrow @nogc @safe void opSliceAssign(void* value, ulong i, ulong j)
{
void*[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16277 = this._refCounted;)) , __inlineretval16277._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16278 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16278))._payload : null;
slice[i..j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin(op ~ "_data._payload[];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin(op ~ "slice[i .. j];");
}
void opSliceOpAssign(string op)(T value)
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin("_data._payload[] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(T value, size_t i, size_t j)
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin("slice[i .. j] " ~ op ~ "= value;");
}
Array opBinary(string op, Stuff)(Stuff stuff) if (op == "~")
{
Array result;
result ~= this[];
assert(result.length == length);
result ~= stuff[];
return result;
}
void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~")
{
static if (is(typeof(stuff[])))
{
insertBack(stuff[]);
}
else
{
insertBack(stuff);
}
}
nothrow @nogc @system void clear()
{
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
nothrow @nogc @property @system void length(ulong newLength)
{
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16279 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16279;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16279;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16280 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16280)).length(newLength);
}
pure @safe void* removeAny()
{
void* result = (ref Array!(void*) this = this;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16273 = this._refCounted;)) , __inlineretval16273._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16274 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16274))._payload[__dollar - 1LU]);
this.removeBack();
return result;
}
alias stableRemoveAny = pure @safe void* removeAny()
{
void* result = (ref Array!(void*) this = this;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16273 = this._refCounted;)) , __inlineretval16273._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16274 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16274))._payload[__dollar - 1LU]);
this.removeBack();
return result;
}
;
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
alias insert = size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
;
pure @safe void removeBack()
{
enforce(!((ref Array!(void*) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16260 = this._refCounted;)) , __inlineretval16260._store !is null) || ((const(void*[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16261 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16261))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16281 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16281))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16282 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16282))._payload[0..__dollar - 1LU];
}
alias stableRemoveBack = void stableRemoveBack();
;
pure nothrow @nogc @safe ulong removeBack(ulong howMany)
{
if (howMany > ((ref Array!(void*) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU))
howMany = ((ref Array!(void*) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16283 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16283))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16284 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16284))._payload[0..__dollar - howMany];
return howMany;
}
alias stableRemoveBack = pure @safe void removeBack()
{
enforce(!((ref Array!(void*) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16260 = this._refCounted;)) , __inlineretval16260._store !is null) || ((const(void*[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16261 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16261))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16281 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16281))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16282 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16282))._payload[0..__dollar - 1LU];
}
;
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
reserve(length + 1);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + 1, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
emplace(_data._payload.ptr + r._a, stuff);
_data._payload = _data._payload.ptr[0.._data._payload.length + 1];
return 1;
}
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
static if (isForwardRange!Stuff
)
{
auto extra = walkLength(stuff);
if (!extra)
return 0;
reserve(length + extra);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + extra, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
foreach (p; _data._payload.ptr + r._a .. _data._payload.ptr + r._a + extra)
{
emplace(p, stuff.front);
stuff.popFront();
}
_data._payload = _data._payload.ptr[0.._data._payload.length + extra];
return extra;
}
else
{
import std.algorithm.mutation : bringToFront;
enforce(_data);
immutable offset = r._a;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
}
size_t insertAfter(Stuff)(Range r, Stuff stuff)
{
import std.algorithm.mutation : bringToFront;
enforce(r._outer._data is _data);
immutable offset = r._b;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
enforce(r._outer._data is _data);
size_t result;
for (; !stuff.empty; stuff.popFront())
{
{
if (r.empty)
{
return result + insertBefore(r, stuff);
}
r.front = stuff.front;
r.popFront();
++result;
}
}
linearRemove(r);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
enforce(r._outer._data is _data);
if (r.empty)
{
insertBefore(r, stuff);
}
else
{
r.front = stuff;
r.popFront();
linearRemove(r);
}
return 1;
}
@system RangeT!(Array!(void*)) linearRemove(RangeT!(Array!(void*)) r)
{
try
{
import std.algorithm.mutation : copy;
enforce(((ref inout(Array!(void*)) __inlineretval16285 = r._outer_[0];) , __inlineretval16285)._data is this._data, delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 988LU);
enforce(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16286 = this._refCounted;)) , __inlineretval16286._store !is null), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 989LU);
enforce(r._a <= r._b && r._b <= ((ref Array!(void*) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 990LU);
immutable immutable(ulong) offset1 = r._a;
immutable immutable(ulong) offset2 = r._b;
immutable immutable(ulong) tailLength = ((ref Array!(void*) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU) - offset2;
(RangeT!(Array!(void*)) __tmpfordtor7349 = copy(this.opSlice(offset2, ((ref Array!(void*) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU)), this.opSlice(offset1, offset1 + tailLength));) , __tmpfordtor7349;
{
ref Array!(void*) this = this;
ulong newLength = offset1 + tailLength;
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16279 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16279;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16279;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16280 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16280)).length(newLength);
}
return this.opSlice(((ref Array!(void*) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU) - tailLength, ((ref Array!(void*) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU));
}
finally
{
{
{
Array!(void*)[] a = (&r._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
}
}
~this()
{
this._data.~this();
}
alias __xdtor = ~this()
{
this._data.~this();
}
;
this(this)
{
this._data.__postblit();
}
alias __xpostblit = this(this)
{
this._data.__postblit();
}
;
nothrow @nogc ref return @system Array!(void*) opAssign(Array!(void*) p)
{
(Array!(void*) __swap4835 = void;) , __swap4835 = this , this = p;
{
__swap4835._data.~this();
}
return this;
}
}
RangeT!(Array!(void*))
struct RangeT
{
private Array!(void*)[1] _outer_;
private inout pure nothrow @nogc @property ref @safe inout(Array!(void*)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = void*;
private nothrow @nogc @system this(ref Array!(void*) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(Array!(void*)) save()
{
return (RangeT!(Array!(void*)) __copytmp4850 = (__copytmp4850 = this).__fieldPostblit();) , __copytmp4850;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(void*) front()
{
assert(!((ref inout(RangeT!(Array!(void*))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
inout ref inout(Array!(void*)) __dop4851 = (ref inout(RangeT!(Array!(void*))) this = this;) , ((ref inout(Array!(void*)) __inlineretval14680 = this._outer_[0];) , __inlineretval14680);
return (ulong i = this._a;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4851._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4851._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]);
}
inout pure nothrow @nogc @property ref @safe inout(void*) back()
{
assert(!((ref inout(RangeT!(Array!(void*))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
inout ref inout(Array!(void*)) __dop4852 = (ref inout(RangeT!(Array!(void*))) this = this;) , ((ref inout(Array!(void*)) __inlineretval16287 = this._outer_[0];) , __inlineretval16287);
return (ulong i = this._b - 1LU;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4852._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4852._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(Array!(void*)) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(Array!(void*)) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(Array!(void*))
enum bool isMutable = true;
)
{
import std.algorithm.mutation : move;
pure nothrow @nogc @safe void* moveFront()
{
assert(!((ref RangeT!(Array!(void*)) this = this;) , this._a >= this._b) && this._a < ((ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16288 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16288._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16288._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU));
return (ref void* source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16289 = this._outer_[0];) , __inlineretval16289))._data;) , ((ref inout(Payload) __inlineretval16290 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16290))._payload[this._a];) , ((ref void* source = source;) , ((ref void* source = source;) , ((void* result = void;) , ((ref void* source = source;) , ((ref void* target = result;)) , (!__ctfe && assert(!((ref const(void*) source = source;) , ((ref const(void*) target = source;)) , ((const const(void*) m = source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Cannot move object with internal pointer.") , target = source)) , result)));
}
pure nothrow @nogc @safe void* moveBack()
{
assert(!((ref RangeT!(Array!(void*)) this = this;) , this._a >= this._b) && this._b <= ((ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16291 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16291._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16291._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU));
return (ref void* source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16292 = this._outer_[0];) , __inlineretval16292))._data;) , ((ref inout(Payload) __inlineretval16293 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16293))._payload[this._b - 1LU];) , ((ref void* source = source;) , ((ref void* source = source;) , ((void* result = void;) , ((ref void* source = source;) , ((ref void* target = result;)) , (!__ctfe && assert(!((ref const(void*) source = source;) , ((ref const(void*) target = source;)) , ((const const(void*) m = source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Cannot move object with internal pointer.") , target = source)) , result)));
}
pure nothrow @nogc @safe void* moveAt(ulong i)
{
assert(this._a + i < this._b && this._a + i < ((ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16294 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16294._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16294._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU));
return (ref void* source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16295 = this._outer_[0];) , __inlineretval16295))._data;) , ((ref inout(Payload) __inlineretval16296 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16296))._payload[this._a + i];) , ((ref void* source = source;) , ((ref void* source = source;) , ((void* result = void;) , ((ref void* source = source;) , ((ref void* target = result;)) , (!__ctfe && assert(!((ref const(void*) source = source;) , ((ref const(void*) target = source;)) , ((const const(void*) m = source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Cannot move object with internal pointer.") , target = source)) , result)));
}
}
inout pure nothrow @nogc ref @safe inout(void*) opIndex(ulong i)
{
assert(this._a + i < this._b);
inout ref inout(Array!(void*)) __dop4854 = (ref inout(RangeT!(Array!(void*))) this = this;) , ((ref inout(Array!(void*)) __inlineretval15058 = this._outer_[0];) , __inlineretval15058);
return (ulong i = this._a + i;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4854._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4854._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]);
}
nothrow @nogc @system RangeT!(Array!(void*)) opSlice()
{
return (RangeT!(Array!(void*)) __slRange4855 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(void*) data = (ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16297 = this._outer_[0];) , __inlineretval16297);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4855._outer_[] = data , __slRange4855._a = a , __slRange4855._b = b , __slRange4855);
}
nothrow @nogc @system RangeT!(Array!(void*)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(Array!(void*)) __slRange4856 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(void*) data = (ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16298 = this._outer_[0];) , __inlineretval16298);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4856._outer_[] = data , __slRange4856._a = a , __slRange4856._b = b , __slRange4856);
}
const nothrow @nogc @system RangeT!(const(Array!(void*))) opSlice()
{
return (RangeT!(const(Array!(void*))) __slRange4857 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(void*)) data = (ref const(RangeT!(Array!(void*))) this = this;) , ((ref inout(Array!(void*)) __inlineretval16299 = this._outer_[0];) , __inlineretval16299);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4857._outer_[] = data , __slRange4857._a = a , __slRange4857._b = b , __slRange4857);
}
const nothrow @nogc @system RangeT!(const(Array!(void*))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(void*))) __slRange4858 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(void*)) data = (ref const(RangeT!(Array!(void*))) this = this;) , ((ref inout(Array!(void*)) __inlineretval16300 = this._outer_[0];) , __inlineretval16300);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4858._outer_[] = data , __slRange4858._a = a , __slRange4858._b = b , __slRange4858);
}
static if (isMutable!(Array!(void*))
)
{
pure nothrow @nogc @safe void opSliceAssign(void* value)
{
assert(this._b <= ((ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16301 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16301._data;) , ((ref inout(RefCountedStore) __inlineretval15622 = this._refCounted;)) , __inlineretval15622._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16301._data;) , ((ref inout(Payload) __inlineretval15623 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15623))._payload.length : 0LU));
{
(ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16302 = this._outer_[0];));
(void* value = value;) , ((ulong i = this._a;)) , ((ulong j = this._b;));
void*[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16302._data;) , ((ref inout(RefCountedStore) __inlineretval16277 = this._refCounted;)) , __inlineretval16277._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16302._data;) , ((ref inout(Payload) __inlineretval16278 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16278))._payload : null;
slice[i..j] = value;
}
}
pure nothrow @nogc @safe void opSliceAssign(void* value, ulong i, ulong j)
{
assert(this._a + j <= this._b);
{
(ref RangeT!(Array!(void*)) this = this;) , ((ref inout(Array!(void*)) __inlineretval16303 = this._outer_[0];));
(void* value = value;) , ((ulong i = this._a + i;)) , ((ulong j = this._a + j;));
void*[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16303._data;) , ((ref inout(RefCountedStore) __inlineretval16277 = this._refCounted;)) , __inlineretval16277._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16303._data;) , ((ref inout(Payload) __inlineretval16278 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16278))._payload : null;
slice[i..j] = value;
}
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(void*)[] a = (&this._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(void*)[] a = (&this._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(void*)[] a = (&this._outer_)[0..1];
{
Array!(void*)[] __r4838 = a[];
ulong __key4839 = 0LU;
for (; __key4839 < __r4838.length; __key4839 += 1LU)
{
ref Array!(void*) e = __r4838[__key4839];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(void*)[] a = (&this._outer_)[0..1];
{
Array!(void*)[] __r4838 = a[];
ulong __key4839 = 0LU;
for (; __key4839 < __r4838.length; __key4839 += 1LU)
{
ref Array!(void*) e = __r4838[__key4839];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(Array!(void*)) opAssign(RangeT!(Array!(void*)) p)
{
(RangeT!(Array!(void*)) __swap4849 = void;) , __swap4849 = this , this = p;
{
{
Array!(void*)[] a = (&__swap4849._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(const(Array!(void*)))
struct RangeT
{
private const const(Array!(void*)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe inout(const(Array!(void*))) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = const(void*);
private nothrow @nogc @system this(ref const(Array!(void*)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(const(Array!(void*))) save()
{
return (RangeT!(const(Array!(void*))) __copytmp4837 = (__copytmp4837 = this).__fieldPostblit();) , __copytmp4837;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(const(void*)) front()
{
assert(!((ref inout(RangeT!(const(Array!(void*)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
const ref inout(const(Array!(void*))) __dop4842 = (ref inout(RangeT!(const(Array!(void*)))) this = this;) , ((ref inout(const(Array!(void*))) __inlineretval16304 = this._outer_[0];) , __inlineretval16304);
return (ulong i = this._a;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4842._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4842._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]);
}
inout pure nothrow @nogc @property ref @safe inout(const(void*)) back()
{
assert(!((ref inout(RangeT!(const(Array!(void*)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
const ref inout(const(Array!(void*))) __dop4843 = (ref inout(RangeT!(const(Array!(void*)))) this = this;) , ((ref inout(const(Array!(void*))) __inlineretval16305 = this._outer_[0];) , __inlineretval16305);
return (ulong i = this._b - 1LU;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4843._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4843._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(const(Array!(void*))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(const(Array!(void*))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(const(Array!(void*)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe inout(const(void*)) opIndex(ulong i)
{
assert(this._a + i < this._b);
const ref inout(const(Array!(void*))) __dop4844 = (ref inout(RangeT!(const(Array!(void*)))) this = this;) , ((ref inout(const(Array!(void*))) __inlineretval16306 = this._outer_[0];) , __inlineretval16306);
return (ulong i = this._a + i;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4844._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4844._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]);
}
nothrow @nogc @system RangeT!(const(Array!(void*))) opSlice()
{
return (RangeT!(const(Array!(void*))) __slRange4845 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(void*)) data = (ref RangeT!(const(Array!(void*))) this = this;) , ((ref inout(const(Array!(void*))) __inlineretval16307 = this._outer_[0];) , __inlineretval16307);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4845._outer_[] = data , __slRange4845._a = a , __slRange4845._b = b , __slRange4845);
}
nothrow @nogc @system RangeT!(const(Array!(void*))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(void*))) __slRange4846 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(void*)) data = (ref RangeT!(const(Array!(void*))) this = this;) , ((ref inout(const(Array!(void*))) __inlineretval16308 = this._outer_[0];) , __inlineretval16308);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4846._outer_[] = data , __slRange4846._a = a , __slRange4846._b = b , __slRange4846);
}
const nothrow @nogc @system RangeT!(const(Array!(void*))) opSlice()
{
return (RangeT!(const(Array!(void*))) __slRange4847 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(void*)) data = (ref const(RangeT!(const(Array!(void*)))) this = this;) , ((ref inout(const(Array!(void*))) __inlineretval16309 = this._outer_[0];) , __inlineretval16309);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4847._outer_[] = data , __slRange4847._a = a , __slRange4847._b = b , __slRange4847);
}
const nothrow @nogc @system RangeT!(const(Array!(void*))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(void*))) __slRange4848 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(void*)) data = (ref const(RangeT!(const(Array!(void*)))) this = this;) , ((ref inout(const(Array!(void*))) __inlineretval16310 = this._outer_[0];) , __inlineretval16310);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4848._outer_[] = data , __slRange4848._a = a , __slRange4848._b = b , __slRange4848);
}
static if (isMutable!(const(Array!(void*)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(void*)[] a = (&this._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(void*)[] a = (&this._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(void*)[] a = (&this._outer_)[0..1];
{
Array!(void*)[] __r4838 = a[];
ulong __key4839 = 0LU;
for (; __key4839 < __r4838.length; __key4839 += 1LU)
{
ref Array!(void*) e = __r4838[__key4839];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(void*)[] a = (&this._outer_)[0..1];
{
Array!(void*)[] __r4838 = a[];
ulong __key4839 = 0LU;
for (; __key4839 < __r4838.length; __key4839 += 1LU)
{
ref Array!(void*) e = __r4838[__key4839];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(const(Array!(void*))) opAssign(RangeT!(const(Array!(void*))) p)
{
(RangeT!(const(Array!(void*))) __swap4836 = void;) , __swap4836 = this , this = p;
{
{
Array!(void*)[] a = (&__swap4836._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(immutable(Array!(void*)))
struct RangeT
{
private immutable immutable(Array!(void*)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe immutable(Array!(void*)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = immutable(void*);
private nothrow @nogc @system this(ref immutable(Array!(void*)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(immutable(Array!(void*))) save()
{
return (RangeT!(immutable(Array!(void*))) __copytmp4860 = (__copytmp4860 = this).__fieldPostblit();) , __copytmp4860;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe immutable(void*) front()
{
assert(!((ref inout(RangeT!(immutable(Array!(void*)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
immutable ref immutable(Array!(void*)) __dop4861 = (ref inout(RangeT!(immutable(Array!(void*)))) this = this;) , ((ref immutable(Array!(void*)) __inlineretval16311 = this._outer_[0];) , __inlineretval16311);
return (ulong i = this._a;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4861._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4861._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]);
}
inout pure nothrow @nogc @property ref @safe immutable(void*) back()
{
assert(!((ref inout(RangeT!(immutable(Array!(void*)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
immutable ref immutable(Array!(void*)) __dop4862 = (ref inout(RangeT!(immutable(Array!(void*)))) this = this;) , ((ref immutable(Array!(void*)) __inlineretval16312 = this._outer_[0];) , __inlineretval16312);
return (ulong i = this._b - 1LU;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4862._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4862._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(immutable(Array!(void*))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(immutable(Array!(void*))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(immutable(Array!(void*)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe immutable(void*) opIndex(ulong i)
{
assert(this._a + i < this._b);
immutable ref immutable(Array!(void*)) __dop4863 = (ref inout(RangeT!(immutable(Array!(void*)))) this = this;) , ((ref immutable(Array!(void*)) __inlineretval16313 = this._outer_[0];) , __inlineretval16313);
return (ulong i = this._a + i;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4863._data;) , ((ref inout(RefCountedStore) __inlineretval14681 = this._refCounted;)) , __inlineretval14681._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4863._data;) , ((ref inout(Payload) __inlineretval14682 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14682))._payload[i]);
}
nothrow @nogc @system RangeT!(immutable(Array!(void*))) opSlice()
{
return (RangeT!(immutable(Array!(void*))) __slRange4864 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(void*)) data = (ref RangeT!(immutable(Array!(void*))) this = this;) , ((ref immutable(Array!(void*)) __inlineretval16314 = this._outer_[0];) , __inlineretval16314);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4864._outer_[] = data , __slRange4864._a = a , __slRange4864._b = b , __slRange4864);
}
nothrow @nogc @system RangeT!(immutable(Array!(void*))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(void*))) __slRange4865 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(void*)) data = (ref RangeT!(immutable(Array!(void*))) this = this;) , ((ref immutable(Array!(void*)) __inlineretval16315 = this._outer_[0];) , __inlineretval16315);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4865._outer_[] = data , __slRange4865._a = a , __slRange4865._b = b , __slRange4865);
}
const nothrow @nogc @system RangeT!(immutable(Array!(void*))) opSlice()
{
return (RangeT!(immutable(Array!(void*))) __slRange4866 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(void*)) data = (ref const(RangeT!(immutable(Array!(void*)))) this = this;) , ((ref immutable(Array!(void*)) __inlineretval16316 = this._outer_[0];) , __inlineretval16316);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4866._outer_[] = data , __slRange4866._a = a , __slRange4866._b = b , __slRange4866);
}
const nothrow @nogc @system RangeT!(immutable(Array!(void*))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(void*))) __slRange4867 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(void*)) data = (ref const(RangeT!(immutable(Array!(void*)))) this = this;) , ((ref immutable(Array!(void*)) __inlineretval16317 = this._outer_[0];) , __inlineretval16317);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4867._outer_[] = data , __slRange4867._a = a , __slRange4867._b = b , __slRange4867);
}
static if (isMutable!(immutable(Array!(void*)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(void*)[] a = (cast(Array!(void*)*)&this._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(void*)[] a = (cast(Array!(void*)*)&this._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(void*)[] a = (cast(Array!(void*)*)&this._outer_)[0..1];
{
Array!(void*)[] __r4838 = a[];
ulong __key4839 = 0LU;
for (; __key4839 < __r4838.length; __key4839 += 1LU)
{
ref Array!(void*) e = __r4838[__key4839];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(void*)[] a = (cast(Array!(void*)*)&this._outer_)[0..1];
{
Array!(void*)[] __r4838 = a[];
ulong __key4839 = 0LU;
for (; __key4839 < __r4838.length; __key4839 += 1LU)
{
ref Array!(void*) e = __r4838[__key4839];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(immutable(Array!(void*))) opAssign(RangeT!(immutable(Array!(void*))) p)
{
(RangeT!(immutable(Array!(void*))) __swap4859 = void;) , __swap4859 = this , this = p;
{
{
Array!(void*)[] a = (cast(Array!(void*)*)&__swap4859._outer_)[0..1];
{
Array!(void*)[] __r4840 = a[];
ulong __key4841 = __r4840.length;
for (; __key4841--;)
{
ref Array!(void*) e = __r4840[__key4841];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
static __gshared TypeInfo_Const _D52TypeInfo_xS3std9container5array13__T5ArrayTPvZ5Array6__initZ;
static __gshared TypeInfo_Const _D54TypeInfo_xG1S3std9container5array13__T5ArrayTPvZ5Array6__initZ;
static __gshared TypeInfo_Struct _D51TypeInfo_S3std9container5array13__T5ArrayTPvZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D52TypeInfo_yS3std9container5array13__T5ArrayTPvZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D54TypeInfo_yG1S3std9container5array13__T5ArrayTPvZ5Array6__initZ;
Array!(DirectoryChange)
struct Array
{
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memmove, memset;
import core.memory : GC;
import std.exception : enforce;
import std.typecons : RefCounted, RefCountedAutoInitialize;
private struct Payload
{
ulong _capacity;
DirectoryChange[] _payload;
pure nothrow @nogc @safe this(DirectoryChange[] p)
{
this._capacity = p.length;
this._payload = p;
return this;
}
~this()
{
{
const(void*) p = cast(const(void*))cast(DirectoryChange*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(DirectoryChange*)this._payload);
}
this(this)
{
halt;
}
nothrow @nogc @system void opAssign(Payload rhs)
{
try
{
halt;
}
finally
{
{
{
const(void*) p = cast(const(void*))cast(DirectoryChange*)rhs._payload;
gc_removeRange(p);
}
free(cast(void*)cast(DirectoryChange*)rhs._payload);
}
}
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._payload.length;
}
nothrow @nogc @property @system void length(ulong newLength)
{
import std.algorithm.mutation : initializeAll;
if (((ref Payload this = this;) , this._payload.length) >= newLength)
{
this._payload = (cast(DirectoryChange*)this._payload)[0..newLength];
return ;
}
immutable immutable(ulong) startEmplace = (ref Payload this = this;) , this._payload.length;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) nbytes = (ulong x = newLength;) , ((ulong y = 32LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
this._payload = (cast(DirectoryChange*)realloc(cast(void*)cast(DirectoryChange*)this._payload, nbytes))[0..newLength];
{
DirectoryChange[] range = (cast(DirectoryChange*)this._payload)[startEmplace..newLength];
alias T = DirectoryChange;
{
(ref DirectoryChange[] range = range;) , ((DirectoryChange value = DirectoryChange(DirectoryChangeType.added, Path(null, false, false));));
alias T = DirectoryChange;
range[] = value;
}
}
this._capacity = newLength;
}
const pure nothrow @nogc @property @safe ulong capacity()
{
return this._capacity;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (elements <= ((ref Payload this = this;) , this._capacity))
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 32LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
immutable immutable(ulong) oldLength = (ref Payload this = this;) , this._payload.length;
DirectoryChange* newPayloadPtr = cast(DirectoryChange*)malloc(sz);
newPayloadPtr || halt;
DirectoryChange[] newPayload = newPayloadPtr[0..oldLength];
memcpy(cast(void*)cast(DirectoryChange*)newPayload, cast(const(void*))cast(DirectoryChange*)this._payload, 32LU * oldLength);
memset(cast(void*)(cast(DirectoryChange*)newPayload + cast(long)oldLength * 32L), 0, (elements - oldLength) * 32LU);
{
(const(void*) p = cast(const(void*))cast(DirectoryChange*)newPayload;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
const(void*) p = cast(const(void*))cast(DirectoryChange*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(DirectoryChange*)this._payload);
this._payload = newPayload;
this._capacity = elements;
}
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
if (_capacity == length)
{
reserve(1 + capacity * 3 / 2);
}
assert(capacity > length && _payload.ptr);
emplace(_payload.ptr + _payload.length, stuff);
_payload = _payload.ptr[0.._payload.length + 1];
return 1;
}
size_t insertBack(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
static if (hasLength!Stuff
)
{
immutable oldLength = length;
reserve(oldLength + stuff.length);
}
size_t result;
foreach (item; stuff)
{
insertBack(item);
++result;
}
static if (hasLength!Stuff
)
{
assert(length == oldLength + stuff.length);
}
return result;
}
alias __xdtor = ~this()
{
{
const(void*) p = cast(const(void*))cast(DirectoryChange*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(DirectoryChange*)this._payload);
}
;
alias __xpostblit = this(this)
{
halt;
}
;
}
private alias Data = RefCounted!(Payload, cast(RefCountedAutoInitialize)0);
private RefCounted!(Payload, cast(RefCountedAutoInitialize)0) _data;
this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)
)
{
import std.conv : emplace;
import core.checkedint : mulu;
bool overflow;
const nbytes = mulu(values.length, T.sizeof, overflow);
if (overflow)
assert(0);
auto p = cast(T*)malloc(nbytes);
static if (hasIndirections!T
)
{
if (p)
GC.addRange(p, T.sizeof * values.length);
}
foreach (i, e; values)
{
emplace(p + i, e);
}
_data = Data(p[0..values.length]);
}
this(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
&& !is(Stuff == T[]))
{
insertBack(stuff);
}
const nothrow @nogc @system bool opEquals(const(Array!(DirectoryChange)) rhs)
{
try
{
return this.opEquals(rhs);
}
finally
{
{
rhs._data.~this();
}
}
}
const pure nothrow @nogc @safe bool opEquals(ref const(Array!(DirectoryChange)) rhs)
{
if ((ref const(Array!(DirectoryChange)) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15571 = this._refCounted;)) , __inlineretval15571._store !is null) || ((const(DirectoryChange[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15572 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15572))._payload;) , !a.length))
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval15571 = this._refCounted;)) , __inlineretval15571._store !is null) || ((const(DirectoryChange[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval15572 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15572))._payload;) , !a.length);
if (!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval15571 = this._refCounted;)) , __inlineretval15571._store !is null) || ((const(DirectoryChange[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval15572 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15572))._payload;) , !a.length))
return false;
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16318 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16318))._payload == ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16319 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16319))._payload;
}
alias Range = RangeT!(Array!(DirectoryChange));
alias ConstRange = RangeT!(const(Array!(DirectoryChange)));
alias ImmutableRange = RangeT!(immutable(Array!(DirectoryChange)));
nothrow @nogc @property @system Array!(DirectoryChange) dup()
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16320 = this._refCounted;)) , __inlineretval16320._store !is null))
return (Array!(DirectoryChange) __copytmp7779 = (ref Array!(DirectoryChange) this = __copytmp7779 = this;) , this._data.__postblit();) , __copytmp7779;
return ((Array!(DirectoryChange) __slArray7778 = Array(RefCounted(RefCountedStore(null)));) , __slArray7778).this(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16321 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16321))._payload);
}
const pure nothrow @nogc @property @safe bool empty()
{
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15571 = this._refCounted;)) , __inlineretval15571._store !is null) || ((const(DirectoryChange[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15572 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15572))._payload;) , !a.length);
}
const pure nothrow @nogc @property @safe ulong length()
{
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU;
}
const pure nothrow @nogc @safe ulong opDollar()
{
return (ref const(Array!(DirectoryChange)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU;
}
pure nothrow @nogc @property @safe ulong capacity()
{
return ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16324 = this._refCounted;)) , __inlineretval16324._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16325 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16325))._capacity : 0LU;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16326 = this._refCounted;)) , __inlineretval16326._store !is null))
{
if (!elements)
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 32LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
void* p = malloc(sz);
p || halt;
{
(const(void*) p = p;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = ((RefCounted!(Payload, cast(RefCountedAutoInitialize)0) __slRefCo7780 = RefCounted(RefCountedStore(null));) , __slRefCo7780).this(cast(DirectoryChange[])p[0..0]);
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16327 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16327))._capacity = elements;
}
else
{
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16328 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16328)).reserve(elements);
}
}
nothrow @nogc @system RangeT!(Array!(DirectoryChange)) opSlice()
{
return (RangeT!(Array!(DirectoryChange)) __slRange7159 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(DirectoryChange) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref Array!(DirectoryChange) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU;))) , (__slRange7159._outer_[] = data , __slRange7159._a = a , __slRange7159._b = b , __slRange7159);
}
const nothrow @nogc @system RangeT!(const(Array!(DirectoryChange))) opSlice()
{
return (RangeT!(const(Array!(DirectoryChange))) __slRange7781 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(DirectoryChange)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref const(Array!(DirectoryChange)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU;))) , (__slRange7781._outer_[] = data , __slRange7781._a = a , __slRange7781._b = b , __slRange7781);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(DirectoryChange))) opSlice()
{
return (RangeT!(immutable(Array!(DirectoryChange))) __slRange7782 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(DirectoryChange)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref immutable(Array!(DirectoryChange)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU;))) , (__slRange7782._outer_[] = data , __slRange7782._a = a , __slRange7782._b = b , __slRange7782);
}
nothrow @nogc @system RangeT!(Array!(DirectoryChange)) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref Array!(DirectoryChange) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU));
return (RangeT!(Array!(DirectoryChange)) __slRange7783 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(DirectoryChange) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7783._outer_[] = data , __slRange7783._a = a , __slRange7783._b = b , __slRange7783);
}
const nothrow @nogc @system RangeT!(const(Array!(DirectoryChange))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref const(Array!(DirectoryChange)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU));
return (RangeT!(const(Array!(DirectoryChange))) __slRange7784 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(DirectoryChange)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7784._outer_[] = data , __slRange7784._a = a , __slRange7784._b = b , __slRange7784);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(DirectoryChange))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref immutable(Array!(DirectoryChange)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU));
return (RangeT!(immutable(Array!(DirectoryChange))) __slRange7785 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(DirectoryChange)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7785._outer_[] = data , __slRange7785._a = a , __slRange7785._b = b , __slRange7785);
}
inout pure nothrow @nogc @property ref @safe inout(DirectoryChange) front()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16329 = this._refCounted;)) , __inlineretval16329._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16330 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16330))._payload[0];
}
inout pure nothrow @nogc @property ref @safe inout(DirectoryChange) back()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16331 = this._refCounted;)) , __inlineretval16331._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16332 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16332))._payload[__dollar - 1LU];
}
inout pure nothrow @nogc ref @safe inout(DirectoryChange) opIndex(ulong i)
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];
}
pure nothrow @nogc @safe void opSliceAssign(DirectoryChange value)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16333 = this._refCounted;)) , __inlineretval16333._store !is null))
return ;
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16334 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16334))._payload[] = value;
}
pure nothrow @nogc @safe void opSliceAssign(DirectoryChange value, ulong i, ulong j)
{
DirectoryChange[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16335 = this._refCounted;)) , __inlineretval16335._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16336 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16336))._payload : null;
slice[i..j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin(op ~ "_data._payload[];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin(op ~ "slice[i .. j];");
}
void opSliceOpAssign(string op)(T value)
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin("_data._payload[] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(T value, size_t i, size_t j)
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin("slice[i .. j] " ~ op ~ "= value;");
}
Array opBinary(string op, Stuff)(Stuff stuff) if (op == "~")
{
Array result;
result ~= this[];
assert(result.length == length);
result ~= stuff[];
return result;
}
void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~")
{
static if (is(typeof(stuff[])))
{
insertBack(stuff[]);
}
else
{
insertBack(stuff);
}
}
nothrow @nogc @system void clear()
{
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
nothrow @nogc @property @system void length(ulong newLength)
{
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16337 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16337;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16337;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16338 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16338)).length(newLength);
}
pure @safe DirectoryChange removeAny()
{
DirectoryChange result = (ref Array!(DirectoryChange) this = this;) , ((ref inout(DirectoryChange) __inlineretval16339 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16331 = this._refCounted;)) , __inlineretval16331._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16332 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16332))._payload[__dollar - 1LU];) , __inlineretval16339);
this.removeBack();
return result;
}
alias stableRemoveAny = pure @safe DirectoryChange removeAny()
{
DirectoryChange result = (ref Array!(DirectoryChange) this = this;) , ((ref inout(DirectoryChange) __inlineretval16339 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16331 = this._refCounted;)) , __inlineretval16331._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16332 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16332))._payload[__dollar - 1LU];) , __inlineretval16339);
this.removeBack();
return result;
}
;
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
alias insert = size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
;
pure @safe void removeBack()
{
enforce(!((ref Array!(DirectoryChange) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15571 = this._refCounted;)) , __inlineretval15571._store !is null) || ((const(DirectoryChange[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15572 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15572))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16340 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16340))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16341 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16341))._payload[0..__dollar - 1LU];
}
alias stableRemoveBack = void stableRemoveBack();
;
pure nothrow @nogc @safe ulong removeBack(ulong howMany)
{
if (howMany > ((ref Array!(DirectoryChange) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU))
howMany = ((ref Array!(DirectoryChange) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16342 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16342))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16343 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16343))._payload[0..__dollar - howMany];
return howMany;
}
alias stableRemoveBack = pure @safe void removeBack()
{
enforce(!((ref Array!(DirectoryChange) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15571 = this._refCounted;)) , __inlineretval15571._store !is null) || ((const(DirectoryChange[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15572 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15572))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16340 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16340))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16341 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16341))._payload[0..__dollar - 1LU];
}
;
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
reserve(length + 1);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + 1, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
emplace(_data._payload.ptr + r._a, stuff);
_data._payload = _data._payload.ptr[0.._data._payload.length + 1];
return 1;
}
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
static if (isForwardRange!Stuff
)
{
auto extra = walkLength(stuff);
if (!extra)
return 0;
reserve(length + extra);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + extra, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
foreach (p; _data._payload.ptr + r._a .. _data._payload.ptr + r._a + extra)
{
emplace(p, stuff.front);
stuff.popFront();
}
_data._payload = _data._payload.ptr[0.._data._payload.length + extra];
return extra;
}
else
{
import std.algorithm.mutation : bringToFront;
enforce(_data);
immutable offset = r._a;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
}
size_t insertAfter(Stuff)(Range r, Stuff stuff)
{
import std.algorithm.mutation : bringToFront;
enforce(r._outer._data is _data);
immutable offset = r._b;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
enforce(r._outer._data is _data);
size_t result;
for (; !stuff.empty; stuff.popFront())
{
{
if (r.empty)
{
return result + insertBefore(r, stuff);
}
r.front = stuff.front;
r.popFront();
++result;
}
}
linearRemove(r);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
enforce(r._outer._data is _data);
if (r.empty)
{
insertBefore(r, stuff);
}
else
{
r.front = stuff;
r.popFront();
linearRemove(r);
}
return 1;
}
@system RangeT!(Array!(DirectoryChange)) linearRemove(RangeT!(Array!(DirectoryChange)) r)
{
try
{
import std.algorithm.mutation : copy;
enforce(((ref inout(Array!(DirectoryChange)) __inlineretval16344 = r._outer_[0];) , __inlineretval16344)._data is this._data, delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 988LU);
enforce(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16345 = this._refCounted;)) , __inlineretval16345._store !is null), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 989LU);
enforce(r._a <= r._b && r._b <= ((ref Array!(DirectoryChange) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 990LU);
immutable immutable(ulong) offset1 = r._a;
immutable immutable(ulong) offset2 = r._b;
immutable immutable(ulong) tailLength = ((ref Array!(DirectoryChange) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU) - offset2;
(RangeT!(Array!(DirectoryChange)) __tmpfordtor7789 = copy(this.opSlice(offset2, ((ref Array!(DirectoryChange) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU)), this.opSlice(offset1, offset1 + tailLength));) , __tmpfordtor7789;
{
ref Array!(DirectoryChange) this = this;
ulong newLength = offset1 + tailLength;
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16337 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16337;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16337;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16338 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16338)).length(newLength);
}
return this.opSlice(((ref Array!(DirectoryChange) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU) - tailLength, ((ref Array!(DirectoryChange) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU));
}
finally
{
{
{
Array!(DirectoryChange)[] a = (&r._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
}
}
~this()
{
this._data.~this();
}
alias __xdtor = ~this()
{
this._data.~this();
}
;
this(this)
{
this._data.__postblit();
}
alias __xpostblit = this(this)
{
this._data.__postblit();
}
;
nothrow @nogc ref return @system Array!(DirectoryChange) opAssign(Array!(DirectoryChange) p)
{
(Array!(DirectoryChange) __swap4875 = void;) , __swap4875 = this , this = p;
{
__swap4875._data.~this();
}
return this;
}
}
RangeT!(Array!(DirectoryChange))
struct RangeT
{
private Array!(DirectoryChange)[1] _outer_;
private inout pure nothrow @nogc @property ref @safe inout(Array!(DirectoryChange)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = DirectoryChange;
private nothrow @nogc @system this(ref Array!(DirectoryChange) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(Array!(DirectoryChange)) save()
{
return (RangeT!(Array!(DirectoryChange)) __copytmp4890 = (__copytmp4890 = this).__fieldPostblit();) , __copytmp4890;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(DirectoryChange) front()
{
assert(!((ref inout(RangeT!(Array!(DirectoryChange))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
inout ref inout(Array!(DirectoryChange)) __dop4891 = (ref inout(RangeT!(Array!(DirectoryChange))) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval14694 = this._outer_[0];) , __inlineretval14694);
return (ulong i = this._a;) , ((ref inout(DirectoryChange) __inlineretval14697 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4891._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4891._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval14697);
}
inout pure nothrow @nogc @property ref @safe inout(DirectoryChange) back()
{
assert(!((ref inout(RangeT!(Array!(DirectoryChange))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
inout ref inout(Array!(DirectoryChange)) __dop4892 = (ref inout(RangeT!(Array!(DirectoryChange))) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16346 = this._outer_[0];) , __inlineretval16346);
return (ulong i = this._b - 1LU;) , ((ref inout(DirectoryChange) __inlineretval16347 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4892._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4892._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval16347);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(Array!(DirectoryChange)) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(Array!(DirectoryChange)) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(Array!(DirectoryChange))
enum bool isMutable = true;
)
{
import std.algorithm.mutation : move;
pure nothrow @nogc @safe DirectoryChange moveFront()
{
assert(!((ref RangeT!(Array!(DirectoryChange)) this = this;) , this._a >= this._b) && this._a < ((ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16348 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16348._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16348._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU));
return (ref DirectoryChange source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16349 = this._outer_[0];) , __inlineretval16349))._data;) , ((ref inout(Payload) __inlineretval16350 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16350))._payload[this._a];) , ((DirectoryChange __inlineretval16351 = (ref DirectoryChange source = source;) , ((DirectoryChange __inlineretval14760 = (DirectoryChange __retvar14759 = void;) , ((ref DirectoryChange source = source;)) , (0 , ((ref DirectoryChange source = source;) , ((ref DirectoryChange target = __retvar14759;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , __retvar14759);) , __inlineretval14760);) , __inlineretval16351);
}
pure nothrow @nogc @safe DirectoryChange moveBack()
{
assert(!((ref RangeT!(Array!(DirectoryChange)) this = this;) , this._a >= this._b) && this._b <= ((ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16352 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16352._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16352._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU));
return (ref DirectoryChange source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16353 = this._outer_[0];) , __inlineretval16353))._data;) , ((ref inout(Payload) __inlineretval16354 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16354))._payload[this._b - 1LU];) , ((DirectoryChange __inlineretval16355 = (ref DirectoryChange source = source;) , ((DirectoryChange __inlineretval14760 = (DirectoryChange __retvar14759 = void;) , ((ref DirectoryChange source = source;)) , (0 , ((ref DirectoryChange source = source;) , ((ref DirectoryChange target = __retvar14759;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , __retvar14759);) , __inlineretval14760);) , __inlineretval16355);
}
pure nothrow @nogc @safe DirectoryChange moveAt(ulong i)
{
assert(this._a + i < this._b && this._a + i < ((ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16356 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16356._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16356._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU));
return (ref DirectoryChange source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16357 = this._outer_[0];) , __inlineretval16357))._data;) , ((ref inout(Payload) __inlineretval16358 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16358))._payload[this._a + i];) , ((DirectoryChange __inlineretval16359 = (ref DirectoryChange source = source;) , ((DirectoryChange __inlineretval14760 = (DirectoryChange __retvar14759 = void;) , ((ref DirectoryChange source = source;)) , (0 , ((ref DirectoryChange source = source;) , ((ref DirectoryChange target = __retvar14759;)) , (assert(&source !is &target, "source and target must not be identical") , target = source)) , __retvar14759);) , __inlineretval14760);) , __inlineretval16359);
}
}
inout pure nothrow @nogc ref @safe inout(DirectoryChange) opIndex(ulong i)
{
assert(this._a + i < this._b);
inout ref inout(Array!(DirectoryChange)) __dop4894 = (ref inout(RangeT!(Array!(DirectoryChange))) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval15069 = this._outer_[0];) , __inlineretval15069);
return (ulong i = this._a + i;) , ((ref inout(DirectoryChange) __inlineretval15070 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4894._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4894._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval15070);
}
nothrow @nogc @system RangeT!(Array!(DirectoryChange)) opSlice()
{
return (RangeT!(Array!(DirectoryChange)) __slRange4895 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(DirectoryChange) data = (ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16360 = this._outer_[0];) , __inlineretval16360);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4895._outer_[] = data , __slRange4895._a = a , __slRange4895._b = b , __slRange4895);
}
nothrow @nogc @system RangeT!(Array!(DirectoryChange)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(Array!(DirectoryChange)) __slRange4896 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(DirectoryChange) data = (ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16361 = this._outer_[0];) , __inlineretval16361);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4896._outer_[] = data , __slRange4896._a = a , __slRange4896._b = b , __slRange4896);
}
const nothrow @nogc @system RangeT!(const(Array!(DirectoryChange))) opSlice()
{
return (RangeT!(const(Array!(DirectoryChange))) __slRange4897 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(DirectoryChange)) data = (ref const(RangeT!(Array!(DirectoryChange))) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16362 = this._outer_[0];) , __inlineretval16362);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4897._outer_[] = data , __slRange4897._a = a , __slRange4897._b = b , __slRange4897);
}
const nothrow @nogc @system RangeT!(const(Array!(DirectoryChange))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(DirectoryChange))) __slRange4898 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(DirectoryChange)) data = (ref const(RangeT!(Array!(DirectoryChange))) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16363 = this._outer_[0];) , __inlineretval16363);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4898._outer_[] = data , __slRange4898._a = a , __slRange4898._b = b , __slRange4898);
}
static if (isMutable!(Array!(DirectoryChange))
)
{
pure nothrow @nogc @safe void opSliceAssign(DirectoryChange value)
{
assert(this._b <= ((ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16364 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16364._data;) , ((ref inout(RefCountedStore) __inlineretval16322 = this._refCounted;)) , __inlineretval16322._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16364._data;) , ((ref inout(Payload) __inlineretval16323 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16323))._payload.length : 0LU));
{
(ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16365 = this._outer_[0];));
(DirectoryChange value = value;) , ((ulong i = this._a;)) , ((ulong j = this._b;));
DirectoryChange[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16365._data;) , ((ref inout(RefCountedStore) __inlineretval16335 = this._refCounted;)) , __inlineretval16335._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16365._data;) , ((ref inout(Payload) __inlineretval16336 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16336))._payload : null;
slice[i..j] = value;
}
}
pure nothrow @nogc @safe void opSliceAssign(DirectoryChange value, ulong i, ulong j)
{
assert(this._a + j <= this._b);
{
(ref RangeT!(Array!(DirectoryChange)) this = this;) , ((ref inout(Array!(DirectoryChange)) __inlineretval16366 = this._outer_[0];));
(DirectoryChange value = value;) , ((ulong i = this._a + i;)) , ((ulong j = this._a + j;));
DirectoryChange[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16366._data;) , ((ref inout(RefCountedStore) __inlineretval16335 = this._refCounted;)) , __inlineretval16335._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16366._data;) , ((ref inout(Payload) __inlineretval16336 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16336))._payload : null;
slice[i..j] = value;
}
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(DirectoryChange)[] a = (&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(DirectoryChange)[] a = (&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(DirectoryChange)[] a = (&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4878 = a[];
ulong __key4879 = 0LU;
for (; __key4879 < __r4878.length; __key4879 += 1LU)
{
ref Array!(DirectoryChange) e = __r4878[__key4879];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(DirectoryChange)[] a = (&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4878 = a[];
ulong __key4879 = 0LU;
for (; __key4879 < __r4878.length; __key4879 += 1LU)
{
ref Array!(DirectoryChange) e = __r4878[__key4879];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(Array!(DirectoryChange)) opAssign(RangeT!(Array!(DirectoryChange)) p)
{
(RangeT!(Array!(DirectoryChange)) __swap4889 = void;) , __swap4889 = this , this = p;
{
{
Array!(DirectoryChange)[] a = (&__swap4889._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(const(Array!(DirectoryChange)))
struct RangeT
{
private const const(Array!(DirectoryChange)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe inout(const(Array!(DirectoryChange))) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = const(DirectoryChange);
private nothrow @nogc @system this(ref const(Array!(DirectoryChange)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(const(Array!(DirectoryChange))) save()
{
return (RangeT!(const(Array!(DirectoryChange))) __copytmp4877 = (__copytmp4877 = this).__fieldPostblit();) , __copytmp4877;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(const(DirectoryChange)) front()
{
assert(!((ref inout(RangeT!(const(Array!(DirectoryChange)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
const ref inout(const(Array!(DirectoryChange))) __dop4882 = (ref inout(RangeT!(const(Array!(DirectoryChange)))) this = this;) , ((ref inout(const(Array!(DirectoryChange))) __inlineretval16367 = this._outer_[0];) , __inlineretval16367);
return (ulong i = this._a;) , ((ref inout(DirectoryChange) __inlineretval16368 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4882._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4882._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval16368);
}
inout pure nothrow @nogc @property ref @safe inout(const(DirectoryChange)) back()
{
assert(!((ref inout(RangeT!(const(Array!(DirectoryChange)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
const ref inout(const(Array!(DirectoryChange))) __dop4883 = (ref inout(RangeT!(const(Array!(DirectoryChange)))) this = this;) , ((ref inout(const(Array!(DirectoryChange))) __inlineretval16369 = this._outer_[0];) , __inlineretval16369);
return (ulong i = this._b - 1LU;) , ((ref inout(DirectoryChange) __inlineretval16370 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4883._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4883._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval16370);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(const(Array!(DirectoryChange))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(const(Array!(DirectoryChange))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(const(Array!(DirectoryChange)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe inout(const(DirectoryChange)) opIndex(ulong i)
{
assert(this._a + i < this._b);
const ref inout(const(Array!(DirectoryChange))) __dop4884 = (ref inout(RangeT!(const(Array!(DirectoryChange)))) this = this;) , ((ref inout(const(Array!(DirectoryChange))) __inlineretval16371 = this._outer_[0];) , __inlineretval16371);
return (ulong i = this._a + i;) , ((ref inout(DirectoryChange) __inlineretval16372 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4884._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4884._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval16372);
}
nothrow @nogc @system RangeT!(const(Array!(DirectoryChange))) opSlice()
{
return (RangeT!(const(Array!(DirectoryChange))) __slRange4885 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(DirectoryChange)) data = (ref RangeT!(const(Array!(DirectoryChange))) this = this;) , ((ref inout(const(Array!(DirectoryChange))) __inlineretval16373 = this._outer_[0];) , __inlineretval16373);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4885._outer_[] = data , __slRange4885._a = a , __slRange4885._b = b , __slRange4885);
}
nothrow @nogc @system RangeT!(const(Array!(DirectoryChange))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(DirectoryChange))) __slRange4886 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(DirectoryChange)) data = (ref RangeT!(const(Array!(DirectoryChange))) this = this;) , ((ref inout(const(Array!(DirectoryChange))) __inlineretval16374 = this._outer_[0];) , __inlineretval16374);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4886._outer_[] = data , __slRange4886._a = a , __slRange4886._b = b , __slRange4886);
}
const nothrow @nogc @system RangeT!(const(Array!(DirectoryChange))) opSlice()
{
return (RangeT!(const(Array!(DirectoryChange))) __slRange4887 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(DirectoryChange)) data = (ref const(RangeT!(const(Array!(DirectoryChange)))) this = this;) , ((ref inout(const(Array!(DirectoryChange))) __inlineretval16375 = this._outer_[0];) , __inlineretval16375);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4887._outer_[] = data , __slRange4887._a = a , __slRange4887._b = b , __slRange4887);
}
const nothrow @nogc @system RangeT!(const(Array!(DirectoryChange))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(DirectoryChange))) __slRange4888 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(DirectoryChange)) data = (ref const(RangeT!(const(Array!(DirectoryChange)))) this = this;) , ((ref inout(const(Array!(DirectoryChange))) __inlineretval16376 = this._outer_[0];) , __inlineretval16376);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4888._outer_[] = data , __slRange4888._a = a , __slRange4888._b = b , __slRange4888);
}
static if (isMutable!(const(Array!(DirectoryChange)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(DirectoryChange)[] a = (&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(DirectoryChange)[] a = (&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(DirectoryChange)[] a = (&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4878 = a[];
ulong __key4879 = 0LU;
for (; __key4879 < __r4878.length; __key4879 += 1LU)
{
ref Array!(DirectoryChange) e = __r4878[__key4879];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(DirectoryChange)[] a = (&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4878 = a[];
ulong __key4879 = 0LU;
for (; __key4879 < __r4878.length; __key4879 += 1LU)
{
ref Array!(DirectoryChange) e = __r4878[__key4879];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(const(Array!(DirectoryChange))) opAssign(RangeT!(const(Array!(DirectoryChange))) p)
{
(RangeT!(const(Array!(DirectoryChange))) __swap4876 = void;) , __swap4876 = this , this = p;
{
{
Array!(DirectoryChange)[] a = (&__swap4876._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(immutable(Array!(DirectoryChange)))
struct RangeT
{
private immutable immutable(Array!(DirectoryChange)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe immutable(Array!(DirectoryChange)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = immutable(DirectoryChange);
private nothrow @nogc @system this(ref immutable(Array!(DirectoryChange)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(immutable(Array!(DirectoryChange))) save()
{
return (RangeT!(immutable(Array!(DirectoryChange))) __copytmp4900 = (__copytmp4900 = this).__fieldPostblit();) , __copytmp4900;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe immutable(DirectoryChange) front()
{
assert(!((ref inout(RangeT!(immutable(Array!(DirectoryChange)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
immutable ref immutable(Array!(DirectoryChange)) __dop4901 = (ref inout(RangeT!(immutable(Array!(DirectoryChange)))) this = this;) , ((ref immutable(Array!(DirectoryChange)) __inlineretval16377 = this._outer_[0];) , __inlineretval16377);
return (ulong i = this._a;) , ((ref inout(DirectoryChange) __inlineretval16378 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4901._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4901._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval16378);
}
inout pure nothrow @nogc @property ref @safe immutable(DirectoryChange) back()
{
assert(!((ref inout(RangeT!(immutable(Array!(DirectoryChange)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
immutable ref immutable(Array!(DirectoryChange)) __dop4902 = (ref inout(RangeT!(immutable(Array!(DirectoryChange)))) this = this;) , ((ref immutable(Array!(DirectoryChange)) __inlineretval16379 = this._outer_[0];) , __inlineretval16379);
return (ulong i = this._b - 1LU;) , ((ref inout(DirectoryChange) __inlineretval16380 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4902._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4902._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval16380);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(immutable(Array!(DirectoryChange))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(immutable(Array!(DirectoryChange))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(immutable(Array!(DirectoryChange)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe immutable(DirectoryChange) opIndex(ulong i)
{
assert(this._a + i < this._b);
immutable ref immutable(Array!(DirectoryChange)) __dop4903 = (ref inout(RangeT!(immutable(Array!(DirectoryChange)))) this = this;) , ((ref immutable(Array!(DirectoryChange)) __inlineretval16381 = this._outer_[0];) , __inlineretval16381);
return (ulong i = this._a + i;) , ((ref inout(DirectoryChange) __inlineretval16382 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4903._data;) , ((ref inout(RefCountedStore) __inlineretval14695 = this._refCounted;)) , __inlineretval14695._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4903._data;) , ((ref inout(Payload) __inlineretval14696 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14696))._payload[i];) , __inlineretval16382);
}
nothrow @nogc @system RangeT!(immutable(Array!(DirectoryChange))) opSlice()
{
return (RangeT!(immutable(Array!(DirectoryChange))) __slRange4904 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(DirectoryChange)) data = (ref RangeT!(immutable(Array!(DirectoryChange))) this = this;) , ((ref immutable(Array!(DirectoryChange)) __inlineretval16383 = this._outer_[0];) , __inlineretval16383);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4904._outer_[] = data , __slRange4904._a = a , __slRange4904._b = b , __slRange4904);
}
nothrow @nogc @system RangeT!(immutable(Array!(DirectoryChange))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(DirectoryChange))) __slRange4905 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(DirectoryChange)) data = (ref RangeT!(immutable(Array!(DirectoryChange))) this = this;) , ((ref immutable(Array!(DirectoryChange)) __inlineretval16384 = this._outer_[0];) , __inlineretval16384);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4905._outer_[] = data , __slRange4905._a = a , __slRange4905._b = b , __slRange4905);
}
const nothrow @nogc @system RangeT!(immutable(Array!(DirectoryChange))) opSlice()
{
return (RangeT!(immutable(Array!(DirectoryChange))) __slRange4906 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(DirectoryChange)) data = (ref const(RangeT!(immutable(Array!(DirectoryChange)))) this = this;) , ((ref immutable(Array!(DirectoryChange)) __inlineretval16385 = this._outer_[0];) , __inlineretval16385);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4906._outer_[] = data , __slRange4906._a = a , __slRange4906._b = b , __slRange4906);
}
const nothrow @nogc @system RangeT!(immutable(Array!(DirectoryChange))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(DirectoryChange))) __slRange4907 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(DirectoryChange)) data = (ref const(RangeT!(immutable(Array!(DirectoryChange)))) this = this;) , ((ref immutable(Array!(DirectoryChange)) __inlineretval16386 = this._outer_[0];) , __inlineretval16386);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4907._outer_[] = data , __slRange4907._a = a , __slRange4907._b = b , __slRange4907);
}
static if (isMutable!(immutable(Array!(DirectoryChange)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(DirectoryChange)[] a = (cast(Array!(DirectoryChange)*)&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(DirectoryChange)[] a = (cast(Array!(DirectoryChange)*)&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(DirectoryChange)[] a = (cast(Array!(DirectoryChange)*)&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4878 = a[];
ulong __key4879 = 0LU;
for (; __key4879 < __r4878.length; __key4879 += 1LU)
{
ref Array!(DirectoryChange) e = __r4878[__key4879];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(DirectoryChange)[] a = (cast(Array!(DirectoryChange)*)&this._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4878 = a[];
ulong __key4879 = 0LU;
for (; __key4879 < __r4878.length; __key4879 += 1LU)
{
ref Array!(DirectoryChange) e = __r4878[__key4879];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(immutable(Array!(DirectoryChange))) opAssign(RangeT!(immutable(Array!(DirectoryChange))) p)
{
(RangeT!(immutable(Array!(DirectoryChange))) __swap4899 = void;) , __swap4899 = this , this = p;
{
{
Array!(DirectoryChange)[] a = (cast(Array!(DirectoryChange)*)&__swap4899._outer_)[0..1];
{
Array!(DirectoryChange)[] __r4880 = a[];
ulong __key4881 = __r4880.length;
for (; __key4881--;)
{
ref Array!(DirectoryChange) e = __r4880[__key4881];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
static __gshared TypeInfo_Const _D83TypeInfo_xS3std9container5array44__T5ArrayTS4vibe4core4file15DirectoryChangeZ5Array6__initZ;
static __gshared TypeInfo_Const _D43TypeInfo_xS4vibe4core4file15DirectoryChange6__initZ;
static __gshared TypeInfo_Const _D85TypeInfo_xG1S3std9container5array44__T5ArrayTS4vibe4core4file15DirectoryChangeZ5Array6__initZ;
static __gshared TypeInfo_Struct _D82TypeInfo_S3std9container5array44__T5ArrayTS4vibe4core4file15DirectoryChangeZ5Array6__initZ;
static __gshared TypeInfo_Struct _D42TypeInfo_S4vibe4core4file15DirectoryChange6__initZ;
static __gshared TypeInfo_Invariant _D83TypeInfo_yS3std9container5array44__T5ArrayTS4vibe4core4file15DirectoryChangeZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D85TypeInfo_yG1S3std9container5array44__T5ArrayTS4vibe4core4file15DirectoryChangeZ5Array6__initZ;
Array!(Task)
struct Array
{
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memmove, memset;
import core.memory : GC;
import std.exception : enforce;
import std.typecons : RefCounted, RefCountedAutoInitialize;
private struct Payload
{
ulong _capacity;
Task[] _payload;
pure nothrow @nogc @safe this(Task[] p)
{
this._capacity = p.length;
this._payload = p;
return this;
}
~this()
{
{
const(void*) p = cast(const(void*))cast(Task*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Task*)this._payload);
}
this(this)
{
halt;
}
nothrow @nogc @system void opAssign(Payload rhs)
{
try
{
halt;
}
finally
{
{
{
const(void*) p = cast(const(void*))cast(Task*)rhs._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Task*)rhs._payload);
}
}
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._payload.length;
}
nothrow @nogc @property @system void length(ulong newLength)
{
import std.algorithm.mutation : initializeAll;
if (((ref Payload this = this;) , this._payload.length) >= newLength)
{
this._payload = (cast(Task*)this._payload)[0..newLength];
return ;
}
immutable immutable(ulong) startEmplace = (ref Payload this = this;) , this._payload.length;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) nbytes = (ulong x = newLength;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
this._payload = (cast(Task*)realloc(cast(void*)cast(Task*)this._payload, nbytes))[0..newLength];
{
Task[] range = (cast(Task*)this._payload)[startEmplace..newLength];
alias T = Task;
{
(ref Task[] range = range;) , ((Task value = Task(null, 0LU);));
alias T = Task;
range[] = value;
}
}
this._capacity = newLength;
}
const pure nothrow @nogc @property @safe ulong capacity()
{
return this._capacity;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (elements <= ((ref Payload this = this;) , this._capacity))
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
immutable immutable(ulong) oldLength = (ref Payload this = this;) , this._payload.length;
Task* newPayloadPtr = cast(Task*)malloc(sz);
newPayloadPtr || halt;
Task[] newPayload = newPayloadPtr[0..oldLength];
memcpy(cast(void*)cast(Task*)newPayload, cast(const(void*))cast(Task*)this._payload, 16LU * oldLength);
memset(cast(void*)(cast(Task*)newPayload + cast(long)oldLength * 16L), 0, (elements - oldLength) * 16LU);
{
(const(void*) p = cast(const(void*))cast(Task*)newPayload;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
const(void*) p = cast(const(void*))cast(Task*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Task*)this._payload);
this._payload = newPayload;
this._capacity = elements;
}
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
if (_capacity == length)
{
reserve(1 + capacity * 3 / 2);
}
assert(capacity > length && _payload.ptr);
emplace(_payload.ptr + _payload.length, stuff);
_payload = _payload.ptr[0.._payload.length + 1];
return 1;
}
size_t insertBack(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
static if (hasLength!Stuff
)
{
immutable oldLength = length;
reserve(oldLength + stuff.length);
}
size_t result;
foreach (item; stuff)
{
insertBack(item);
++result;
}
static if (hasLength!Stuff
)
{
assert(length == oldLength + stuff.length);
}
return result;
}
alias __xdtor = ~this()
{
{
const(void*) p = cast(const(void*))cast(Task*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Task*)this._payload);
}
;
alias __xpostblit = this(this)
{
halt;
}
;
}
private alias Data = RefCounted!(Payload, cast(RefCountedAutoInitialize)0);
private RefCounted!(Payload, cast(RefCountedAutoInitialize)0) _data;
this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)
)
{
import std.conv : emplace;
import core.checkedint : mulu;
bool overflow;
const nbytes = mulu(values.length, T.sizeof, overflow);
if (overflow)
assert(0);
auto p = cast(T*)malloc(nbytes);
static if (hasIndirections!T
)
{
if (p)
GC.addRange(p, T.sizeof * values.length);
}
foreach (i, e; values)
{
emplace(p + i, e);
}
_data = Data(p[0..values.length]);
}
this(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
&& !is(Stuff == T[]))
{
insertBack(stuff);
}
const nothrow @system bool opEquals(const(Array!(Task)) rhs)
{
try
{
return this.opEquals(rhs);
}
finally
{
{
rhs._data.~this();
}
}
}
const nothrow @safe bool opEquals(ref const(Array!(Task)) rhs)
{
if ((ref const(Array!(Task)) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15633 = this._refCounted;)) , __inlineretval15633._store !is null) || ((const(Task[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15634 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15634))._payload;) , !a.length))
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval15633 = this._refCounted;)) , __inlineretval15633._store !is null) || ((const(Task[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval15634 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15634))._payload;) , !a.length);
if (!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval15633 = this._refCounted;)) , __inlineretval15633._store !is null) || ((const(Task[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval15634 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15634))._payload;) , !a.length))
return false;
return _ArrayEq(((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16387 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16387))._payload, ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16388 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16388))._payload);
}
alias Range = RangeT!(Array!(Task));
alias ConstRange = RangeT!(const(Array!(Task)));
alias ImmutableRange = RangeT!(immutable(Array!(Task)));
nothrow @property @system Array!(Task) dup()
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16389 = this._refCounted;)) , __inlineretval16389._store !is null))
return (Array!(Task) __copytmp7798 = (ref Array!(Task) this = __copytmp7798 = this;) , this._data.__postblit();) , __copytmp7798;
return ((Array!(Task) __slArray7797 = Array(RefCounted(RefCountedStore(null)));) , __slArray7797).this(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16390 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16390))._payload);
}
const pure nothrow @nogc @property @safe bool empty()
{
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15633 = this._refCounted;)) , __inlineretval15633._store !is null) || ((const(Task[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15634 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15634))._payload;) , !a.length);
}
const pure nothrow @nogc @property @safe ulong length()
{
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU;
}
const pure nothrow @nogc @safe ulong opDollar()
{
return (ref const(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU;
}
pure nothrow @nogc @property @safe ulong capacity()
{
return ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16391 = this._refCounted;)) , __inlineretval16391._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16392 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16392))._capacity : 0LU;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16393 = this._refCounted;)) , __inlineretval16393._store !is null))
{
if (!elements)
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
void* p = malloc(sz);
p || halt;
{
(const(void*) p = p;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = ((RefCounted!(Payload, cast(RefCountedAutoInitialize)0) __slRefCo7799 = RefCounted(RefCountedStore(null));) , __slRefCo7799).this(cast(Task[])p[0..0]);
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16394 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16394))._capacity = elements;
}
else
{
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16395 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16395)).reserve(elements);
}
}
nothrow @nogc @system RangeT!(Array!(Task)) opSlice()
{
return (RangeT!(Array!(Task)) __slRange7329 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Task) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref Array!(Task) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU;))) , (__slRange7329._outer_[] = data , __slRange7329._a = a , __slRange7329._b = b , __slRange7329);
}
const nothrow @nogc @system RangeT!(const(Array!(Task))) opSlice()
{
return (RangeT!(const(Array!(Task))) __slRange7800 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Task)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref const(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU;))) , (__slRange7800._outer_[] = data , __slRange7800._a = a , __slRange7800._b = b , __slRange7800);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(Task))) opSlice()
{
return (RangeT!(immutable(Array!(Task))) __slRange7801 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Task)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref immutable(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU;))) , (__slRange7801._outer_[] = data , __slRange7801._a = a , __slRange7801._b = b , __slRange7801);
}
nothrow @nogc @system RangeT!(Array!(Task)) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref Array!(Task) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU));
return (RangeT!(Array!(Task)) __slRange7334 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Task) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7334._outer_[] = data , __slRange7334._a = a , __slRange7334._b = b , __slRange7334);
}
const nothrow @nogc @system RangeT!(const(Array!(Task))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref const(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU));
return (RangeT!(const(Array!(Task))) __slRange7802 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Task)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7802._outer_[] = data , __slRange7802._a = a , __slRange7802._b = b , __slRange7802);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(Task))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref immutable(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU));
return (RangeT!(immutable(Array!(Task))) __slRange7803 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Task)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7803._outer_[] = data , __slRange7803._a = a , __slRange7803._b = b , __slRange7803);
}
inout pure nothrow @nogc @property ref @safe inout(Task) front()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16396 = this._refCounted;)) , __inlineretval16396._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16397 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16397))._payload[0];
}
inout pure nothrow @nogc @property ref @safe inout(Task) back()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16398 = this._refCounted;)) , __inlineretval16398._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16399 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16399))._payload[__dollar - 1LU];
}
inout pure nothrow @nogc ref @safe inout(Task) opIndex(ulong i)
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];
}
pure nothrow @nogc @safe void opSliceAssign(Task value)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16400 = this._refCounted;)) , __inlineretval16400._store !is null))
return ;
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16401 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16401))._payload[] = value;
}
pure nothrow @nogc @safe void opSliceAssign(Task value, ulong i, ulong j)
{
Task[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16402 = this._refCounted;)) , __inlineretval16402._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16403 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16403))._payload : null;
slice[i..j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin(op ~ "_data._payload[];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin(op ~ "slice[i .. j];");
}
void opSliceOpAssign(string op)(T value)
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin("_data._payload[] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(T value, size_t i, size_t j)
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin("slice[i .. j] " ~ op ~ "= value;");
}
Array opBinary(string op, Stuff)(Stuff stuff) if (op == "~")
{
Array result;
result ~= this[];
assert(result.length == length);
result ~= stuff[];
return result;
}
void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~")
{
static if (is(typeof(stuff[])))
{
insertBack(stuff[]);
}
else
{
insertBack(stuff);
}
}
nothrow @nogc @system void clear()
{
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
nothrow @nogc @property @system void length(ulong newLength)
{
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16404 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16404;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16404;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16405 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16405)).length(newLength);
}
pure @safe Task removeAny()
{
Task result = (ref Array!(Task) this = this;) , ((ref inout(Task) __inlineretval16406 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16398 = this._refCounted;)) , __inlineretval16398._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16399 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16399))._payload[__dollar - 1LU];) , __inlineretval16406);
this.removeBack();
return result;
}
alias stableRemoveAny = pure @safe Task removeAny()
{
Task result = (ref Array!(Task) this = this;) , ((ref inout(Task) __inlineretval16406 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16398 = this._refCounted;)) , __inlineretval16398._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16399 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16399))._payload[__dollar - 1LU];) , __inlineretval16406);
this.removeBack();
return result;
}
;
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
alias insert = size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
;
pure @safe void removeBack()
{
enforce(!((ref Array!(Task) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15633 = this._refCounted;)) , __inlineretval15633._store !is null) || ((const(Task[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15634 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15634))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16407 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16407))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16408 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16408))._payload[0..__dollar - 1LU];
}
alias stableRemoveBack = void stableRemoveBack();
;
pure nothrow @nogc @safe ulong removeBack(ulong howMany)
{
if (howMany > ((ref Array!(Task) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU))
howMany = ((ref Array!(Task) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16409 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16409))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16410 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16410))._payload[0..__dollar - howMany];
return howMany;
}
alias stableRemoveBack = pure @safe void removeBack()
{
enforce(!((ref Array!(Task) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15633 = this._refCounted;)) , __inlineretval15633._store !is null) || ((const(Task[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15634 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15634))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16407 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16407))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16408 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16408))._payload[0..__dollar - 1LU];
}
;
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
reserve(length + 1);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + 1, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
emplace(_data._payload.ptr + r._a, stuff);
_data._payload = _data._payload.ptr[0.._data._payload.length + 1];
return 1;
}
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
static if (isForwardRange!Stuff
)
{
auto extra = walkLength(stuff);
if (!extra)
return 0;
reserve(length + extra);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + extra, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
foreach (p; _data._payload.ptr + r._a .. _data._payload.ptr + r._a + extra)
{
emplace(p, stuff.front);
stuff.popFront();
}
_data._payload = _data._payload.ptr[0.._data._payload.length + extra];
return extra;
}
else
{
import std.algorithm.mutation : bringToFront;
enforce(_data);
immutable offset = r._a;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
}
size_t insertAfter(Stuff)(Range r, Stuff stuff)
{
import std.algorithm.mutation : bringToFront;
enforce(r._outer._data is _data);
immutable offset = r._b;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
enforce(r._outer._data is _data);
size_t result;
for (; !stuff.empty; stuff.popFront())
{
{
if (r.empty)
{
return result + insertBefore(r, stuff);
}
r.front = stuff.front;
r.popFront();
++result;
}
}
linearRemove(r);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
enforce(r._outer._data is _data);
if (r.empty)
{
insertBefore(r, stuff);
}
else
{
r.front = stuff;
r.popFront();
linearRemove(r);
}
return 1;
}
@system RangeT!(Array!(Task)) linearRemove(RangeT!(Array!(Task)) r)
{
try
{
import std.algorithm.mutation : copy;
enforce(((ref inout(Array!(Task)) __inlineretval16411 = r._outer_[0];) , __inlineretval16411)._data is this._data, delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 988LU);
enforce(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16412 = this._refCounted;)) , __inlineretval16412._store !is null), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 989LU);
enforce(r._a <= r._b && r._b <= ((ref Array!(Task) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 990LU);
immutable immutable(ulong) offset1 = r._a;
immutable immutable(ulong) offset2 = r._b;
immutable immutable(ulong) tailLength = ((ref Array!(Task) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU) - offset2;
(RangeT!(Array!(Task)) __tmpfordtor7338 = copy(this.opSlice(offset2, ((ref Array!(Task) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU)), this.opSlice(offset1, offset1 + tailLength));) , __tmpfordtor7338;
{
ref Array!(Task) this = this;
ulong newLength = offset1 + tailLength;
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16404 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16404;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16404;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16405 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16405)).length(newLength);
}
return this.opSlice(((ref Array!(Task) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU) - tailLength, ((ref Array!(Task) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU));
}
finally
{
{
{
Array!(Task)[] a = (&r._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
}
}
~this()
{
this._data.~this();
}
alias __xdtor = ~this()
{
this._data.~this();
}
;
this(this)
{
this._data.__postblit();
}
alias __xpostblit = this(this)
{
this._data.__postblit();
}
;
nothrow @nogc ref return @system Array!(Task) opAssign(Array!(Task) p)
{
(Array!(Task) __swap4911 = void;) , __swap4911 = this , this = p;
{
__swap4911._data.~this();
}
return this;
}
}
RangeT!(Array!(Task))
struct RangeT
{
private Array!(Task)[1] _outer_;
private inout pure nothrow @nogc @property ref @safe inout(Array!(Task)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = Task;
private nothrow @nogc @system this(ref Array!(Task) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(Array!(Task)) save()
{
return (RangeT!(Array!(Task)) __copytmp4926 = (__copytmp4926 = this).__fieldPostblit();) , __copytmp4926;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(Task) front()
{
assert(!((ref inout(RangeT!(Array!(Task))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
inout ref inout(Array!(Task)) __dop4927 = (ref inout(RangeT!(Array!(Task))) this = this;) , ((ref inout(Array!(Task)) __inlineretval14675 = this._outer_[0];) , __inlineretval14675);
return (ulong i = this._a;) , ((ref inout(Task) __inlineretval14678 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4927._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4927._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval14678);
}
inout pure nothrow @nogc @property ref @safe inout(Task) back()
{
assert(!((ref inout(RangeT!(Array!(Task))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
inout ref inout(Array!(Task)) __dop4928 = (ref inout(RangeT!(Array!(Task))) this = this;) , ((ref inout(Array!(Task)) __inlineretval16413 = this._outer_[0];) , __inlineretval16413);
return (ulong i = this._b - 1LU;) , ((ref inout(Task) __inlineretval16414 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4928._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4928._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval16414);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(Array!(Task)) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(Array!(Task)) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(Array!(Task))
enum bool isMutable = true;
)
{
import std.algorithm.mutation : move;
pure nothrow @nogc @safe Task moveFront()
{
assert(!((ref RangeT!(Array!(Task)) this = this;) , this._a >= this._b) && this._a < ((ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16415 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16415._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16415._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU));
return (ref Task source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16416 = this._outer_[0];) , __inlineretval16416))._data;) , ((ref inout(Payload) __inlineretval16417 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16417))._payload[this._a];) , ((Task __inlineretval16418 = (ref Task source = source;) , ((Task __inlineretval14762 = (ref Task source = source;) , ((Task __inlineretval14761 = (Task result = void;) , ((ref Task source = source;) , ((ref Task target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14761);) , __inlineretval14762);) , __inlineretval16418);
}
pure nothrow @nogc @safe Task moveBack()
{
assert(!((ref RangeT!(Array!(Task)) this = this;) , this._a >= this._b) && this._b <= ((ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16419 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16419._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16419._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU));
return (ref Task source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16420 = this._outer_[0];) , __inlineretval16420))._data;) , ((ref inout(Payload) __inlineretval16421 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16421))._payload[this._b - 1LU];) , ((Task __inlineretval16422 = (ref Task source = source;) , ((Task __inlineretval14762 = (ref Task source = source;) , ((Task __inlineretval14761 = (Task result = void;) , ((ref Task source = source;) , ((ref Task target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14761);) , __inlineretval14762);) , __inlineretval16422);
}
pure nothrow @nogc @safe Task moveAt(ulong i)
{
assert(this._a + i < this._b && this._a + i < ((ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16423 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16423._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16423._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU));
return (ref Task source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16424 = this._outer_[0];) , __inlineretval16424))._data;) , ((ref inout(Payload) __inlineretval16425 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16425))._payload[this._a + i];) , ((Task __inlineretval16426 = (ref Task source = source;) , ((Task __inlineretval14762 = (ref Task source = source;) , ((Task __inlineretval14761 = (Task result = void;) , ((ref Task source = source;) , ((ref Task target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14761);) , __inlineretval14762);) , __inlineretval16426);
}
}
inout pure nothrow @nogc ref @safe inout(Task) opIndex(ulong i)
{
assert(this._a + i < this._b);
inout ref inout(Array!(Task)) __dop4931 = (ref inout(RangeT!(Array!(Task))) this = this;) , ((ref inout(Array!(Task)) __inlineretval15052 = this._outer_[0];) , __inlineretval15052);
return (ulong i = this._a + i;) , ((ref inout(Task) __inlineretval15053 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4931._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4931._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval15053);
}
nothrow @nogc @system RangeT!(Array!(Task)) opSlice()
{
return (RangeT!(Array!(Task)) __slRange4932 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Task) data = (ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16427 = this._outer_[0];) , __inlineretval16427);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4932._outer_[] = data , __slRange4932._a = a , __slRange4932._b = b , __slRange4932);
}
nothrow @nogc @system RangeT!(Array!(Task)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(Array!(Task)) __slRange4933 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Task) data = (ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16428 = this._outer_[0];) , __inlineretval16428);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4933._outer_[] = data , __slRange4933._a = a , __slRange4933._b = b , __slRange4933);
}
const nothrow @nogc @system RangeT!(const(Array!(Task))) opSlice()
{
return (RangeT!(const(Array!(Task))) __slRange4934 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Task)) data = (ref const(RangeT!(Array!(Task))) this = this;) , ((ref inout(Array!(Task)) __inlineretval16429 = this._outer_[0];) , __inlineretval16429);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4934._outer_[] = data , __slRange4934._a = a , __slRange4934._b = b , __slRange4934);
}
const nothrow @nogc @system RangeT!(const(Array!(Task))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(Task))) __slRange4935 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Task)) data = (ref const(RangeT!(Array!(Task))) this = this;) , ((ref inout(Array!(Task)) __inlineretval16430 = this._outer_[0];) , __inlineretval16430);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4935._outer_[] = data , __slRange4935._a = a , __slRange4935._b = b , __slRange4935);
}
static if (isMutable!(Array!(Task))
)
{
pure nothrow @nogc @safe void opSliceAssign(Task value)
{
assert(this._b <= ((ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16431 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16431._data;) , ((ref inout(RefCountedStore) __inlineretval15627 = this._refCounted;)) , __inlineretval15627._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16431._data;) , ((ref inout(Payload) __inlineretval15628 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15628))._payload.length : 0LU));
{
(ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16432 = this._outer_[0];));
(Task value = value;) , ((ulong i = this._a;)) , ((ulong j = this._b;));
Task[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16432._data;) , ((ref inout(RefCountedStore) __inlineretval16402 = this._refCounted;)) , __inlineretval16402._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16432._data;) , ((ref inout(Payload) __inlineretval16403 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16403))._payload : null;
slice[i..j] = value;
}
}
pure nothrow @nogc @safe void opSliceAssign(Task value, ulong i, ulong j)
{
assert(this._a + j <= this._b);
{
(ref RangeT!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16433 = this._outer_[0];));
(Task value = value;) , ((ulong i = this._a + i;)) , ((ulong j = this._a + j;));
Task[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16433._data;) , ((ref inout(RefCountedStore) __inlineretval16402 = this._refCounted;)) , __inlineretval16402._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16433._data;) , ((ref inout(Payload) __inlineretval16403 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16403))._payload : null;
slice[i..j] = value;
}
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(Task)[] a = (&this._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(Task)[] a = (&this._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(Task)[] a = (&this._outer_)[0..1];
{
Array!(Task)[] __r4914 = a[];
ulong __key4915 = 0LU;
for (; __key4915 < __r4914.length; __key4915 += 1LU)
{
ref Array!(Task) e = __r4914[__key4915];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(Task)[] a = (&this._outer_)[0..1];
{
Array!(Task)[] __r4914 = a[];
ulong __key4915 = 0LU;
for (; __key4915 < __r4914.length; __key4915 += 1LU)
{
ref Array!(Task) e = __r4914[__key4915];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(Array!(Task)) opAssign(RangeT!(Array!(Task)) p)
{
(RangeT!(Array!(Task)) __swap4925 = void;) , __swap4925 = this , this = p;
{
{
Array!(Task)[] a = (&__swap4925._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(const(Array!(Task)))
struct RangeT
{
private const const(Array!(Task)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe inout(const(Array!(Task))) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = const(Task);
private nothrow @nogc @system this(ref const(Array!(Task)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(const(Array!(Task))) save()
{
return (RangeT!(const(Array!(Task))) __copytmp4913 = (__copytmp4913 = this).__fieldPostblit();) , __copytmp4913;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(const(Task)) front()
{
assert(!((ref inout(RangeT!(const(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
const ref inout(const(Array!(Task))) __dop4918 = (ref inout(RangeT!(const(Array!(Task)))) this = this;) , ((ref inout(const(Array!(Task))) __inlineretval16434 = this._outer_[0];) , __inlineretval16434);
return (ulong i = this._a;) , ((ref inout(Task) __inlineretval16435 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4918._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4918._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval16435);
}
inout pure nothrow @nogc @property ref @safe inout(const(Task)) back()
{
assert(!((ref inout(RangeT!(const(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
const ref inout(const(Array!(Task))) __dop4919 = (ref inout(RangeT!(const(Array!(Task)))) this = this;) , ((ref inout(const(Array!(Task))) __inlineretval16436 = this._outer_[0];) , __inlineretval16436);
return (ulong i = this._b - 1LU;) , ((ref inout(Task) __inlineretval16437 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4919._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4919._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval16437);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(const(Array!(Task))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(const(Array!(Task))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(const(Array!(Task)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe inout(const(Task)) opIndex(ulong i)
{
assert(this._a + i < this._b);
const ref inout(const(Array!(Task))) __dop4920 = (ref inout(RangeT!(const(Array!(Task)))) this = this;) , ((ref inout(const(Array!(Task))) __inlineretval16438 = this._outer_[0];) , __inlineretval16438);
return (ulong i = this._a + i;) , ((ref inout(Task) __inlineretval16439 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4920._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4920._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval16439);
}
nothrow @nogc @system RangeT!(const(Array!(Task))) opSlice()
{
return (RangeT!(const(Array!(Task))) __slRange4921 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Task)) data = (ref RangeT!(const(Array!(Task))) this = this;) , ((ref inout(const(Array!(Task))) __inlineretval16440 = this._outer_[0];) , __inlineretval16440);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4921._outer_[] = data , __slRange4921._a = a , __slRange4921._b = b , __slRange4921);
}
nothrow @nogc @system RangeT!(const(Array!(Task))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(Task))) __slRange4922 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Task)) data = (ref RangeT!(const(Array!(Task))) this = this;) , ((ref inout(const(Array!(Task))) __inlineretval16441 = this._outer_[0];) , __inlineretval16441);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4922._outer_[] = data , __slRange4922._a = a , __slRange4922._b = b , __slRange4922);
}
const nothrow @nogc @system RangeT!(const(Array!(Task))) opSlice()
{
return (RangeT!(const(Array!(Task))) __slRange4923 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Task)) data = (ref const(RangeT!(const(Array!(Task)))) this = this;) , ((ref inout(const(Array!(Task))) __inlineretval16442 = this._outer_[0];) , __inlineretval16442);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4923._outer_[] = data , __slRange4923._a = a , __slRange4923._b = b , __slRange4923);
}
const nothrow @nogc @system RangeT!(const(Array!(Task))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(Task))) __slRange4924 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Task)) data = (ref const(RangeT!(const(Array!(Task)))) this = this;) , ((ref inout(const(Array!(Task))) __inlineretval16443 = this._outer_[0];) , __inlineretval16443);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4924._outer_[] = data , __slRange4924._a = a , __slRange4924._b = b , __slRange4924);
}
static if (isMutable!(const(Array!(Task)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(Task)[] a = (&this._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(Task)[] a = (&this._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(Task)[] a = (&this._outer_)[0..1];
{
Array!(Task)[] __r4914 = a[];
ulong __key4915 = 0LU;
for (; __key4915 < __r4914.length; __key4915 += 1LU)
{
ref Array!(Task) e = __r4914[__key4915];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(Task)[] a = (&this._outer_)[0..1];
{
Array!(Task)[] __r4914 = a[];
ulong __key4915 = 0LU;
for (; __key4915 < __r4914.length; __key4915 += 1LU)
{
ref Array!(Task) e = __r4914[__key4915];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(const(Array!(Task))) opAssign(RangeT!(const(Array!(Task))) p)
{
(RangeT!(const(Array!(Task))) __swap4912 = void;) , __swap4912 = this , this = p;
{
{
Array!(Task)[] a = (&__swap4912._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(immutable(Array!(Task)))
struct RangeT
{
private immutable immutable(Array!(Task)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe immutable(Array!(Task)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = immutable(Task);
private nothrow @nogc @system this(ref immutable(Array!(Task)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(immutable(Array!(Task))) save()
{
return (RangeT!(immutable(Array!(Task))) __copytmp4937 = (__copytmp4937 = this).__fieldPostblit();) , __copytmp4937;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe immutable(Task) front()
{
assert(!((ref inout(RangeT!(immutable(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
immutable ref immutable(Array!(Task)) __dop4938 = (ref inout(RangeT!(immutable(Array!(Task)))) this = this;) , ((ref immutable(Array!(Task)) __inlineretval16444 = this._outer_[0];) , __inlineretval16444);
return (ulong i = this._a;) , ((ref inout(Task) __inlineretval16445 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4938._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4938._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval16445);
}
inout pure nothrow @nogc @property ref @safe immutable(Task) back()
{
assert(!((ref inout(RangeT!(immutable(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
immutable ref immutable(Array!(Task)) __dop4939 = (ref inout(RangeT!(immutable(Array!(Task)))) this = this;) , ((ref immutable(Array!(Task)) __inlineretval16446 = this._outer_[0];) , __inlineretval16446);
return (ulong i = this._b - 1LU;) , ((ref inout(Task) __inlineretval16447 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4939._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4939._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval16447);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(immutable(Array!(Task))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(immutable(Array!(Task))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(immutable(Array!(Task)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe immutable(Task) opIndex(ulong i)
{
assert(this._a + i < this._b);
immutable ref immutable(Array!(Task)) __dop4940 = (ref inout(RangeT!(immutable(Array!(Task)))) this = this;) , ((ref immutable(Array!(Task)) __inlineretval16448 = this._outer_[0];) , __inlineretval16448);
return (ulong i = this._a + i;) , ((ref inout(Task) __inlineretval16449 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4940._data;) , ((ref inout(RefCountedStore) __inlineretval14676 = this._refCounted;)) , __inlineretval14676._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4940._data;) , ((ref inout(Payload) __inlineretval14677 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14677))._payload[i];) , __inlineretval16449);
}
nothrow @nogc @system RangeT!(immutable(Array!(Task))) opSlice()
{
return (RangeT!(immutable(Array!(Task))) __slRange4941 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Task)) data = (ref RangeT!(immutable(Array!(Task))) this = this;) , ((ref immutable(Array!(Task)) __inlineretval16450 = this._outer_[0];) , __inlineretval16450);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4941._outer_[] = data , __slRange4941._a = a , __slRange4941._b = b , __slRange4941);
}
nothrow @nogc @system RangeT!(immutable(Array!(Task))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(Task))) __slRange4942 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Task)) data = (ref RangeT!(immutable(Array!(Task))) this = this;) , ((ref immutable(Array!(Task)) __inlineretval16451 = this._outer_[0];) , __inlineretval16451);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4942._outer_[] = data , __slRange4942._a = a , __slRange4942._b = b , __slRange4942);
}
const nothrow @nogc @system RangeT!(immutable(Array!(Task))) opSlice()
{
return (RangeT!(immutable(Array!(Task))) __slRange4943 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Task)) data = (ref const(RangeT!(immutable(Array!(Task)))) this = this;) , ((ref immutable(Array!(Task)) __inlineretval16452 = this._outer_[0];) , __inlineretval16452);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4943._outer_[] = data , __slRange4943._a = a , __slRange4943._b = b , __slRange4943);
}
const nothrow @nogc @system RangeT!(immutable(Array!(Task))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(Task))) __slRange4944 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Task)) data = (ref const(RangeT!(immutable(Array!(Task)))) this = this;) , ((ref immutable(Array!(Task)) __inlineretval16453 = this._outer_[0];) , __inlineretval16453);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4944._outer_[] = data , __slRange4944._a = a , __slRange4944._b = b , __slRange4944);
}
static if (isMutable!(immutable(Array!(Task)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(Task)[] a = (cast(Array!(Task)*)&this._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(Task)[] a = (cast(Array!(Task)*)&this._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(Task)[] a = (cast(Array!(Task)*)&this._outer_)[0..1];
{
Array!(Task)[] __r4914 = a[];
ulong __key4915 = 0LU;
for (; __key4915 < __r4914.length; __key4915 += 1LU)
{
ref Array!(Task) e = __r4914[__key4915];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(Task)[] a = (cast(Array!(Task)*)&this._outer_)[0..1];
{
Array!(Task)[] __r4914 = a[];
ulong __key4915 = 0LU;
for (; __key4915 < __r4914.length; __key4915 += 1LU)
{
ref Array!(Task) e = __r4914[__key4915];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(immutable(Array!(Task))) opAssign(RangeT!(immutable(Array!(Task))) p)
{
(RangeT!(immutable(Array!(Task))) __swap4936 = void;) , __swap4936 = this , this = p;
{
{
Array!(Task)[] a = (cast(Array!(Task)*)&__swap4936._outer_)[0..1];
{
Array!(Task)[] __r4916 = a[];
ulong __key4917 = __r4916.length;
for (; __key4917--;)
{
ref Array!(Task) e = __r4916[__key4917];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
static __gshared TypeInfo_Const _D71TypeInfo_xS3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5Array6__initZ;
static __gshared TypeInfo_Const _D31TypeInfo_xS4vibe4core4task4Task6__initZ;
static __gshared TypeInfo_Const _D73TypeInfo_xG1S3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5Array6__initZ;
static __gshared TypeInfo_Struct _D70TypeInfo_S3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5Array6__initZ;
static __gshared TypeInfo_Struct _D30TypeInfo_S4vibe4core4task4Task6__initZ;
static __gshared TypeInfo_Invariant _D71TypeInfo_yS3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D73TypeInfo_yG1S3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5Array6__initZ;
Array!(Array!(Task))
struct Array
{
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memmove, memset;
import core.memory : GC;
import std.exception : enforce;
import std.typecons : RefCounted, RefCountedAutoInitialize;
private struct Payload
{
ulong _capacity;
Array!(Task)[] _payload;
pure nothrow @nogc @safe this(Array!(Task)[] p)
{
this._capacity = p.length;
this._payload = p;
return this;
}
~this()
{
{
Array!(Task)[] __r4946 = this._payload[];
ulong __key4947 = 0LU;
for (; __key4947 < __r4946.length; __key4947 += 1LU)
{
ref Array!(Task) e = __r4946[__key4947];
destroy(e);
}
}
{
const(void*) p = cast(const(void*))cast(Array!(Task)*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Array!(Task)*)this._payload);
}
this(this)
{
halt;
}
nothrow @nogc @system void opAssign(Payload rhs)
{
try
{
halt;
}
finally
{
{
{
Array!(Task)[] __r4946 = rhs._payload[];
ulong __key4947 = 0LU;
for (; __key4947 < __r4946.length; __key4947 += 1LU)
{
ref Array!(Task) e = __r4946[__key4947];
destroy(e);
}
}
{
const(void*) p = cast(const(void*))cast(Array!(Task)*)rhs._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Array!(Task)*)rhs._payload);
}
}
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._payload.length;
}
nothrow @nogc @property @system void length(ulong newLength)
{
import std.algorithm.mutation : initializeAll;
if (((ref Payload this = this;) , this._payload.length) >= newLength)
{
{
Array!(Task)[] __r7804 = (cast(Array!(Task)*)this._payload)[newLength..this._payload.length];
ulong __key7805 = 0LU;
for (; __key7805 < __r7804.length; __key7805 += 1LU)
{
ref Array!(Task) e = __r7804[__key7805];
destroy(e);
}
}
this._payload = (cast(Array!(Task)*)this._payload)[0..newLength];
return ;
}
immutable immutable(ulong) startEmplace = (ref Payload this = this;) , this._payload.length;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) nbytes = (ulong x = newLength;) , ((ulong y = 8LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
this._payload = (cast(Array!(Task)*)realloc(cast(void*)cast(Array!(Task)*)this._payload, nbytes))[0..newLength];
{
Array!(Task)[] range = (cast(Array!(Task)*)this._payload)[startEmplace..newLength];
alias T = Array!(Task);
const(void)[] p = typeid(Array!(Task)).initializer();
if (cast(const(void)*)p)
{
for (; !((const(Array!(Task)[]) a = range;) , !a.length); (ref Array!(Task)[] a = range;) , cast(void)(assert(a.length, "Attempting to popFront() past the end of an array of Array!(Task)") , a = a[1..__dollar]))
{
{
memcpy(cast(void*)((ref Array!(Task) val = (Array!(Task)[] a = range;) , ((ref Array!(Task) __inlineretval15073 = assert(a.length, "Attempting to fetch the front of an empty array of Array!(Task)") , a[0];) , __inlineretval15073);) , &val), cast(const(void)*)p, 8LU);
}
}
}
else
{
memset(cast(void*)cast(Array!(Task)*)range, 0, range.length * 8LU);
}
}
this._capacity = newLength;
}
const pure nothrow @nogc @property @safe ulong capacity()
{
return this._capacity;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (elements <= ((ref Payload this = this;) , this._capacity))
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 8LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
immutable immutable(ulong) oldLength = (ref Payload this = this;) , this._payload.length;
Array!(Task)* newPayloadPtr = cast(Array!(Task)*)malloc(sz);
newPayloadPtr || halt;
Array!(Task)[] newPayload = newPayloadPtr[0..oldLength];
memcpy(cast(void*)cast(Array!(Task)*)newPayload, cast(const(void*))cast(Array!(Task)*)this._payload, 8LU * oldLength);
memset(cast(void*)(cast(Array!(Task)*)newPayload + cast(long)oldLength * 8L), 0, (elements - oldLength) * 8LU);
{
(const(void*) p = cast(const(void*))cast(Array!(Task)*)newPayload;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
const(void*) p = cast(const(void*))cast(Array!(Task)*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Array!(Task)*)this._payload);
this._payload = newPayload;
this._capacity = elements;
}
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
if (_capacity == length)
{
reserve(1 + capacity * 3 / 2);
}
assert(capacity > length && _payload.ptr);
emplace(_payload.ptr + _payload.length, stuff);
_payload = _payload.ptr[0.._payload.length + 1];
return 1;
}
size_t insertBack(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
static if (hasLength!Stuff
)
{
immutable oldLength = length;
reserve(oldLength + stuff.length);
}
size_t result;
foreach (item; stuff)
{
insertBack(item);
++result;
}
static if (hasLength!Stuff
)
{
assert(length == oldLength + stuff.length);
}
return result;
}
alias __xdtor = ~this()
{
{
Array!(Task)[] __r4946 = this._payload[];
ulong __key4947 = 0LU;
for (; __key4947 < __r4946.length; __key4947 += 1LU)
{
ref Array!(Task) e = __r4946[__key4947];
destroy(e);
}
}
{
const(void*) p = cast(const(void*))cast(Array!(Task)*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Array!(Task)*)this._payload);
}
;
alias __xpostblit = this(this)
{
halt;
}
;
}
private alias Data = RefCounted!(Payload, cast(RefCountedAutoInitialize)0);
private RefCounted!(Payload, cast(RefCountedAutoInitialize)0) _data;
this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)
)
{
import std.conv : emplace;
import core.checkedint : mulu;
bool overflow;
const nbytes = mulu(values.length, T.sizeof, overflow);
if (overflow)
assert(0);
auto p = cast(T*)malloc(nbytes);
static if (hasIndirections!T
)
{
if (p)
GC.addRange(p, T.sizeof * values.length);
}
foreach (i, e; values)
{
emplace(p + i, e);
}
_data = Data(p[0..values.length]);
}
this(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
&& !is(Stuff == T[]))
{
insertBack(stuff);
}
const nothrow @system bool opEquals(const(Array!(Array!(Task))) rhs)
{
try
{
return this.opEquals(rhs);
}
finally
{
{
rhs._data.~this();
}
}
}
const nothrow @safe bool opEquals(ref const(Array!(Array!(Task))) rhs)
{
if ((ref const(Array!(Array!(Task))) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16454 = this._refCounted;)) , __inlineretval16454._store !is null) || ((const(Array!(Task)[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16455 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16455))._payload;) , !a.length))
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16454 = this._refCounted;)) , __inlineretval16454._store !is null) || ((const(Array!(Task)[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16455 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16455))._payload;) , !a.length);
if (!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16454 = this._refCounted;)) , __inlineretval16454._store !is null) || ((const(Array!(Task)[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16455 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16455))._payload;) , !a.length))
return false;
return _ArrayEq(((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16456 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16456))._payload, ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16457 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16457))._payload);
}
alias Range = RangeT!(Array!(Array!(Task)));
alias ConstRange = RangeT!(const(Array!(Array!(Task))));
alias ImmutableRange = RangeT!(immutable(Array!(Array!(Task))));
nothrow @nogc @property @system Array!(Array!(Task)) dup()
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16458 = this._refCounted;)) , __inlineretval16458._store !is null))
return (Array!(Array!(Task)) __copytmp7813 = (ref Array!(Array!(Task)) this = __copytmp7813 = this;) , this._data.__postblit();) , __copytmp7813;
return ((Array!(Array!(Task)) __slArray7812 = Array(RefCounted(RefCountedStore(null)));) , __slArray7812).this(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16459 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16459))._payload);
}
const pure nothrow @nogc @property @safe bool empty()
{
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16454 = this._refCounted;)) , __inlineretval16454._store !is null) || ((const(Array!(Task)[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16455 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16455))._payload;) , !a.length);
}
const pure nothrow @nogc @property @safe ulong length()
{
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU;
}
const pure nothrow @nogc @safe ulong opDollar()
{
return (ref const(Array!(Array!(Task))) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU;
}
pure nothrow @nogc @property @safe ulong capacity()
{
return ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15636 = this._refCounted;)) , __inlineretval15636._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval15637 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15637))._capacity : 0LU;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16460 = this._refCounted;)) , __inlineretval16460._store !is null))
{
if (!elements)
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 8LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
void* p = malloc(sz);
p || halt;
{
(const(void*) p = p;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = ((RefCounted!(Payload, cast(RefCountedAutoInitialize)0) __slRefCo7356 = RefCounted(RefCountedStore(null));) , __slRefCo7356).this(cast(Array!(Task)[])p[0..0]);
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16461 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16461))._capacity = elements;
}
else
{
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16462 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16462)).reserve(elements);
}
}
nothrow @nogc @system RangeT!(Array!(Array!(Task))) opSlice()
{
return (RangeT!(Array!(Array!(Task))) __slRange7814 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Array!(Task)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref Array!(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU;))) , (__slRange7814._outer_[] = data , __slRange7814._a = a , __slRange7814._b = b , __slRange7814);
}
const nothrow @nogc @system RangeT!(const(Array!(Array!(Task)))) opSlice()
{
return (RangeT!(const(Array!(Array!(Task)))) __slRange7815 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Array!(Task))) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref const(Array!(Array!(Task))) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU;))) , (__slRange7815._outer_[] = data , __slRange7815._a = a , __slRange7815._b = b , __slRange7815);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(Array!(Task)))) opSlice()
{
return (RangeT!(immutable(Array!(Array!(Task)))) __slRange7816 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Array!(Task))) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref immutable(Array!(Array!(Task))) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU;))) , (__slRange7816._outer_[] = data , __slRange7816._a = a , __slRange7816._b = b , __slRange7816);
}
nothrow @nogc @system RangeT!(Array!(Array!(Task))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref Array!(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU));
return (RangeT!(Array!(Array!(Task))) __slRange7817 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Array!(Task)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7817._outer_[] = data , __slRange7817._a = a , __slRange7817._b = b , __slRange7817);
}
const nothrow @nogc @system RangeT!(const(Array!(Array!(Task)))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref const(Array!(Array!(Task))) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU));
return (RangeT!(const(Array!(Array!(Task)))) __slRange7818 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Array!(Task))) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7818._outer_[] = data , __slRange7818._a = a , __slRange7818._b = b , __slRange7818);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(Array!(Task)))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref immutable(Array!(Array!(Task))) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU));
return (RangeT!(immutable(Array!(Array!(Task)))) __slRange7819 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Array!(Task))) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7819._outer_[] = data , __slRange7819._a = a , __slRange7819._b = b , __slRange7819);
}
inout pure nothrow @nogc @property ref @safe inout(Array!(Task)) front()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16463 = this._refCounted;)) , __inlineretval16463._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16464 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16464))._payload[0];
}
inout pure nothrow @nogc @property ref @safe inout(Array!(Task)) back()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16465 = this._refCounted;)) , __inlineretval16465._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16466 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16466))._payload[__dollar - 1LU];
}
inout pure nothrow @nogc ref @safe inout(Array!(Task)) opIndex(ulong i)
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];
}
nothrow @nogc @system void opSliceAssign(Array!(Task) value)
{
try
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16467 = this._refCounted;)) , __inlineretval16467._store !is null))
return ;
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16468 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16468))._payload[] = value;
}
finally
{
{
value._data.~this();
}
}
}
nothrow @nogc @system void opSliceAssign(Array!(Task) value, ulong i, ulong j)
{
Array!(Task)[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16469 = this._refCounted;)) , __inlineretval16469._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16470 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16470))._payload : null;
slice[i..j] = value;
{
value._data.~this();
}
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin(op ~ "_data._payload[];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin(op ~ "slice[i .. j];");
}
void opSliceOpAssign(string op)(T value)
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin("_data._payload[] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(T value, size_t i, size_t j)
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin("slice[i .. j] " ~ op ~ "= value;");
}
Array opBinary(string op, Stuff)(Stuff stuff) if (op == "~")
{
Array result;
result ~= this[];
assert(result.length == length);
result ~= stuff[];
return result;
}
void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~")
{
static if (is(typeof(stuff[])))
{
insertBack(stuff[]);
}
else
{
insertBack(stuff);
}
}
nothrow @nogc @system void clear()
{
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
nothrow @nogc @property @system void length(ulong newLength)
{
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16471 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16471;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16471;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16472 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16472)).length(newLength);
}
@system Array!(Task) removeAny()
{
Array!(Task) result = (ref Array!(Task) this = result = ((ref Array!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16473 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16465 = this._refCounted;)) , __inlineretval16465._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16466 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16466))._payload[__dollar - 1LU];) , __inlineretval16473));) , this._data.__postblit();
try
this.removeBack();
return result;
catch(Throwable __o7820)
{
{
result._data.~this();
}
throw __o7820;
}
}
alias stableRemoveAny = @system Array!(Task) removeAny()
{
Array!(Task) result = (ref Array!(Task) this = result = ((ref Array!(Array!(Task)) this = this;) , ((ref inout(Array!(Task)) __inlineretval16473 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16465 = this._refCounted;)) , __inlineretval16465._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16466 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16466))._payload[__dollar - 1LU];) , __inlineretval16473));) , this._data.__postblit();
try
this.removeBack();
return result;
catch(Throwable __o7820)
{
{
result._data.~this();
}
throw __o7820;
}
}
;
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
alias insert = size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
;
@system void removeBack()
{
enforce(!((ref Array!(Array!(Task)) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16454 = this._refCounted;)) , __inlineretval16454._store !is null) || ((const(Array!(Task)[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16455 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16455))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
destroy(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16474 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16474))._payload[__dollar - 1LU]);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16475 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16475))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16476 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16476))._payload[0..__dollar - 1LU];
}
alias stableRemoveBack = @system void stableRemoveBack();
;
nothrow @nogc @system ulong removeBack(ulong howMany)
{
if (howMany > ((ref Array!(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU))
howMany = ((ref Array!(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU);
{
Array!(Task)[] __r7821 = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16477 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16477))._payload[__dollar - howMany..__dollar];
ulong __key7822 = 0LU;
for (; __key7822 < __r7821.length; __key7822 += 1LU)
{
ref Array!(Task) e = __r7821[__key7822];
destroy(e);
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16478 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16478))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16479 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16479))._payload[0..__dollar - howMany];
return howMany;
}
alias stableRemoveBack = @system void removeBack()
{
enforce(!((ref Array!(Array!(Task)) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16454 = this._refCounted;)) , __inlineretval16454._store !is null) || ((const(Array!(Task)[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16455 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16455))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
destroy(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16474 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16474))._payload[__dollar - 1LU]);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16475 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16475))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16476 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16476))._payload[0..__dollar - 1LU];
}
;
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
reserve(length + 1);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + 1, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
emplace(_data._payload.ptr + r._a, stuff);
_data._payload = _data._payload.ptr[0.._data._payload.length + 1];
return 1;
}
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
static if (isForwardRange!Stuff
)
{
auto extra = walkLength(stuff);
if (!extra)
return 0;
reserve(length + extra);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + extra, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
foreach (p; _data._payload.ptr + r._a .. _data._payload.ptr + r._a + extra)
{
emplace(p, stuff.front);
stuff.popFront();
}
_data._payload = _data._payload.ptr[0.._data._payload.length + extra];
return extra;
}
else
{
import std.algorithm.mutation : bringToFront;
enforce(_data);
immutable offset = r._a;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
}
size_t insertAfter(Stuff)(Range r, Stuff stuff)
{
import std.algorithm.mutation : bringToFront;
enforce(r._outer._data is _data);
immutable offset = r._b;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
enforce(r._outer._data is _data);
size_t result;
for (; !stuff.empty; stuff.popFront())
{
{
if (r.empty)
{
return result + insertBefore(r, stuff);
}
r.front = stuff.front;
r.popFront();
++result;
}
}
linearRemove(r);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
enforce(r._outer._data is _data);
if (r.empty)
{
insertBefore(r, stuff);
}
else
{
r.front = stuff;
r.popFront();
linearRemove(r);
}
return 1;
}
@system RangeT!(Array!(Array!(Task))) linearRemove(RangeT!(Array!(Array!(Task))) r)
{
try
{
import std.algorithm.mutation : copy;
enforce(((ref inout(Array!(Array!(Task))) __inlineretval16480 = r._outer_[0];) , __inlineretval16480)._data is this._data, delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 988LU);
enforce(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16481 = this._refCounted;)) , __inlineretval16481._store !is null), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 989LU);
enforce(r._a <= r._b && r._b <= ((ref Array!(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 990LU);
immutable immutable(ulong) offset1 = r._a;
immutable immutable(ulong) offset2 = r._b;
immutable immutable(ulong) tailLength = ((ref Array!(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU) - offset2;
(RangeT!(Array!(Array!(Task))) __tmpfordtor7830 = copy(this.opSlice(offset2, ((ref Array!(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU)), this.opSlice(offset1, offset1 + tailLength));) , __tmpfordtor7830;
{
ref Array!(Array!(Task)) this = this;
ulong newLength = offset1 + tailLength;
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16471 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16471;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16471;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16472 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16472)).length(newLength);
}
return this.opSlice(((ref Array!(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU) - tailLength, ((ref Array!(Array!(Task)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU));
}
finally
{
{
{
Array!(Array!(Task))[] a = (&r._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
}
}
~this()
{
this._data.~this();
}
alias __xdtor = ~this()
{
this._data.~this();
}
;
this(this)
{
this._data.__postblit();
}
alias __xpostblit = this(this)
{
this._data.__postblit();
}
;
nothrow @nogc ref return @system Array!(Array!(Task)) opAssign(Array!(Array!(Task)) p)
{
(Array!(Array!(Task)) __swap4952 = void;) , __swap4952 = this , this = p;
{
__swap4952._data.~this();
}
return this;
}
}
RangeT!(Array!(Array!(Task)))
struct RangeT
{
private Array!(Array!(Task))[1] _outer_;
private inout pure nothrow @nogc @property ref @safe inout(Array!(Array!(Task))) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = Array!(Task);
private nothrow @nogc @system this(ref Array!(Array!(Task)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(Array!(Array!(Task))) save()
{
return (RangeT!(Array!(Array!(Task))) __copytmp4967 = (__copytmp4967 = this).__fieldPostblit();) , __copytmp4967;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(Array!(Task)) front()
{
assert(!((ref inout(RangeT!(Array!(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
inout ref inout(Array!(Array!(Task))) __dop4968 = (ref inout(RangeT!(Array!(Array!(Task)))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval14699 = this._outer_[0];) , __inlineretval14699);
return (ulong i = this._a;) , ((ref inout(Array!(Task)) __inlineretval14702 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4968._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4968._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval14702);
}
inout pure nothrow @nogc @property ref @safe inout(Array!(Task)) back()
{
assert(!((ref inout(RangeT!(Array!(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
inout ref inout(Array!(Array!(Task))) __dop4969 = (ref inout(RangeT!(Array!(Array!(Task)))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16482 = this._outer_[0];) , __inlineretval16482);
return (ulong i = this._b - 1LU;) , ((ref inout(Array!(Task)) __inlineretval16483 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4969._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4969._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval16483);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(Array!(Array!(Task))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(Array!(Array!(Task))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(Array!(Array!(Task)))
enum bool isMutable = true;
)
{
import std.algorithm.mutation : move;
nothrow @nogc @system Array!(Task) moveFront()
{
assert(!((ref RangeT!(Array!(Array!(Task))) this = this;) , this._a >= this._b) && this._a < ((ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16484 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16484._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16484._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU));
return (ref Array!(Task) source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16485 = this._outer_[0];) , __inlineretval16485))._data;) , ((ref inout(Payload) __inlineretval16486 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16486))._payload[this._a];) , ((Array!(Task) __inlineretval16487 = moveImpl(source);) , __inlineretval16487);
}
nothrow @nogc @system Array!(Task) moveBack()
{
assert(!((ref RangeT!(Array!(Array!(Task))) this = this;) , this._a >= this._b) && this._b <= ((ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16488 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16488._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16488._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU));
return (ref Array!(Task) source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16489 = this._outer_[0];) , __inlineretval16489))._data;) , ((ref inout(Payload) __inlineretval16490 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16490))._payload[this._b - 1LU];) , ((Array!(Task) __inlineretval16491 = moveImpl(source);) , __inlineretval16491);
}
nothrow @nogc @system Array!(Task) moveAt(ulong i)
{
assert(this._a + i < this._b && this._a + i < ((ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16492 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16492._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16492._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU));
return (ref Array!(Task) source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16493 = this._outer_[0];) , __inlineretval16493))._data;) , ((ref inout(Payload) __inlineretval16494 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16494))._payload[this._a + i];) , ((Array!(Task) __inlineretval16495 = moveImpl(source);) , __inlineretval16495);
}
}
inout pure nothrow @nogc ref @safe inout(Array!(Task)) opIndex(ulong i)
{
assert(this._a + i < this._b);
inout ref inout(Array!(Array!(Task))) __dop4979 = (ref inout(RangeT!(Array!(Array!(Task)))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval15074 = this._outer_[0];) , __inlineretval15074);
return (ulong i = this._a + i;) , ((ref inout(Array!(Task)) __inlineretval15075 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4979._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4979._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval15075);
}
nothrow @nogc @system RangeT!(Array!(Array!(Task))) opSlice()
{
return (RangeT!(Array!(Array!(Task))) __slRange4980 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Array!(Task)) data = (ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16496 = this._outer_[0];) , __inlineretval16496);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4980._outer_[] = data , __slRange4980._a = a , __slRange4980._b = b , __slRange4980);
}
nothrow @nogc @system RangeT!(Array!(Array!(Task))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(Array!(Array!(Task))) __slRange4981 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Array!(Task)) data = (ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16497 = this._outer_[0];) , __inlineretval16497);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4981._outer_[] = data , __slRange4981._a = a , __slRange4981._b = b , __slRange4981);
}
const nothrow @nogc @system RangeT!(const(Array!(Array!(Task)))) opSlice()
{
return (RangeT!(const(Array!(Array!(Task)))) __slRange4982 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Array!(Task))) data = (ref const(RangeT!(Array!(Array!(Task)))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16498 = this._outer_[0];) , __inlineretval16498);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4982._outer_[] = data , __slRange4982._a = a , __slRange4982._b = b , __slRange4982);
}
const nothrow @nogc @system RangeT!(const(Array!(Array!(Task)))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(Array!(Task)))) __slRange4983 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Array!(Task))) data = (ref const(RangeT!(Array!(Array!(Task)))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16499 = this._outer_[0];) , __inlineretval16499);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4983._outer_[] = data , __slRange4983._a = a , __slRange4983._b = b , __slRange4983);
}
static if (isMutable!(Array!(Array!(Task)))
)
{
nothrow @nogc @system void opSliceAssign(Array!(Task) value)
{
assert(this._b <= ((ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16500 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16500._data;) , ((ref inout(RefCountedStore) __inlineretval15624 = this._refCounted;)) , __inlineretval15624._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16500._data;) , ((ref inout(Payload) __inlineretval15625 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15625))._payload.length : 0LU));
{
(ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16501 = this._outer_[0];));
(Array!(Task) value = (Array!(Task) __copytmp4984 = (ref Array!(Task) this = __copytmp4984 = value;) , this._data.__postblit();) , __copytmp4984;) , ((ulong i = this._a;)) , ((ulong j = this._b;));
Array!(Task)[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16501._data;) , ((ref inout(RefCountedStore) __inlineretval16469 = this._refCounted;)) , __inlineretval16469._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16501._data;) , ((ref inout(Payload) __inlineretval16470 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16470))._payload : null;
slice[i..j] = value;
{
value._data.~this();
}
}
{
value._data.~this();
}
}
nothrow @nogc @system void opSliceAssign(Array!(Task) value, ulong i, ulong j)
{
assert(this._a + j <= this._b);
{
(ref RangeT!(Array!(Array!(Task))) this = this;) , ((ref inout(Array!(Array!(Task))) __inlineretval16502 = this._outer_[0];));
(Array!(Task) value = (Array!(Task) __copytmp4985 = (ref Array!(Task) this = __copytmp4985 = value;) , this._data.__postblit();) , __copytmp4985;) , ((ulong i = this._a + i;)) , ((ulong j = this._a + j;));
Array!(Task)[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16502._data;) , ((ref inout(RefCountedStore) __inlineretval16469 = this._refCounted;)) , __inlineretval16469._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16502._data;) , ((ref inout(Payload) __inlineretval16470 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16470))._payload : null;
slice[i..j] = value;
{
value._data.~this();
}
}
{
value._data.~this();
}
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(Array!(Task))[] a = (&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(Array!(Task))[] a = (&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(Array!(Task))[] a = (&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4955 = a[];
ulong __key4956 = 0LU;
for (; __key4956 < __r4955.length; __key4956 += 1LU)
{
ref Array!(Array!(Task)) e = __r4955[__key4956];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(Array!(Task))[] a = (&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4955 = a[];
ulong __key4956 = 0LU;
for (; __key4956 < __r4955.length; __key4956 += 1LU)
{
ref Array!(Array!(Task)) e = __r4955[__key4956];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(Array!(Array!(Task))) opAssign(RangeT!(Array!(Array!(Task))) p)
{
(RangeT!(Array!(Array!(Task))) __swap4966 = void;) , __swap4966 = this , this = p;
{
{
Array!(Array!(Task))[] a = (&__swap4966._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(const(Array!(Array!(Task))))
struct RangeT
{
private const const(Array!(Array!(Task))[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe inout(const(Array!(Array!(Task)))) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = const(Array!(Task));
private nothrow @nogc @system this(ref const(Array!(Array!(Task))) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(const(Array!(Array!(Task)))) save()
{
return (RangeT!(const(Array!(Array!(Task)))) __copytmp4954 = (__copytmp4954 = this).__fieldPostblit();) , __copytmp4954;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(const(Array!(Task))) front()
{
assert(!((ref inout(RangeT!(const(Array!(Array!(Task))))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
const ref inout(const(Array!(Array!(Task)))) __dop4959 = (ref inout(RangeT!(const(Array!(Array!(Task))))) this = this;) , ((ref inout(const(Array!(Array!(Task)))) __inlineretval16503 = this._outer_[0];) , __inlineretval16503);
return (ulong i = this._a;) , ((ref inout(Array!(Task)) __inlineretval16504 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4959._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4959._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval16504);
}
inout pure nothrow @nogc @property ref @safe inout(const(Array!(Task))) back()
{
assert(!((ref inout(RangeT!(const(Array!(Array!(Task))))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
const ref inout(const(Array!(Array!(Task)))) __dop4960 = (ref inout(RangeT!(const(Array!(Array!(Task))))) this = this;) , ((ref inout(const(Array!(Array!(Task)))) __inlineretval16505 = this._outer_[0];) , __inlineretval16505);
return (ulong i = this._b - 1LU;) , ((ref inout(Array!(Task)) __inlineretval16506 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4960._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4960._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval16506);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(const(Array!(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(const(Array!(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(const(Array!(Array!(Task))))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe inout(const(Array!(Task))) opIndex(ulong i)
{
assert(this._a + i < this._b);
const ref inout(const(Array!(Array!(Task)))) __dop4961 = (ref inout(RangeT!(const(Array!(Array!(Task))))) this = this;) , ((ref inout(const(Array!(Array!(Task)))) __inlineretval16507 = this._outer_[0];) , __inlineretval16507);
return (ulong i = this._a + i;) , ((ref inout(Array!(Task)) __inlineretval16508 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4961._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4961._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval16508);
}
nothrow @nogc @system RangeT!(const(Array!(Array!(Task)))) opSlice()
{
return (RangeT!(const(Array!(Array!(Task)))) __slRange4962 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Array!(Task))) data = (ref RangeT!(const(Array!(Array!(Task)))) this = this;) , ((ref inout(const(Array!(Array!(Task)))) __inlineretval16509 = this._outer_[0];) , __inlineretval16509);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4962._outer_[] = data , __slRange4962._a = a , __slRange4962._b = b , __slRange4962);
}
nothrow @nogc @system RangeT!(const(Array!(Array!(Task)))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(Array!(Task)))) __slRange4963 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Array!(Task))) data = (ref RangeT!(const(Array!(Array!(Task)))) this = this;) , ((ref inout(const(Array!(Array!(Task)))) __inlineretval16510 = this._outer_[0];) , __inlineretval16510);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4963._outer_[] = data , __slRange4963._a = a , __slRange4963._b = b , __slRange4963);
}
const nothrow @nogc @system RangeT!(const(Array!(Array!(Task)))) opSlice()
{
return (RangeT!(const(Array!(Array!(Task)))) __slRange4964 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Array!(Task))) data = (ref const(RangeT!(const(Array!(Array!(Task))))) this = this;) , ((ref inout(const(Array!(Array!(Task)))) __inlineretval16511 = this._outer_[0];) , __inlineretval16511);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4964._outer_[] = data , __slRange4964._a = a , __slRange4964._b = b , __slRange4964);
}
const nothrow @nogc @system RangeT!(const(Array!(Array!(Task)))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(Array!(Task)))) __slRange4965 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Array!(Task))) data = (ref const(RangeT!(const(Array!(Array!(Task))))) this = this;) , ((ref inout(const(Array!(Array!(Task)))) __inlineretval16512 = this._outer_[0];) , __inlineretval16512);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4965._outer_[] = data , __slRange4965._a = a , __slRange4965._b = b , __slRange4965);
}
static if (isMutable!(const(Array!(Array!(Task))))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(Array!(Task))[] a = (&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(Array!(Task))[] a = (&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(Array!(Task))[] a = (&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4955 = a[];
ulong __key4956 = 0LU;
for (; __key4956 < __r4955.length; __key4956 += 1LU)
{
ref Array!(Array!(Task)) e = __r4955[__key4956];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(Array!(Task))[] a = (&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4955 = a[];
ulong __key4956 = 0LU;
for (; __key4956 < __r4955.length; __key4956 += 1LU)
{
ref Array!(Array!(Task)) e = __r4955[__key4956];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(const(Array!(Array!(Task)))) opAssign(RangeT!(const(Array!(Array!(Task)))) p)
{
(RangeT!(const(Array!(Array!(Task)))) __swap4953 = void;) , __swap4953 = this , this = p;
{
{
Array!(Array!(Task))[] a = (&__swap4953._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(immutable(Array!(Array!(Task))))
struct RangeT
{
private immutable immutable(Array!(Array!(Task))[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe immutable(Array!(Array!(Task))) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = immutable(Array!(Task));
private nothrow @nogc @system this(ref immutable(Array!(Array!(Task))) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(immutable(Array!(Array!(Task)))) save()
{
return (RangeT!(immutable(Array!(Array!(Task)))) __copytmp4987 = (__copytmp4987 = this).__fieldPostblit();) , __copytmp4987;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe immutable(Array!(Task)) front()
{
assert(!((ref inout(RangeT!(immutable(Array!(Array!(Task))))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
immutable ref immutable(Array!(Array!(Task))) __dop4988 = (ref inout(RangeT!(immutable(Array!(Array!(Task))))) this = this;) , ((ref immutable(Array!(Array!(Task))) __inlineretval16513 = this._outer_[0];) , __inlineretval16513);
return (ulong i = this._a;) , ((ref inout(Array!(Task)) __inlineretval16514 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4988._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4988._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval16514);
}
inout pure nothrow @nogc @property ref @safe immutable(Array!(Task)) back()
{
assert(!((ref inout(RangeT!(immutable(Array!(Array!(Task))))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
immutable ref immutable(Array!(Array!(Task))) __dop4989 = (ref inout(RangeT!(immutable(Array!(Array!(Task))))) this = this;) , ((ref immutable(Array!(Array!(Task))) __inlineretval16515 = this._outer_[0];) , __inlineretval16515);
return (ulong i = this._b - 1LU;) , ((ref inout(Array!(Task)) __inlineretval16516 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4989._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4989._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval16516);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(immutable(Array!(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(immutable(Array!(Array!(Task)))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(immutable(Array!(Array!(Task))))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe immutable(Array!(Task)) opIndex(ulong i)
{
assert(this._a + i < this._b);
immutable ref immutable(Array!(Array!(Task))) __dop4990 = (ref inout(RangeT!(immutable(Array!(Array!(Task))))) this = this;) , ((ref immutable(Array!(Array!(Task))) __inlineretval16517 = this._outer_[0];) , __inlineretval16517);
return (ulong i = this._a + i;) , ((ref inout(Array!(Task)) __inlineretval16518 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4990._data;) , ((ref inout(RefCountedStore) __inlineretval14700 = this._refCounted;)) , __inlineretval14700._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop4990._data;) , ((ref inout(Payload) __inlineretval14701 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14701))._payload[i];) , __inlineretval16518);
}
nothrow @nogc @system RangeT!(immutable(Array!(Array!(Task)))) opSlice()
{
return (RangeT!(immutable(Array!(Array!(Task)))) __slRange4991 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Array!(Task))) data = (ref RangeT!(immutable(Array!(Array!(Task)))) this = this;) , ((ref immutable(Array!(Array!(Task))) __inlineretval16519 = this._outer_[0];) , __inlineretval16519);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4991._outer_[] = data , __slRange4991._a = a , __slRange4991._b = b , __slRange4991);
}
nothrow @nogc @system RangeT!(immutable(Array!(Array!(Task)))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(Array!(Task)))) __slRange4992 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Array!(Task))) data = (ref RangeT!(immutable(Array!(Array!(Task)))) this = this;) , ((ref immutable(Array!(Array!(Task))) __inlineretval16520 = this._outer_[0];) , __inlineretval16520);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4992._outer_[] = data , __slRange4992._a = a , __slRange4992._b = b , __slRange4992);
}
const nothrow @nogc @system RangeT!(immutable(Array!(Array!(Task)))) opSlice()
{
return (RangeT!(immutable(Array!(Array!(Task)))) __slRange4993 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Array!(Task))) data = (ref const(RangeT!(immutable(Array!(Array!(Task))))) this = this;) , ((ref immutable(Array!(Array!(Task))) __inlineretval16521 = this._outer_[0];) , __inlineretval16521);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange4993._outer_[] = data , __slRange4993._a = a , __slRange4993._b = b , __slRange4993);
}
const nothrow @nogc @system RangeT!(immutable(Array!(Array!(Task)))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(Array!(Task)))) __slRange4994 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Array!(Task))) data = (ref const(RangeT!(immutable(Array!(Array!(Task))))) this = this;) , ((ref immutable(Array!(Array!(Task))) __inlineretval16522 = this._outer_[0];) , __inlineretval16522);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange4994._outer_[] = data , __slRange4994._a = a , __slRange4994._b = b , __slRange4994);
}
static if (isMutable!(immutable(Array!(Array!(Task))))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(Array!(Task))[] a = (cast(Array!(Array!(Task))*)&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(Array!(Task))[] a = (cast(Array!(Array!(Task))*)&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(Array!(Task))[] a = (cast(Array!(Array!(Task))*)&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4955 = a[];
ulong __key4956 = 0LU;
for (; __key4956 < __r4955.length; __key4956 += 1LU)
{
ref Array!(Array!(Task)) e = __r4955[__key4956];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(Array!(Task))[] a = (cast(Array!(Array!(Task))*)&this._outer_)[0..1];
{
Array!(Array!(Task))[] __r4955 = a[];
ulong __key4956 = 0LU;
for (; __key4956 < __r4955.length; __key4956 += 1LU)
{
ref Array!(Array!(Task)) e = __r4955[__key4956];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(immutable(Array!(Array!(Task)))) opAssign(RangeT!(immutable(Array!(Array!(Task)))) p)
{
(RangeT!(immutable(Array!(Array!(Task)))) __swap4986 = void;) , __swap4986 = this , this = p;
{
{
Array!(Array!(Task))[] a = (cast(Array!(Array!(Task))*)&__swap4986._outer_)[0..1];
{
Array!(Array!(Task))[] __r4957 = a[];
ulong __key4958 = __r4957.length;
for (; __key4958--;)
{
ref Array!(Array!(Task)) e = __r4957[__key4958];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
static __gshared TypeInfo_Const _D111TypeInfo_xS3std9container5array72__T5ArrayTS3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5ArrayZ5Array6__initZ;
static __gshared TypeInfo_Const _D113TypeInfo_xG1S3std9container5array72__T5ArrayTS3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5ArrayZ5Array6__initZ;
static __gshared TypeInfo_Struct _D110TypeInfo_S3std9container5array72__T5ArrayTS3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5ArrayZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D111TypeInfo_yS3std9container5array72__T5ArrayTS3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5ArrayZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D113TypeInfo_yG1S3std9container5array72__T5ArrayTS3std9container5array32__T5ArrayTS4vibe4core4task4TaskZ5ArrayZ5Array6__initZ;
Array!ulong
struct Array
{
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memmove, memset;
import core.memory : GC;
import std.exception : enforce;
import std.typecons : RefCounted, RefCountedAutoInitialize;
private struct Payload
{
ulong _capacity;
ulong[] _payload;
pure nothrow @nogc @safe this(ulong[] p)
{
this._capacity = p.length;
this._payload = p;
return this;
}
~this()
{
free(cast(void*)cast(ulong*)this._payload);
}
this(this)
{
halt;
}
nothrow @nogc @system void opAssign(Payload rhs)
{
try
{
halt;
}
finally
{
{
free(cast(void*)cast(ulong*)rhs._payload);
}
}
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._payload.length;
}
nothrow @nogc @property @system void length(ulong newLength)
{
import std.algorithm.mutation : initializeAll;
if (((ref Payload this = this;) , this._payload.length) >= newLength)
{
this._payload = (cast(ulong*)this._payload)[0..newLength];
return ;
}
immutable immutable(ulong) startEmplace = (ref Payload this = this;) , this._payload.length;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) nbytes = (ulong x = newLength;) , ((ulong y = 8LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
this._payload = (cast(ulong*)realloc(cast(void*)cast(ulong*)this._payload, nbytes))[0..newLength];
{
ulong[] range = (cast(ulong*)this._payload)[startEmplace..newLength];
alias T = ulong;
{
(ref ulong[] range = range;) , ((ulong value = 0LU;));
alias T = ulong;
range[] = value;
}
}
this._capacity = newLength;
}
const pure nothrow @nogc @property @safe ulong capacity()
{
return this._capacity;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (elements <= ((ref Payload this = this;) , this._capacity))
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 8LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
ulong* newPayloadPtr = cast(ulong*)realloc(cast(void*)cast(ulong*)this._payload, sz);
newPayloadPtr || halt;
ulong[] newPayload = newPayloadPtr[0..((ref Payload this = this;) , this._payload.length)];
this._payload = newPayload;
this._capacity = elements;
}
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
if (_capacity == length)
{
reserve(1 + capacity * 3 / 2);
}
assert(capacity > length && _payload.ptr);
emplace(_payload.ptr + _payload.length, stuff);
_payload = _payload.ptr[0.._payload.length + 1];
return 1;
}
size_t insertBack(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
static if (hasLength!Stuff
)
{
immutable oldLength = length;
reserve(oldLength + stuff.length);
}
size_t result;
foreach (item; stuff)
{
insertBack(item);
++result;
}
static if (hasLength!Stuff
)
{
assert(length == oldLength + stuff.length);
}
return result;
}
alias __xdtor = ~this()
{
free(cast(void*)cast(ulong*)this._payload);
}
;
alias __xpostblit = this(this)
{
halt;
}
;
}
private alias Data = RefCounted!(Payload, cast(RefCountedAutoInitialize)0);
private RefCounted!(Payload, cast(RefCountedAutoInitialize)0) _data;
this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)
)
{
import std.conv : emplace;
import core.checkedint : mulu;
bool overflow;
const nbytes = mulu(values.length, T.sizeof, overflow);
if (overflow)
assert(0);
auto p = cast(T*)malloc(nbytes);
static if (hasIndirections!T
)
{
if (p)
GC.addRange(p, T.sizeof * values.length);
}
foreach (i, e; values)
{
emplace(p + i, e);
}
_data = Data(p[0..values.length]);
}
this(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
&& !is(Stuff == T[]))
{
insertBack(stuff);
}
const nothrow @nogc @system bool opEquals(const(Array!ulong) rhs)
{
try
{
return this.opEquals(rhs);
}
finally
{
{
rhs._data.~this();
}
}
}
const pure nothrow @nogc @safe bool opEquals(ref const(Array!ulong) rhs)
{
if ((ref const(Array!ulong) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16119 = this._refCounted;)) , __inlineretval16119._store !is null) || ((const(ulong[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16120 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16120))._payload;) , !a.length))
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16119 = this._refCounted;)) , __inlineretval16119._store !is null) || ((const(ulong[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16120 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16120))._payload;) , !a.length);
if (!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16119 = this._refCounted;)) , __inlineretval16119._store !is null) || ((const(ulong[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16120 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16120))._payload;) , !a.length))
return false;
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16523 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16523))._payload == ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16524 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16524))._payload;
}
alias Range = RangeT!(Array!ulong);
alias ConstRange = RangeT!(const(Array!ulong));
alias ImmutableRange = RangeT!(immutable(Array!ulong));
nothrow @nogc @property @system Array!ulong dup()
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16525 = this._refCounted;)) , __inlineretval16525._store !is null))
return (Array!ulong __copytmp7835 = (ref Array!ulong this = __copytmp7835 = this;) , this._data.__postblit();) , __copytmp7835;
return ((Array!ulong __slArray7834 = Array(RefCounted(RefCountedStore(null)));) , __slArray7834).this(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16526 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16526))._payload);
}
const pure nothrow @nogc @property @safe bool empty()
{
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16119 = this._refCounted;)) , __inlineretval16119._store !is null) || ((const(ulong[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16120 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16120))._payload;) , !a.length);
}
const pure nothrow @nogc @property @safe ulong length()
{
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU;
}
const pure nothrow @nogc @safe ulong opDollar()
{
return (ref const(Array!ulong) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU;
}
pure nothrow @nogc @property @safe ulong capacity()
{
return ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15505 = this._refCounted;)) , __inlineretval15505._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval15506 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15506))._capacity : 0LU;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16527 = this._refCounted;)) , __inlineretval16527._store !is null))
{
if (!elements)
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 8LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
void* p = malloc(sz);
p || halt;
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = ((RefCounted!(Payload, cast(RefCountedAutoInitialize)0) __slRefCo6542 = RefCounted(RefCountedStore(null));) , __slRefCo6542).this(cast(ulong[])p[0..0]);
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16528 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16528))._capacity = elements;
}
else
{
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16529 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16529)).reserve(elements);
}
}
nothrow @nogc @system RangeT!(Array!ulong) opSlice()
{
return (RangeT!(Array!ulong) __slRange7836 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!ulong data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref Array!ulong this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU;))) , (__slRange7836._outer_[] = data , __slRange7836._a = a , __slRange7836._b = b , __slRange7836);
}
const nothrow @nogc @system RangeT!(const(Array!ulong)) opSlice()
{
return (RangeT!(const(Array!ulong)) __slRange7837 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!ulong) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref const(Array!ulong) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU;))) , (__slRange7837._outer_[] = data , __slRange7837._a = a , __slRange7837._b = b , __slRange7837);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!ulong)) opSlice()
{
return (RangeT!(immutable(Array!ulong)) __slRange7838 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!ulong) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref immutable(Array!ulong) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU;))) , (__slRange7838._outer_[] = data , __slRange7838._a = a , __slRange7838._b = b , __slRange7838);
}
nothrow @nogc @system RangeT!(Array!ulong) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref Array!ulong this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU));
return (RangeT!(Array!ulong) __slRange7839 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!ulong data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7839._outer_[] = data , __slRange7839._a = a , __slRange7839._b = b , __slRange7839);
}
const nothrow @nogc @system RangeT!(const(Array!ulong)) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref const(Array!ulong) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU));
return (RangeT!(const(Array!ulong)) __slRange7840 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!ulong) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7840._outer_[] = data , __slRange7840._a = a , __slRange7840._b = b , __slRange7840);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!ulong)) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref immutable(Array!ulong) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU));
return (RangeT!(immutable(Array!ulong)) __slRange7841 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!ulong) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7841._outer_[] = data , __slRange7841._a = a , __slRange7841._b = b , __slRange7841);
}
inout pure nothrow @nogc @property ref @safe inout(ulong) front()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16530 = this._refCounted;)) , __inlineretval16530._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16531 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16531))._payload[0];
}
inout pure nothrow @nogc @property ref @safe inout(ulong) back()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16121 = this._refCounted;)) , __inlineretval16121._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16122 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16122))._payload[__dollar - 1LU];
}
inout pure nothrow @nogc ref @safe inout(ulong) opIndex(ulong i)
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i];
}
pure nothrow @nogc @safe void opSliceAssign(ulong value)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16532 = this._refCounted;)) , __inlineretval16532._store !is null))
return ;
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16533 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16533))._payload[] = value;
}
pure nothrow @nogc @safe void opSliceAssign(ulong value, ulong i, ulong j)
{
ulong[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16534 = this._refCounted;)) , __inlineretval16534._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16535 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16535))._payload : null;
slice[i..j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin(op ~ "_data._payload[];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin(op ~ "slice[i .. j];");
}
void opSliceOpAssign(string op)(T value)
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin("_data._payload[] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(T value, size_t i, size_t j)
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin("slice[i .. j] " ~ op ~ "= value;");
}
Array opBinary(string op, Stuff)(Stuff stuff) if (op == "~")
{
Array result;
result ~= this[];
assert(result.length == length);
result ~= stuff[];
return result;
}
void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~")
{
static if (is(typeof(stuff[])))
{
insertBack(stuff[]);
}
else
{
insertBack(stuff);
}
}
nothrow @nogc @system void clear()
{
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
nothrow @nogc @property @system void length(ulong newLength)
{
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16536 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16536;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16536;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16537 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16537)).length(newLength);
}
pure @safe ulong removeAny()
{
ulong result = (ref Array!ulong this = this;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16121 = this._refCounted;)) , __inlineretval16121._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16122 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16122))._payload[__dollar - 1LU]);
this.removeBack();
return result;
}
alias stableRemoveAny = pure @safe ulong removeAny()
{
ulong result = (ref Array!ulong this = this;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16121 = this._refCounted;)) , __inlineretval16121._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16122 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16122))._payload[__dollar - 1LU]);
this.removeBack();
return result;
}
;
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
alias insert = size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
;
pure @safe void removeBack()
{
enforce(!((ref Array!ulong this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16119 = this._refCounted;)) , __inlineretval16119._store !is null) || ((const(ulong[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16120 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16120))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16538 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16538))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16539 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16539))._payload[0..__dollar - 1LU];
}
alias stableRemoveBack = void stableRemoveBack();
;
pure nothrow @nogc @safe ulong removeBack(ulong howMany)
{
if (howMany > ((ref Array!ulong this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU))
howMany = ((ref Array!ulong this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16540 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16540))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16541 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16541))._payload[0..__dollar - howMany];
return howMany;
}
alias stableRemoveBack = pure @safe void removeBack()
{
enforce(!((ref Array!ulong this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16119 = this._refCounted;)) , __inlineretval16119._store !is null) || ((const(ulong[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16120 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16120))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16538 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16538))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16539 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16539))._payload[0..__dollar - 1LU];
}
;
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
reserve(length + 1);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + 1, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
emplace(_data._payload.ptr + r._a, stuff);
_data._payload = _data._payload.ptr[0.._data._payload.length + 1];
return 1;
}
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
static if (isForwardRange!Stuff
)
{
auto extra = walkLength(stuff);
if (!extra)
return 0;
reserve(length + extra);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + extra, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
foreach (p; _data._payload.ptr + r._a .. _data._payload.ptr + r._a + extra)
{
emplace(p, stuff.front);
stuff.popFront();
}
_data._payload = _data._payload.ptr[0.._data._payload.length + extra];
return extra;
}
else
{
import std.algorithm.mutation : bringToFront;
enforce(_data);
immutable offset = r._a;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
}
size_t insertAfter(Stuff)(Range r, Stuff stuff)
{
import std.algorithm.mutation : bringToFront;
enforce(r._outer._data is _data);
immutable offset = r._b;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
enforce(r._outer._data is _data);
size_t result;
for (; !stuff.empty; stuff.popFront())
{
{
if (r.empty)
{
return result + insertBefore(r, stuff);
}
r.front = stuff.front;
r.popFront();
++result;
}
}
linearRemove(r);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
enforce(r._outer._data is _data);
if (r.empty)
{
insertBefore(r, stuff);
}
else
{
r.front = stuff;
r.popFront();
linearRemove(r);
}
return 1;
}
@system RangeT!(Array!ulong) linearRemove(RangeT!(Array!ulong) r)
{
try
{
import std.algorithm.mutation : copy;
enforce(((ref inout(Array!ulong) __inlineretval16542 = r._outer_[0];) , __inlineretval16542)._data is this._data, delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 988LU);
enforce(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16543 = this._refCounted;)) , __inlineretval16543._store !is null), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 989LU);
enforce(r._a <= r._b && r._b <= ((ref Array!ulong this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 990LU);
immutable immutable(ulong) offset1 = r._a;
immutable immutable(ulong) offset2 = r._b;
immutable immutable(ulong) tailLength = ((ref Array!ulong this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU) - offset2;
(RangeT!(Array!ulong) __tmpfordtor7845 = copy(this.opSlice(offset2, ((ref Array!ulong this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU)), this.opSlice(offset1, offset1 + tailLength));) , __tmpfordtor7845;
{
ref Array!ulong this = this;
ulong newLength = offset1 + tailLength;
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16536 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16536;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16536;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16537 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16537)).length(newLength);
}
return this.opSlice(((ref Array!ulong this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU) - tailLength, ((ref Array!ulong this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU));
}
finally
{
{
{
Array!ulong[] a = (&r._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
}
}
~this()
{
this._data.~this();
}
alias __xdtor = ~this()
{
this._data.~this();
}
;
this(this)
{
this._data.__postblit();
}
alias __xpostblit = this(this)
{
this._data.__postblit();
}
;
nothrow @nogc ref return @system Array!ulong opAssign(Array!ulong p)
{
(Array!ulong __swap4998 = void;) , __swap4998 = this , this = p;
{
__swap4998._data.~this();
}
return this;
}
}
RangeT!(Array!ulong)
struct RangeT
{
private Array!ulong[1] _outer_;
private inout pure nothrow @nogc @property ref @safe inout(Array!ulong) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = ulong;
private nothrow @nogc @system this(ref Array!ulong data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(Array!ulong) save()
{
return (RangeT!(Array!ulong) __copytmp5013 = (__copytmp5013 = this).__fieldPostblit();) , __copytmp5013;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(ulong) front()
{
assert(!((ref inout(RangeT!(Array!ulong)) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
inout ref inout(Array!ulong) __dop5014 = (ref inout(RangeT!(Array!ulong)) this = this;) , ((ref inout(Array!ulong) __inlineretval14704 = this._outer_[0];) , __inlineretval14704);
return (ulong i = this._a;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5014._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5014._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i]);
}
inout pure nothrow @nogc @property ref @safe inout(ulong) back()
{
assert(!((ref inout(RangeT!(Array!ulong)) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
inout ref inout(Array!ulong) __dop5015 = (ref inout(RangeT!(Array!ulong)) this = this;) , ((ref inout(Array!ulong) __inlineretval16544 = this._outer_[0];) , __inlineretval16544);
return (ulong i = this._b - 1LU;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5015._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5015._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i]);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(Array!ulong) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(Array!ulong) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(Array!ulong)
enum bool isMutable = true;
)
{
import std.algorithm.mutation : move;
pure nothrow @nogc @safe ulong moveFront()
{
assert(!((ref RangeT!(Array!ulong) this = this;) , this._a >= this._b) && this._a < ((ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16545 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16545._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16545._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU));
return (ref ulong source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16546 = this._outer_[0];) , __inlineretval16546))._data;) , ((ref inout(Payload) __inlineretval16547 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16547))._payload[this._a];) , ((ref ulong source = source;) , ((ref ulong source = source;) , ((ulong result = void;) , ((ref ulong source = source;) , ((ref ulong target = result;)) , target = source) , result)));
}
pure nothrow @nogc @safe ulong moveBack()
{
assert(!((ref RangeT!(Array!ulong) this = this;) , this._a >= this._b) && this._b <= ((ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16548 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16548._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16548._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU));
return (ref ulong source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16549 = this._outer_[0];) , __inlineretval16549))._data;) , ((ref inout(Payload) __inlineretval16550 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16550))._payload[this._b - 1LU];) , ((ref ulong source = source;) , ((ref ulong source = source;) , ((ulong result = void;) , ((ref ulong source = source;) , ((ref ulong target = result;)) , target = source) , result)));
}
pure nothrow @nogc @safe ulong moveAt(ulong i)
{
assert(this._a + i < this._b && this._a + i < ((ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16551 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16551._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16551._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU));
return (ref ulong source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16552 = this._outer_[0];) , __inlineretval16552))._data;) , ((ref inout(Payload) __inlineretval16553 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16553))._payload[this._a + i];) , ((ref ulong source = source;) , ((ref ulong source = source;) , ((ulong result = void;) , ((ref ulong source = source;) , ((ref ulong target = result;)) , target = source) , result)));
}
}
inout pure nothrow @nogc ref @safe inout(ulong) opIndex(ulong i)
{
assert(this._a + i < this._b);
inout ref inout(Array!ulong) __dop5017 = (ref inout(RangeT!(Array!ulong)) this = this;) , ((ref inout(Array!ulong) __inlineretval15078 = this._outer_[0];) , __inlineretval15078);
return (ulong i = this._a + i;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5017._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5017._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i]);
}
nothrow @nogc @system RangeT!(Array!ulong) opSlice()
{
return (RangeT!(Array!ulong) __slRange5018 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!ulong data = (ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16554 = this._outer_[0];) , __inlineretval16554);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5018._outer_[] = data , __slRange5018._a = a , __slRange5018._b = b , __slRange5018);
}
nothrow @nogc @system RangeT!(Array!ulong) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(Array!ulong) __slRange5019 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!ulong data = (ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16555 = this._outer_[0];) , __inlineretval16555);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5019._outer_[] = data , __slRange5019._a = a , __slRange5019._b = b , __slRange5019);
}
const nothrow @nogc @system RangeT!(const(Array!ulong)) opSlice()
{
return (RangeT!(const(Array!ulong)) __slRange5020 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!ulong) data = (ref const(RangeT!(Array!ulong)) this = this;) , ((ref inout(Array!ulong) __inlineretval16556 = this._outer_[0];) , __inlineretval16556);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5020._outer_[] = data , __slRange5020._a = a , __slRange5020._b = b , __slRange5020);
}
const nothrow @nogc @system RangeT!(const(Array!ulong)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!ulong)) __slRange5021 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!ulong) data = (ref const(RangeT!(Array!ulong)) this = this;) , ((ref inout(Array!ulong) __inlineretval16557 = this._outer_[0];) , __inlineretval16557);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5021._outer_[] = data , __slRange5021._a = a , __slRange5021._b = b , __slRange5021);
}
static if (isMutable!(Array!ulong)
)
{
pure nothrow @nogc @safe void opSliceAssign(ulong value)
{
assert(this._b <= ((ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16558 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16558._data;) , ((ref inout(RefCountedStore) __inlineretval15503 = this._refCounted;)) , __inlineretval15503._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16558._data;) , ((ref inout(Payload) __inlineretval15504 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval15504))._payload.length : 0LU));
{
(ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16559 = this._outer_[0];));
(ulong value = value;) , ((ulong i = this._a;)) , ((ulong j = this._b;));
ulong[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16559._data;) , ((ref inout(RefCountedStore) __inlineretval16534 = this._refCounted;)) , __inlineretval16534._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16559._data;) , ((ref inout(Payload) __inlineretval16535 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16535))._payload : null;
slice[i..j] = value;
}
}
pure nothrow @nogc @safe void opSliceAssign(ulong value, ulong i, ulong j)
{
assert(this._a + j <= this._b);
{
(ref RangeT!(Array!ulong) this = this;) , ((ref inout(Array!ulong) __inlineretval16560 = this._outer_[0];));
(ulong value = value;) , ((ulong i = this._a + i;)) , ((ulong j = this._a + j;));
ulong[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16560._data;) , ((ref inout(RefCountedStore) __inlineretval16534 = this._refCounted;)) , __inlineretval16534._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16560._data;) , ((ref inout(Payload) __inlineretval16535 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16535))._payload : null;
slice[i..j] = value;
}
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!ulong[] a = (&this._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!ulong[] a = (&this._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!ulong[] a = (&this._outer_)[0..1];
{
Array!ulong[] __r5001 = a[];
ulong __key5002 = 0LU;
for (; __key5002 < __r5001.length; __key5002 += 1LU)
{
ref Array!ulong e = __r5001[__key5002];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!ulong[] a = (&this._outer_)[0..1];
{
Array!ulong[] __r5001 = a[];
ulong __key5002 = 0LU;
for (; __key5002 < __r5001.length; __key5002 += 1LU)
{
ref Array!ulong e = __r5001[__key5002];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(Array!ulong) opAssign(RangeT!(Array!ulong) p)
{
(RangeT!(Array!ulong) __swap5012 = void;) , __swap5012 = this , this = p;
{
{
Array!ulong[] a = (&__swap5012._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(const(Array!ulong))
struct RangeT
{
private const const(Array!ulong[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe inout(const(Array!ulong)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = const(ulong);
private nothrow @nogc @system this(ref const(Array!ulong) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(const(Array!ulong)) save()
{
return (RangeT!(const(Array!ulong)) __copytmp5000 = (__copytmp5000 = this).__fieldPostblit();) , __copytmp5000;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(const(ulong)) front()
{
assert(!((ref inout(RangeT!(const(Array!ulong))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
const ref inout(const(Array!ulong)) __dop5005 = (ref inout(RangeT!(const(Array!ulong))) this = this;) , ((ref inout(const(Array!ulong)) __inlineretval16561 = this._outer_[0];) , __inlineretval16561);
return (ulong i = this._a;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5005._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5005._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i]);
}
inout pure nothrow @nogc @property ref @safe inout(const(ulong)) back()
{
assert(!((ref inout(RangeT!(const(Array!ulong))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
const ref inout(const(Array!ulong)) __dop5006 = (ref inout(RangeT!(const(Array!ulong))) this = this;) , ((ref inout(const(Array!ulong)) __inlineretval16562 = this._outer_[0];) , __inlineretval16562);
return (ulong i = this._b - 1LU;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5006._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5006._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i]);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(const(Array!ulong)) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(const(Array!ulong)) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(const(Array!ulong))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe inout(const(ulong)) opIndex(ulong i)
{
assert(this._a + i < this._b);
const ref inout(const(Array!ulong)) __dop5007 = (ref inout(RangeT!(const(Array!ulong))) this = this;) , ((ref inout(const(Array!ulong)) __inlineretval16563 = this._outer_[0];) , __inlineretval16563);
return (ulong i = this._a + i;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5007._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5007._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i]);
}
nothrow @nogc @system RangeT!(const(Array!ulong)) opSlice()
{
return (RangeT!(const(Array!ulong)) __slRange5008 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!ulong) data = (ref RangeT!(const(Array!ulong)) this = this;) , ((ref inout(const(Array!ulong)) __inlineretval16564 = this._outer_[0];) , __inlineretval16564);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5008._outer_[] = data , __slRange5008._a = a , __slRange5008._b = b , __slRange5008);
}
nothrow @nogc @system RangeT!(const(Array!ulong)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!ulong)) __slRange5009 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!ulong) data = (ref RangeT!(const(Array!ulong)) this = this;) , ((ref inout(const(Array!ulong)) __inlineretval16565 = this._outer_[0];) , __inlineretval16565);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5009._outer_[] = data , __slRange5009._a = a , __slRange5009._b = b , __slRange5009);
}
const nothrow @nogc @system RangeT!(const(Array!ulong)) opSlice()
{
return (RangeT!(const(Array!ulong)) __slRange5010 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!ulong) data = (ref const(RangeT!(const(Array!ulong))) this = this;) , ((ref inout(const(Array!ulong)) __inlineretval16566 = this._outer_[0];) , __inlineretval16566);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5010._outer_[] = data , __slRange5010._a = a , __slRange5010._b = b , __slRange5010);
}
const nothrow @nogc @system RangeT!(const(Array!ulong)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!ulong)) __slRange5011 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!ulong) data = (ref const(RangeT!(const(Array!ulong))) this = this;) , ((ref inout(const(Array!ulong)) __inlineretval16567 = this._outer_[0];) , __inlineretval16567);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5011._outer_[] = data , __slRange5011._a = a , __slRange5011._b = b , __slRange5011);
}
static if (isMutable!(const(Array!ulong))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!ulong[] a = (&this._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!ulong[] a = (&this._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!ulong[] a = (&this._outer_)[0..1];
{
Array!ulong[] __r5001 = a[];
ulong __key5002 = 0LU;
for (; __key5002 < __r5001.length; __key5002 += 1LU)
{
ref Array!ulong e = __r5001[__key5002];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!ulong[] a = (&this._outer_)[0..1];
{
Array!ulong[] __r5001 = a[];
ulong __key5002 = 0LU;
for (; __key5002 < __r5001.length; __key5002 += 1LU)
{
ref Array!ulong e = __r5001[__key5002];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(const(Array!ulong)) opAssign(RangeT!(const(Array!ulong)) p)
{
(RangeT!(const(Array!ulong)) __swap4999 = void;) , __swap4999 = this , this = p;
{
{
Array!ulong[] a = (&__swap4999._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(immutable(Array!ulong))
struct RangeT
{
private immutable immutable(Array!ulong[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe immutable(Array!ulong) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = immutable(ulong);
private nothrow @nogc @system this(ref immutable(Array!ulong) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(immutable(Array!ulong)) save()
{
return (RangeT!(immutable(Array!ulong)) __copytmp5023 = (__copytmp5023 = this).__fieldPostblit();) , __copytmp5023;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe immutable(ulong) front()
{
assert(!((ref inout(RangeT!(immutable(Array!ulong))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
immutable ref immutable(Array!ulong) __dop5024 = (ref inout(RangeT!(immutable(Array!ulong))) this = this;) , ((ref immutable(Array!ulong) __inlineretval16568 = this._outer_[0];) , __inlineretval16568);
return (ulong i = this._a;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5024._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5024._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i]);
}
inout pure nothrow @nogc @property ref @safe immutable(ulong) back()
{
assert(!((ref inout(RangeT!(immutable(Array!ulong))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
immutable ref immutable(Array!ulong) __dop5025 = (ref inout(RangeT!(immutable(Array!ulong))) this = this;) , ((ref immutable(Array!ulong) __inlineretval16569 = this._outer_[0];) , __inlineretval16569);
return (ulong i = this._b - 1LU;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5025._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5025._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i]);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(immutable(Array!ulong)) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(immutable(Array!ulong)) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(immutable(Array!ulong))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe immutable(ulong) opIndex(ulong i)
{
assert(this._a + i < this._b);
immutable ref immutable(Array!ulong) __dop5026 = (ref inout(RangeT!(immutable(Array!ulong))) this = this;) , ((ref immutable(Array!ulong) __inlineretval16570 = this._outer_[0];) , __inlineretval16570);
return (ulong i = this._a + i;) , (assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5026._data;) , ((ref inout(RefCountedStore) __inlineretval14705 = this._refCounted;)) , __inlineretval14705._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5026._data;) , ((ref inout(Payload) __inlineretval14706 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14706))._payload[i]);
}
nothrow @nogc @system RangeT!(immutable(Array!ulong)) opSlice()
{
return (RangeT!(immutable(Array!ulong)) __slRange5027 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!ulong) data = (ref RangeT!(immutable(Array!ulong)) this = this;) , ((ref immutable(Array!ulong) __inlineretval16571 = this._outer_[0];) , __inlineretval16571);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5027._outer_[] = data , __slRange5027._a = a , __slRange5027._b = b , __slRange5027);
}
nothrow @nogc @system RangeT!(immutable(Array!ulong)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!ulong)) __slRange5028 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!ulong) data = (ref RangeT!(immutable(Array!ulong)) this = this;) , ((ref immutable(Array!ulong) __inlineretval16572 = this._outer_[0];) , __inlineretval16572);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5028._outer_[] = data , __slRange5028._a = a , __slRange5028._b = b , __slRange5028);
}
const nothrow @nogc @system RangeT!(immutable(Array!ulong)) opSlice()
{
return (RangeT!(immutable(Array!ulong)) __slRange5029 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!ulong) data = (ref const(RangeT!(immutable(Array!ulong))) this = this;) , ((ref immutable(Array!ulong) __inlineretval16573 = this._outer_[0];) , __inlineretval16573);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5029._outer_[] = data , __slRange5029._a = a , __slRange5029._b = b , __slRange5029);
}
const nothrow @nogc @system RangeT!(immutable(Array!ulong)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!ulong)) __slRange5030 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!ulong) data = (ref const(RangeT!(immutable(Array!ulong))) this = this;) , ((ref immutable(Array!ulong) __inlineretval16574 = this._outer_[0];) , __inlineretval16574);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5030._outer_[] = data , __slRange5030._a = a , __slRange5030._b = b , __slRange5030);
}
static if (isMutable!(immutable(Array!ulong))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!ulong[] a = (cast(Array!ulong*)&this._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!ulong[] a = (cast(Array!ulong*)&this._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!ulong[] a = (cast(Array!ulong*)&this._outer_)[0..1];
{
Array!ulong[] __r5001 = a[];
ulong __key5002 = 0LU;
for (; __key5002 < __r5001.length; __key5002 += 1LU)
{
ref Array!ulong e = __r5001[__key5002];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!ulong[] a = (cast(Array!ulong*)&this._outer_)[0..1];
{
Array!ulong[] __r5001 = a[];
ulong __key5002 = 0LU;
for (; __key5002 < __r5001.length; __key5002 += 1LU)
{
ref Array!ulong e = __r5001[__key5002];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(immutable(Array!ulong)) opAssign(RangeT!(immutable(Array!ulong)) p)
{
(RangeT!(immutable(Array!ulong)) __swap5022 = void;) , __swap5022 = this , this = p;
{
{
Array!ulong[] a = (cast(Array!ulong*)&__swap5022._outer_)[0..1];
{
Array!ulong[] __r5003 = a[];
ulong __key5004 = __r5003.length;
for (; __key5004--;)
{
ref Array!ulong e = __r5003[__key5004];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
static __gshared TypeInfo_Const _D51TypeInfo_xS3std9container5array12__T5ArrayTmZ5Array6__initZ;
static __gshared TypeInfo_Const _D53TypeInfo_xG1S3std9container5array12__T5ArrayTmZ5Array6__initZ;
static __gshared TypeInfo_Struct _D50TypeInfo_S3std9container5array12__T5ArrayTmZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D51TypeInfo_yS3std9container5array12__T5ArrayTmZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D53TypeInfo_yG1S3std9container5array12__T5ArrayTmZ5Array6__initZ;
Array!(Waiter)
struct Array
{
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memmove, memset;
import core.memory : GC;
import std.exception : enforce;
import std.typecons : RefCounted, RefCountedAutoInitialize;
private struct Payload
{
ulong _capacity;
Waiter[] _payload;
pure nothrow @nogc @safe this(Waiter[] p)
{
this._capacity = p.length;
this._payload = p;
return this;
}
~this()
{
{
const(void*) p = cast(const(void*))cast(Waiter*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Waiter*)this._payload);
}
this(this)
{
halt;
}
nothrow @nogc @system void opAssign(Payload rhs)
{
try
{
halt;
}
finally
{
{
{
const(void*) p = cast(const(void*))cast(Waiter*)rhs._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Waiter*)rhs._payload);
}
}
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._payload.length;
}
nothrow @nogc @property @system void length(ulong newLength)
{
import std.algorithm.mutation : initializeAll;
if (((ref Payload this = this;) , this._payload.length) >= newLength)
{
this._payload = (cast(Waiter*)this._payload)[0..newLength];
return ;
}
immutable immutable(ulong) startEmplace = (ref Payload this = this;) , this._payload.length;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) nbytes = (ulong x = newLength;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
this._payload = (cast(Waiter*)realloc(cast(void*)cast(Waiter*)this._payload, nbytes))[0..newLength];
{
Waiter[] range = (cast(Waiter*)this._payload)[startEmplace..newLength];
alias T = Waiter;
{
(ref Waiter[] range = range;) , ((Waiter value = Waiter(null, cast(ubyte)0u, 0u);));
alias T = Waiter;
range[] = value;
}
}
this._capacity = newLength;
}
const pure nothrow @nogc @property @safe ulong capacity()
{
return this._capacity;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (elements <= ((ref Payload this = this;) , this._capacity))
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
immutable immutable(ulong) oldLength = (ref Payload this = this;) , this._payload.length;
Waiter* newPayloadPtr = cast(Waiter*)malloc(sz);
newPayloadPtr || halt;
Waiter[] newPayload = newPayloadPtr[0..oldLength];
memcpy(cast(void*)cast(Waiter*)newPayload, cast(const(void*))cast(Waiter*)this._payload, 16LU * oldLength);
memset(cast(void*)(cast(Waiter*)newPayload + cast(long)oldLength * 16L), 0, (elements - oldLength) * 16LU);
{
(const(void*) p = cast(const(void*))cast(Waiter*)newPayload;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
const(void*) p = cast(const(void*))cast(Waiter*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Waiter*)this._payload);
this._payload = newPayload;
this._capacity = elements;
}
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
if (_capacity == length)
{
reserve(1 + capacity * 3 / 2);
}
assert(capacity > length && _payload.ptr);
emplace(_payload.ptr + _payload.length, stuff);
_payload = _payload.ptr[0.._payload.length + 1];
return 1;
}
size_t insertBack(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
static if (hasLength!Stuff
)
{
immutable oldLength = length;
reserve(oldLength + stuff.length);
}
size_t result;
foreach (item; stuff)
{
insertBack(item);
++result;
}
static if (hasLength!Stuff
)
{
assert(length == oldLength + stuff.length);
}
return result;
}
alias __xdtor = ~this()
{
{
const(void*) p = cast(const(void*))cast(Waiter*)this._payload;
gc_removeRange(p);
}
free(cast(void*)cast(Waiter*)this._payload);
}
;
alias __xpostblit = this(this)
{
halt;
}
;
}
private alias Data = RefCounted!(Payload, cast(RefCountedAutoInitialize)0);
private RefCounted!(Payload, cast(RefCountedAutoInitialize)0) _data;
this(U)(U[] values...) if (isImplicitlyConvertible!(U, T)
)
{
import std.conv : emplace;
import core.checkedint : mulu;
bool overflow;
const nbytes = mulu(values.length, T.sizeof, overflow);
if (overflow)
assert(0);
auto p = cast(T*)malloc(nbytes);
static if (hasIndirections!T
)
{
if (p)
GC.addRange(p, T.sizeof * values.length);
}
foreach (i, e; values)
{
emplace(p + i, e);
}
_data = Data(p[0..values.length]);
}
this(Stuff)(Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
&& !is(Stuff == T[]))
{
insertBack(stuff);
}
const nothrow @nogc @system bool opEquals(const(Array!(Waiter)) rhs)
{
try
{
return this.opEquals(rhs);
}
finally
{
{
rhs._data.~this();
}
}
}
const pure nothrow @nogc @safe bool opEquals(ref const(Array!(Waiter)) rhs)
{
if ((ref const(Array!(Waiter)) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16575 = this._refCounted;)) , __inlineretval16575._store !is null) || ((const(Waiter[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16576 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16576))._payload;) , !a.length))
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16575 = this._refCounted;)) , __inlineretval16575._store !is null) || ((const(Waiter[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16576 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16576))._payload;) , !a.length);
if (!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(RefCountedStore) __inlineretval16575 = this._refCounted;)) , __inlineretval16575._store !is null) || ((const(Waiter[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16576 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16576))._payload;) , !a.length))
return false;
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16577 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16577))._payload == ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = rhs._data;) , ((ref inout(Payload) __inlineretval16578 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16578))._payload;
}
alias Range = RangeT!(Array!(Waiter));
alias ConstRange = RangeT!(const(Array!(Waiter)));
alias ImmutableRange = RangeT!(immutable(Array!(Waiter)));
nothrow @nogc @property @system Array!(Waiter) dup()
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16579 = this._refCounted;)) , __inlineretval16579._store !is null))
return (Array!(Waiter) __copytmp5083 = (ref Array!(Waiter) this = __copytmp5083 = this;) , this._data.__postblit();) , __copytmp5083;
return ((Array!(Waiter) __slArray5082 = Array(RefCounted(RefCountedStore(null)));) , __slArray5082).this(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16580 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16580))._payload);
}
const pure nothrow @nogc @property @safe bool empty()
{
return !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16575 = this._refCounted;)) , __inlineretval16575._store !is null) || ((const(Waiter[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16576 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16576))._payload;) , !a.length);
}
const pure nothrow @nogc @property @safe ulong length()
{
return ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU;
}
const pure nothrow @nogc @safe ulong opDollar()
{
return (ref const(Array!(Waiter)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU;
}
pure nothrow @nogc @property @safe ulong capacity()
{
return ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16583 = this._refCounted;)) , __inlineretval16583._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16584 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16584))._capacity : 0LU;
}
nothrow @nogc @system void reserve(ulong elements)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16585 = this._refCounted;)) , __inlineretval16585._store !is null))
{
if (!elements)
return ;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) sz = (ulong x = elements;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
void* p = malloc(sz);
p || halt;
{
(const(void*) p = p;) , ((ulong sz = sz;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = ((RefCounted!(Payload, cast(RefCountedAutoInitialize)0) __slRefCo7846 = RefCounted(RefCountedStore(null));) , __slRefCo7846).this(cast(Waiter[])p[0..0]);
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16586 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16586))._capacity = elements;
}
else
{
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16587 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16587)).reserve(elements);
}
}
nothrow @nogc @system RangeT!(Array!(Waiter)) opSlice()
{
return (RangeT!(Array!(Waiter)) __slRange5071 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Waiter) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref Array!(Waiter) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU;))) , (__slRange5071._outer_[] = data , __slRange5071._a = a , __slRange5071._b = b , __slRange5071);
}
const nothrow @nogc @system RangeT!(const(Array!(Waiter))) opSlice()
{
return (RangeT!(const(Array!(Waiter))) __slRange7847 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Waiter)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref const(Array!(Waiter)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU;))) , (__slRange7847._outer_[] = data , __slRange7847._a = a , __slRange7847._b = b , __slRange7847);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(Waiter))) opSlice()
{
return (RangeT!(immutable(Array!(Waiter))) __slRange7848 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Waiter)) data = this;) , ((ulong a = 0LU;)) , ((ulong b = (ref immutable(Array!(Waiter)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU;))) , (__slRange7848._outer_[] = data , __slRange7848._a = a , __slRange7848._b = b , __slRange7848);
}
nothrow @nogc @system RangeT!(Array!(Waiter)) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref Array!(Waiter) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU));
return (RangeT!(Array!(Waiter)) __slRange7849 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Waiter) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7849._outer_[] = data , __slRange7849._a = a , __slRange7849._b = b , __slRange7849);
}
const nothrow @nogc @system RangeT!(const(Array!(Waiter))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref const(Array!(Waiter)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU));
return (RangeT!(const(Array!(Waiter))) __slRange7850 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Waiter)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7850._outer_[] = data , __slRange7850._a = a , __slRange7850._b = b , __slRange7850);
}
immutable nothrow @nogc @system RangeT!(immutable(Array!(Waiter))) opSlice(ulong i, ulong j)
{
assert(i <= j && j <= ((ref immutable(Array!(Waiter)) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU));
return (RangeT!(immutable(Array!(Waiter))) __slRange7851 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Waiter)) data = this;) , ((ulong a = i;)) , ((ulong b = j;))) , (__slRange7851._outer_[] = data , __slRange7851._a = a , __slRange7851._b = b , __slRange7851);
}
inout pure nothrow @nogc @property ref @safe inout(Waiter) front()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];
}
inout pure nothrow @nogc @property ref @safe inout(Waiter) back()
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16590 = this._refCounted;)) , __inlineretval16590._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16591 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16591))._payload[__dollar - 1LU];
}
inout pure nothrow @nogc ref @safe inout(Waiter) opIndex(ulong i)
{
assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null));
return ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];
}
pure nothrow @nogc @safe void opSliceAssign(Waiter value)
{
if (!((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16592 = this._refCounted;)) , __inlineretval16592._store !is null))
return ;
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16593 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16593))._payload[] = value;
}
pure nothrow @nogc @safe void opSliceAssign(Waiter value, ulong i, ulong j)
{
Waiter[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16594 = this._refCounted;)) , __inlineretval16594._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16595 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16595))._payload : null;
slice[i..j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin(op ~ "_data._payload[];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin(op ~ "slice[i .. j];");
}
void opSliceOpAssign(string op)(T value)
{
if (!_data.refCountedStore.isInitialized)
return ;
mixin("_data._payload[] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(T value, size_t i, size_t j)
{
auto slice = _data.refCountedStore.isInitialized ? _data._payload : T[].init;
mixin("slice[i .. j] " ~ op ~ "= value;");
}
Array opBinary(string op, Stuff)(Stuff stuff) if (op == "~")
{
Array result;
result ~= this[];
assert(result.length == length);
result ~= stuff[];
return result;
}
void opOpAssign(string op, Stuff)(Stuff stuff) if (op == "~")
{
static if (is(typeof(stuff[])))
{
insertBack(stuff[]);
}
else
{
insertBack(stuff);
}
}
nothrow @nogc @system void clear()
{
{
ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;
RefCounted!(Payload, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
nothrow @nogc @property @system void length(ulong newLength)
{
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16596 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16596;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16596;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16597 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16597)).length(newLength);
}
pure @safe Waiter removeAny()
{
Waiter result = (ref Array!(Waiter) this = this;) , ((ref inout(Waiter) __inlineretval16598 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16590 = this._refCounted;)) , __inlineretval16590._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16591 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16591))._payload[__dollar - 1LU];) , __inlineretval16598);
this.removeBack();
return result;
}
alias stableRemoveAny = pure @safe Waiter removeAny()
{
Waiter result = (ref Array!(Waiter) this = this;) , ((ref inout(Waiter) __inlineretval16598 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16590 = this._refCounted;)) , __inlineretval16590._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16591 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16591))._payload[__dollar - 1LU];) , __inlineretval16598);
this.removeBack();
return result;
}
;
size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
alias insert = size_t insertBack(Stuff)(Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
|| isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
_data.refCountedStore.ensureInitialized();
return _data.insertBack(stuff);
}
;
pure @safe void removeBack()
{
enforce(!((ref Array!(Waiter) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16575 = this._refCounted;)) , __inlineretval16575._store !is null) || ((const(Waiter[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16576 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16576))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16599 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16599))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16600 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16600))._payload[0..__dollar - 1LU];
}
alias stableRemoveBack = void stableRemoveBack();
;
pure nothrow @nogc @safe ulong removeBack(ulong howMany)
{
if (howMany > ((ref Array!(Waiter) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU))
howMany = ((ref Array!(Waiter) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16601 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16601))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16602 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16602))._payload[0..__dollar - howMany];
return howMany;
}
alias stableRemoveBack = pure @safe void removeBack()
{
enforce(!((ref Array!(Waiter) this = this;) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16575 = this._refCounted;)) , __inlineretval16575._store !is null) || ((const(Waiter[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16576 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16576))._payload;) , !a.length)), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 816LU);
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16599 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16599))._payload = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16600 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16600))._payload[0..__dollar - 1LU];
}
;
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
reserve(length + 1);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + 1, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
emplace(_data._payload.ptr + r._a, stuff);
_data._payload = _data._payload.ptr[0.._data._payload.length + 1];
return 1;
}
size_t insertBefore(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
import std.conv : emplace;
enforce(r._outer._data is _data && r._a <= length);
static if (isForwardRange!Stuff
)
{
auto extra = walkLength(stuff);
if (!extra)
return 0;
reserve(length + extra);
assert(_data.refCountedStore.isInitialized);
memmove(_data._payload.ptr + r._a + extra, _data._payload.ptr + r._a, T.sizeof * (length - r._a));
foreach (p; _data._payload.ptr + r._a .. _data._payload.ptr + r._a + extra)
{
emplace(p, stuff.front);
stuff.popFront();
}
_data._payload = _data._payload.ptr[0.._data._payload.length + extra];
return extra;
}
else
{
import std.algorithm.mutation : bringToFront;
enforce(_data);
immutable offset = r._a;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
}
size_t insertAfter(Stuff)(Range r, Stuff stuff)
{
import std.algorithm.mutation : bringToFront;
enforce(r._outer._data is _data);
immutable offset = r._b;
enforce(offset <= length);
auto result = insertBack(stuff);
bringToFront(this[offset..length - result], this[length - result..length]);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isInputRange!Stuff
&& isImplicitlyConvertible!(ElementType!Stuff
, T)
)
{
enforce(r._outer._data is _data);
size_t result;
for (; !stuff.empty; stuff.popFront())
{
{
if (r.empty)
{
return result + insertBefore(r, stuff);
}
r.front = stuff.front;
r.popFront();
++result;
}
}
linearRemove(r);
return result;
}
size_t replace(Stuff)(Range r, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T)
)
{
enforce(r._outer._data is _data);
if (r.empty)
{
insertBefore(r, stuff);
}
else
{
r.front = stuff;
r.popFront();
linearRemove(r);
}
return 1;
}
@system RangeT!(Array!(Waiter)) linearRemove(RangeT!(Array!(Waiter)) r)
{
try
{
import std.algorithm.mutation : copy;
enforce(((ref inout(Array!(Waiter)) __inlineretval16603 = r._outer_[0];) , __inlineretval16603)._data is this._data, delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 988LU);
enforce(((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16604 = this._refCounted;)) , __inlineretval16604._store !is null), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 989LU);
enforce(r._a <= r._b && r._b <= ((ref Array!(Waiter) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU), delegate const(char)[]() => null, "/usr/include/dmd/phobos/std/container/array.d", 990LU);
immutable immutable(ulong) offset1 = r._a;
immutable immutable(ulong) offset2 = r._b;
immutable immutable(ulong) tailLength = ((ref Array!(Waiter) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU) - offset2;
(RangeT!(Array!(Waiter)) __tmpfordtor7855 = copy(this.opSlice(offset2, ((ref Array!(Waiter) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU)), this.opSlice(offset1, offset1 + tailLength));) , __tmpfordtor7855;
{
ref Array!(Waiter) this = this;
ulong newLength = offset1 + tailLength;
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16596 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16596;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16596;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16597 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16597)).length(newLength);
}
return this.opSlice(((ref Array!(Waiter) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU) - tailLength, ((ref Array!(Waiter) this = this;) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = this._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU));
}
finally
{
{
{
Array!(Waiter)[] a = (&r._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
}
}
~this()
{
this._data.~this();
}
alias __xdtor = ~this()
{
this._data.~this();
}
;
this(this)
{
this._data.__postblit();
}
alias __xpostblit = this(this)
{
this._data.__postblit();
}
;
nothrow @nogc ref return @system Array!(Waiter) opAssign(Array!(Waiter) p)
{
(Array!(Waiter) __swap5037 = void;) , __swap5037 = this , this = p;
{
__swap5037._data.~this();
}
return this;
}
}
RangeT!(Array!(Waiter))
struct RangeT
{
private Array!(Waiter)[1] _outer_;
private inout pure nothrow @nogc @property ref @safe inout(Array!(Waiter)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = Waiter;
private nothrow @nogc @system this(ref Array!(Waiter) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(Array!(Waiter)) save()
{
return (RangeT!(Array!(Waiter)) __copytmp5052 = (__copytmp5052 = this).__fieldPostblit();) , __copytmp5052;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(Waiter) front()
{
assert(!((ref inout(RangeT!(Array!(Waiter))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
inout ref inout(Array!(Waiter)) __dop5053 = (ref inout(RangeT!(Array!(Waiter))) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval14707 = this._outer_[0];) , __inlineretval14707);
return (ulong i = this._a;) , ((ref inout(Waiter) __inlineretval14710 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5053._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5053._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval14710);
}
inout pure nothrow @nogc @property ref @safe inout(Waiter) back()
{
assert(!((ref inout(RangeT!(Array!(Waiter))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
inout ref inout(Array!(Waiter)) __dop5054 = (ref inout(RangeT!(Array!(Waiter))) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16605 = this._outer_[0];) , __inlineretval16605);
return (ulong i = this._b - 1LU;) , ((ref inout(Waiter) __inlineretval16606 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5054._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5054._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16606);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(Array!(Waiter)) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(Array!(Waiter)) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(Array!(Waiter))
enum bool isMutable = true;
)
{
import std.algorithm.mutation : move;
pure nothrow @nogc @safe Waiter moveFront()
{
assert(!((ref RangeT!(Array!(Waiter)) this = this;) , this._a >= this._b) && this._a < ((ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16607 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16607._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16607._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU));
return (ref Waiter source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16608 = this._outer_[0];) , __inlineretval16608))._data;) , ((ref inout(Payload) __inlineretval16609 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16609))._payload[this._a];) , ((Waiter __inlineretval16610 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16610);
}
pure nothrow @nogc @safe Waiter moveBack()
{
assert(!((ref RangeT!(Array!(Waiter)) this = this;) , this._a >= this._b) && this._b <= ((ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16611 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16611._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16611._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU));
return (ref Waiter source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16612 = this._outer_[0];) , __inlineretval16612))._data;) , ((ref inout(Payload) __inlineretval16613 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16613))._payload[this._b - 1LU];) , ((Waiter __inlineretval16614 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16614);
}
pure nothrow @nogc @safe Waiter moveAt(ulong i)
{
assert(this._a + i < this._b && this._a + i < ((ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16615 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16615._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16615._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU));
return (ref Waiter source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16616 = this._outer_[0];) , __inlineretval16616))._data;) , ((ref inout(Payload) __inlineretval16617 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16617))._payload[this._a + i];) , ((Waiter __inlineretval16618 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16618);
}
}
inout pure nothrow @nogc ref @safe inout(Waiter) opIndex(ulong i)
{
assert(this._a + i < this._b);
inout ref inout(Array!(Waiter)) __dop5057 = (ref inout(RangeT!(Array!(Waiter))) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval15079 = this._outer_[0];) , __inlineretval15079);
return (ulong i = this._a + i;) , ((ref inout(Waiter) __inlineretval15080 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5057._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5057._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval15080);
}
nothrow @nogc @system RangeT!(Array!(Waiter)) opSlice()
{
return (RangeT!(Array!(Waiter)) __slRange5058 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Waiter) data = (ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16619 = this._outer_[0];) , __inlineretval16619);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5058._outer_[] = data , __slRange5058._a = a , __slRange5058._b = b , __slRange5058);
}
nothrow @nogc @system RangeT!(Array!(Waiter)) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(Array!(Waiter)) __slRange5059 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref Array!(Waiter) data = (ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16620 = this._outer_[0];) , __inlineretval16620);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5059._outer_[] = data , __slRange5059._a = a , __slRange5059._b = b , __slRange5059);
}
const nothrow @nogc @system RangeT!(const(Array!(Waiter))) opSlice()
{
return (RangeT!(const(Array!(Waiter))) __slRange5060 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Waiter)) data = (ref const(RangeT!(Array!(Waiter))) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16621 = this._outer_[0];) , __inlineretval16621);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5060._outer_[] = data , __slRange5060._a = a , __slRange5060._b = b , __slRange5060);
}
const nothrow @nogc @system RangeT!(const(Array!(Waiter))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(Waiter))) __slRange5061 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Waiter)) data = (ref const(RangeT!(Array!(Waiter))) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16622 = this._outer_[0];) , __inlineretval16622);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5061._outer_[] = data , __slRange5061._a = a , __slRange5061._b = b , __slRange5061);
}
static if (isMutable!(Array!(Waiter))
)
{
pure nothrow @nogc @safe void opSliceAssign(Waiter value)
{
assert(this._b <= ((ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16623 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16623._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16623._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU));
{
(ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16624 = this._outer_[0];));
(Waiter value = value;) , ((ulong i = this._a;)) , ((ulong j = this._b;));
Waiter[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16624._data;) , ((ref inout(RefCountedStore) __inlineretval16594 = this._refCounted;)) , __inlineretval16594._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16624._data;) , ((ref inout(Payload) __inlineretval16595 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16595))._payload : null;
slice[i..j] = value;
}
}
pure nothrow @nogc @safe void opSliceAssign(Waiter value, ulong i, ulong j)
{
assert(this._a + j <= this._b);
{
(ref RangeT!(Array!(Waiter)) this = this;) , ((ref inout(Array!(Waiter)) __inlineretval16625 = this._outer_[0];));
(Waiter value = value;) , ((ulong i = this._a + i;)) , ((ulong j = this._a + j;));
Waiter[] slice = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16625._data;) , ((ref inout(RefCountedStore) __inlineretval16594 = this._refCounted;)) , __inlineretval16594._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16625._data;) , ((ref inout(Payload) __inlineretval16595 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16595))._payload : null;
slice[i..j] = value;
}
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(Waiter)[] a = (&this._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(Waiter)[] a = (&this._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(Waiter)[] a = (&this._outer_)[0..1];
{
Array!(Waiter)[] __r5040 = a[];
ulong __key5041 = 0LU;
for (; __key5041 < __r5040.length; __key5041 += 1LU)
{
ref Array!(Waiter) e = __r5040[__key5041];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(Waiter)[] a = (&this._outer_)[0..1];
{
Array!(Waiter)[] __r5040 = a[];
ulong __key5041 = 0LU;
for (; __key5041 < __r5040.length; __key5041 += 1LU)
{
ref Array!(Waiter) e = __r5040[__key5041];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(Array!(Waiter)) opAssign(RangeT!(Array!(Waiter)) p)
{
(RangeT!(Array!(Waiter)) __swap5051 = void;) , __swap5051 = this , this = p;
{
{
Array!(Waiter)[] a = (&__swap5051._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(const(Array!(Waiter)))
struct RangeT
{
private const const(Array!(Waiter)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe inout(const(Array!(Waiter))) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = const(Waiter);
private nothrow @nogc @system this(ref const(Array!(Waiter)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(const(Array!(Waiter))) save()
{
return (RangeT!(const(Array!(Waiter))) __copytmp5039 = (__copytmp5039 = this).__fieldPostblit();) , __copytmp5039;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe inout(const(Waiter)) front()
{
assert(!((ref inout(RangeT!(const(Array!(Waiter)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
const ref inout(const(Array!(Waiter))) __dop5044 = (ref inout(RangeT!(const(Array!(Waiter)))) this = this;) , ((ref inout(const(Array!(Waiter))) __inlineretval16626 = this._outer_[0];) , __inlineretval16626);
return (ulong i = this._a;) , ((ref inout(Waiter) __inlineretval16627 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5044._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5044._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16627);
}
inout pure nothrow @nogc @property ref @safe inout(const(Waiter)) back()
{
assert(!((ref inout(RangeT!(const(Array!(Waiter)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
const ref inout(const(Array!(Waiter))) __dop5045 = (ref inout(RangeT!(const(Array!(Waiter)))) this = this;) , ((ref inout(const(Array!(Waiter))) __inlineretval16628 = this._outer_[0];) , __inlineretval16628);
return (ulong i = this._b - 1LU;) , ((ref inout(Waiter) __inlineretval16629 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5045._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5045._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16629);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(const(Array!(Waiter))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(const(Array!(Waiter))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(const(Array!(Waiter)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe inout(const(Waiter)) opIndex(ulong i)
{
assert(this._a + i < this._b);
const ref inout(const(Array!(Waiter))) __dop5046 = (ref inout(RangeT!(const(Array!(Waiter)))) this = this;) , ((ref inout(const(Array!(Waiter))) __inlineretval16630 = this._outer_[0];) , __inlineretval16630);
return (ulong i = this._a + i;) , ((ref inout(Waiter) __inlineretval16631 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5046._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5046._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16631);
}
nothrow @nogc @system RangeT!(const(Array!(Waiter))) opSlice()
{
return (RangeT!(const(Array!(Waiter))) __slRange5047 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Waiter)) data = (ref RangeT!(const(Array!(Waiter))) this = this;) , ((ref inout(const(Array!(Waiter))) __inlineretval16632 = this._outer_[0];) , __inlineretval16632);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5047._outer_[] = data , __slRange5047._a = a , __slRange5047._b = b , __slRange5047);
}
nothrow @nogc @system RangeT!(const(Array!(Waiter))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(Waiter))) __slRange5048 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Waiter)) data = (ref RangeT!(const(Array!(Waiter))) this = this;) , ((ref inout(const(Array!(Waiter))) __inlineretval16633 = this._outer_[0];) , __inlineretval16633);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5048._outer_[] = data , __slRange5048._a = a , __slRange5048._b = b , __slRange5048);
}
const nothrow @nogc @system RangeT!(const(Array!(Waiter))) opSlice()
{
return (RangeT!(const(Array!(Waiter))) __slRange5049 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Waiter)) data = (ref const(RangeT!(const(Array!(Waiter)))) this = this;) , ((ref inout(const(Array!(Waiter))) __inlineretval16634 = this._outer_[0];) , __inlineretval16634);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5049._outer_[] = data , __slRange5049._a = a , __slRange5049._b = b , __slRange5049);
}
const nothrow @nogc @system RangeT!(const(Array!(Waiter))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(const(Array!(Waiter))) __slRange5050 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref const(Array!(Waiter)) data = (ref const(RangeT!(const(Array!(Waiter)))) this = this;) , ((ref inout(const(Array!(Waiter))) __inlineretval16635 = this._outer_[0];) , __inlineretval16635);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5050._outer_[] = data , __slRange5050._a = a , __slRange5050._b = b , __slRange5050);
}
static if (isMutable!(const(Array!(Waiter)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(Waiter)[] a = (&this._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(Waiter)[] a = (&this._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(Waiter)[] a = (&this._outer_)[0..1];
{
Array!(Waiter)[] __r5040 = a[];
ulong __key5041 = 0LU;
for (; __key5041 < __r5040.length; __key5041 += 1LU)
{
ref Array!(Waiter) e = __r5040[__key5041];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(Waiter)[] a = (&this._outer_)[0..1];
{
Array!(Waiter)[] __r5040 = a[];
ulong __key5041 = 0LU;
for (; __key5041 < __r5040.length; __key5041 += 1LU)
{
ref Array!(Waiter) e = __r5040[__key5041];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(const(Array!(Waiter))) opAssign(RangeT!(const(Array!(Waiter))) p)
{
(RangeT!(const(Array!(Waiter))) __swap5038 = void;) , __swap5038 = this , this = p;
{
{
Array!(Waiter)[] a = (&__swap5038._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
RangeT!(immutable(Array!(Waiter)))
struct RangeT
{
private immutable immutable(Array!(Waiter)[1]) _outer_;
private inout pure nothrow @nogc @property ref @safe immutable(Array!(Waiter)) _outer()
{
return this._outer_[0];
}
private
{
ulong _a;
ulong _b;
}
alias E = immutable(Waiter);
private nothrow @nogc @system this(ref immutable(Array!(Waiter)) data, ulong a, ulong b)
{
this._outer_[] = data;
this._a = a;
this._b = b;
return this;
}
nothrow @nogc @property RangeT!(immutable(Array!(Waiter))) save()
{
return (RangeT!(immutable(Array!(Waiter))) __copytmp5063 = (__copytmp5063 = this).__fieldPostblit();) , __copytmp5063;
}
const pure nothrow @nogc @property @safe bool empty()
{
return this._a >= this._b;
}
const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
alias opDollar = const pure nothrow @nogc @property @safe ulong length()
{
return this._b - this._a;
}
;
inout pure nothrow @nogc @property ref @safe immutable(Waiter) front()
{
assert(!((ref inout(RangeT!(immutable(Array!(Waiter)))) this = this;) , this._a >= this._b), "Attempting to access the front of an empty Array");
immutable ref immutable(Array!(Waiter)) __dop5064 = (ref inout(RangeT!(immutable(Array!(Waiter)))) this = this;) , ((ref immutable(Array!(Waiter)) __inlineretval16636 = this._outer_[0];) , __inlineretval16636);
return (ulong i = this._a;) , ((ref inout(Waiter) __inlineretval16637 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5064._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5064._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16637);
}
inout pure nothrow @nogc @property ref @safe immutable(Waiter) back()
{
assert(!((ref inout(RangeT!(immutable(Array!(Waiter)))) this = this;) , this._a >= this._b), "Attempting to access the back of an empty Array");
immutable ref immutable(Array!(Waiter)) __dop5065 = (ref inout(RangeT!(immutable(Array!(Waiter)))) this = this;) , ((ref immutable(Array!(Waiter)) __inlineretval16638 = this._outer_[0];) , __inlineretval16638);
return (ulong i = this._b - 1LU;) , ((ref inout(Waiter) __inlineretval16639 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5065._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5065._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16639);
}
pure nothrow @nogc @safe void popFront()
{
assert(!((ref RangeT!(immutable(Array!(Waiter))) this = this;) , this._a >= this._b), "Attempting to popFront an empty Array");
this._a += 1LU;
}
pure nothrow @nogc @safe void popBack()
{
assert(!((ref RangeT!(immutable(Array!(Waiter))) this = this;) , this._a >= this._b), "Attempting to popBack an empty Array");
this._b -= 1LU;
}
static if (isMutable!(immutable(Array!(Waiter)))
enum bool isMutable = false;
)
{
import std.algorithm.mutation : move;
E moveFront()
{
assert(!empty && _a < _outer.length);
return move(_outer._data._payload[_a]);
}
E moveBack()
{
assert(!empty && _b <= _outer.length);
return move(_outer._data._payload[_b - 1]);
}
E moveAt(size_t i)
{
assert(_a + i < _b && _a + i < _outer.length);
return move(_outer._data._payload[_a + i]);
}
}
inout pure nothrow @nogc ref @safe immutable(Waiter) opIndex(ulong i)
{
assert(this._a + i < this._b);
immutable ref immutable(Array!(Waiter)) __dop5066 = (ref inout(RangeT!(immutable(Array!(Waiter)))) this = this;) , ((ref immutable(Array!(Waiter)) __inlineretval16640 = this._outer_[0];) , __inlineretval16640);
return (ulong i = this._a + i;) , ((ref inout(Waiter) __inlineretval16641 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5066._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop5066._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16641);
}
nothrow @nogc @system RangeT!(immutable(Array!(Waiter))) opSlice()
{
return (RangeT!(immutable(Array!(Waiter))) __slRange5067 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Waiter)) data = (ref RangeT!(immutable(Array!(Waiter))) this = this;) , ((ref immutable(Array!(Waiter)) __inlineretval16642 = this._outer_[0];) , __inlineretval16642);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5067._outer_[] = data , __slRange5067._a = a , __slRange5067._b = b , __slRange5067);
}
nothrow @nogc @system RangeT!(immutable(Array!(Waiter))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(Waiter))) __slRange5068 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Waiter)) data = (ref RangeT!(immutable(Array!(Waiter))) this = this;) , ((ref immutable(Array!(Waiter)) __inlineretval16643 = this._outer_[0];) , __inlineretval16643);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5068._outer_[] = data , __slRange5068._a = a , __slRange5068._b = b , __slRange5068);
}
const nothrow @nogc @system RangeT!(immutable(Array!(Waiter))) opSlice()
{
return (RangeT!(immutable(Array!(Waiter))) __slRange5069 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Waiter)) data = (ref const(RangeT!(immutable(Array!(Waiter)))) this = this;) , ((ref immutable(Array!(Waiter)) __inlineretval16644 = this._outer_[0];) , __inlineretval16644);) , ((ulong a = this._a;)) , ((ulong b = this._b;))) , (__slRange5069._outer_[] = data , __slRange5069._a = a , __slRange5069._b = b , __slRange5069);
}
const nothrow @nogc @system RangeT!(immutable(Array!(Waiter))) opSlice(ulong i, ulong j)
{
assert(i <= j && this._a + j <= this._b);
return (RangeT!(immutable(Array!(Waiter))) __slRange5070 = RangeT(Array(RefCounted(RefCountedStore(null))), 0LU, 0LU);) , ((ref immutable(Array!(Waiter)) data = (ref const(RangeT!(immutable(Array!(Waiter)))) this = this;) , ((ref immutable(Array!(Waiter)) __inlineretval16645 = this._outer_[0];) , __inlineretval16645);) , ((ulong a = this._a + i;)) , ((ulong b = this._a + j;))) , (__slRange5070._outer_[] = data , __slRange5070._a = a , __slRange5070._b = b , __slRange5070);
}
static if (isMutable!(immutable(Array!(Waiter)))
)
{
void opSliceAssign(E value)
{
assert(_b <= _outer.length);
_outer[_a.._b] = value;
}
void opSliceAssign(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
_outer[_a + i.._a + j] = value;
}
void opSliceUnary(string op)() if (op == "++" || op == "--")
{
assert(_b <= _outer.length);
mixin(op ~ "_outer[_a .. _b];");
}
void opSliceUnary(string op)(size_t i, size_t j) if (op == "++" || op == "--")
{
assert(_a + j <= _b);
mixin(op ~ "_outer[_a + i .. _a + j];");
}
void opSliceOpAssign(string op)(E value)
{
assert(_b <= _outer.length);
mixin("_outer[_a .. _b] " ~ op ~ "= value;");
}
void opSliceOpAssign(string op)(E value, size_t i, size_t j)
{
assert(_a + j <= _b);
mixin("_outer[_a + i .. _a + j] " ~ op ~ "= value;");
}
}
~this()
{
{
Array!(Waiter)[] a = (cast(Array!(Waiter)*)&this._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
alias __xdtor = ~this()
{
{
Array!(Waiter)[] a = (cast(Array!(Waiter)*)&this._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
;
this(this)
{
{
Array!(Waiter)[] a = (cast(Array!(Waiter)*)&this._outer_)[0..1];
{
Array!(Waiter)[] __r5040 = a[];
ulong __key5041 = 0LU;
for (; __key5041 < __r5040.length; __key5041 += 1LU)
{
ref Array!(Waiter) e = __r5040[__key5041];
{
e._data.__postblit();
}
}
}
}
}
alias __xpostblit = this(this)
{
{
Array!(Waiter)[] a = (cast(Array!(Waiter)*)&this._outer_)[0..1];
{
Array!(Waiter)[] __r5040 = a[];
ulong __key5041 = 0LU;
for (; __key5041 < __r5040.length; __key5041 += 1LU)
{
ref Array!(Waiter) e = __r5040[__key5041];
{
e._data.__postblit();
}
}
}
}
}
;
nothrow @nogc ref return @system RangeT!(immutable(Array!(Waiter))) opAssign(RangeT!(immutable(Array!(Waiter))) p)
{
(RangeT!(immutable(Array!(Waiter))) __swap5062 = void;) , __swap5062 = this , this = p;
{
{
Array!(Waiter)[] a = (cast(Array!(Waiter)*)&__swap5062._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
return this;
}
}
static __gshared TypeInfo_Const _D93TypeInfo_xS3std9container5array54__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore6WaiterZ5Array6__initZ;
static __gshared TypeInfo_Const _D53TypeInfo_xS4vibe4core4sync18LocalTaskSemaphore6Waiter6__initZ;
static __gshared TypeInfo_Const _D95TypeInfo_xG1S3std9container5array54__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore6WaiterZ5Array6__initZ;
static __gshared TypeInfo_Struct _D92TypeInfo_S3std9container5array54__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore6WaiterZ5Array6__initZ;
static __gshared TypeInfo_Struct _D52TypeInfo_S4vibe4core4sync18LocalTaskSemaphore6Waiter6__initZ;
static __gshared TypeInfo_Invariant _D93TypeInfo_yS3std9container5array54__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore6WaiterZ5Array6__initZ;
static __gshared TypeInfo_Invariant _D95TypeInfo_yG1S3std9container5array54__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore6WaiterZ5Array6__initZ;
BinaryHeap!(Array!(Waiter), asc)
struct BinaryHeap
{
import std.functional : binaryFun;
import std.exception : enforce;
import std.algorithm.comparison : min;
import std.algorithm.mutation : move, swapAt;
import std.algorithm.sorting : HeapOps;
import std.typecons : RefCounted, RefCountedAutoInitialize;
static if (isRandomAccessRange!(Array!(Waiter))
)
{
alias Range = Store;
}
else
{
alias Range = RangeT!(Array!(Waiter));
}
alias percolate = void percolate()(Range r, size_t parent, immutable size_t end)
{
immutable root = parent;
for (;;)
{
{
auto child = (parent + 1) * 2;
if (child >= end)
{
if (child == end)
{
--child;
r.swapAt(parent, child);
parent = child;
}
break;
}
auto leftChild = child - 1;
if (lessFun(r[child], r[leftChild]))
child = leftChild;
r.swapAt(parent, child);
parent = child;
}
}
for (auto child = parent;
child > root; child = parent)
{
{
parent = (child - 1) / 2;
if (!lessFun(r[parent], r[child]))
break;
r.swapAt(parent, child);
}
}
}
;
alias buildHeap = void buildHeap()(Range r)
{
immutable n = r.length;
for (size_t i = n / 2;
i-- > 0;)
{
{
siftDown(r, i, n);
}
}
assert(isHeap(r));
}
;
private static struct Data
{
Array!(Waiter) _store;
ulong _length;
~this()
{
{
ref Array!(Waiter) this = this._store;
this._data.~this();
}
}
alias __xdtor = ~this()
{
{
ref Array!(Waiter) this = this._store;
this._data.~this();
}
}
;
this(this)
{
{
ref Array!(Waiter) this = this._store;
this._data.__postblit();
}
}
alias __xpostblit = this(this)
{
{
ref Array!(Waiter) this = this._store;
this._data.__postblit();
}
}
;
nothrow @nogc ref return @system Data opAssign(Data p)
{
(Data __swap5072 = void;) , __swap5072 = this , this = p;
{
{
ref Array!(Waiter) this = __swap5072._store;
this._data.~this();
}
}
return this;
}
}
private RefCounted!(Data, cast(RefCountedAutoInitialize)0) _payload;
private alias comp = static @safe bool asc(ref Waiter a, ref Waiter b)
{
if (a.seq == b.seq)
{
if (cast(int)a.priority == cast(int)b.priority)
{
return cast(ulong)&a.signal > cast(ulong)&b.signal;
}
return cast(int)a.priority < cast(int)b.priority;
}
return a.seq > b.seq;
}
;
private pure nothrow @nogc @property ref return @safe Array!(Waiter) _store()
{
assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null));
return ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;
}
private pure nothrow @nogc @property ref return @safe ulong _length()
{
assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null));
return ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length;
}
private pure nothrow @nogc @safe void assertValid()
{
}
@system void pop(Array!(Waiter) store)
{
try
{
assert(!(!((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16575 = this._refCounted;)) , __inlineretval16575._store !is null) || ((const(Waiter[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16576 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16576))._payload;) , !a.length)), "Cannot pop an empty store.");
if ((((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU) == 1LU)
return ;
Waiter t1 = (RangeT!(Array!(Waiter)) __tmpfordtor7856 = store.opSlice();) , ((Waiter __inlineretval16650 = assert(!((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7856;) , this._a >= this._b) && __tmpfordtor7856._a < ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7856;) , ((ref inout(Array!(Waiter)) __inlineretval16607 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16607._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16607._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU)) , ((ref Waiter source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7856;) , ((ref inout(Array!(Waiter)) __inlineretval16608 = this._outer_[0];) , __inlineretval16608))._data;) , ((ref inout(Payload) __inlineretval16609 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16609))._payload[__tmpfordtor7856._a];) , ((Waiter __inlineretval16610 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16610));) , __inlineretval16650);
Waiter t2 = (RangeT!(Array!(Waiter)) __tmpfordtor7857 = store.opSlice();) , ((Waiter __inlineretval16651 = assert(!((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7857;) , this._a >= this._b) && __tmpfordtor7857._b <= ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7857;) , ((ref inout(Array!(Waiter)) __inlineretval16611 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16611._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16611._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU)) , ((ref Waiter source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7857;) , ((ref inout(Array!(Waiter)) __inlineretval16612 = this._outer_[0];) , __inlineretval16612))._data;) , ((ref inout(Payload) __inlineretval16613 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16613))._payload[__tmpfordtor7857._b - 1LU];) , ((Waiter __inlineretval16614 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16614));) , __inlineretval16651);
((ref inout(Waiter) __inlineretval16652 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];) , __inlineretval16652) = ((ref Waiter source = t2;) , ((Waiter __inlineretval16653 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16653));
((ref inout(Waiter) __inlineretval16654 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16590 = this._refCounted;)) , __inlineretval16590._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16591 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16591))._payload[__dollar - 1LU];) , __inlineretval16654) = ((ref Waiter source = t1;) , ((Waiter __inlineretval16655 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16655));
percolate(store.opSlice(), 0LU, (((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = store._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU) - 1LU);
}
finally
{
{
store._data.~this();
}
}
}
public
{
@system this(Array!(Waiter) s, ulong initialSize = 18446744073709551615LU)
{
try
{
this.acquire(((Array!(Waiter) __copytmp7864 = (ref Array!(Waiter) this = __copytmp7864 = s;) , this._data.__postblit();) , __copytmp7864), initialSize);
return this;
}
finally
{
{
s._data.~this();
}
}
}
@system void acquire(Array!(Waiter) s, ulong initialSize = 18446744073709551615LU)
{
try
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16656 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16656;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16656;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16657 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16657)).opAssign(((ref Array!(Waiter) source = s;) , ((Array!(Waiter) __inlineretval16658 = moveImpl(source);) , __inlineretval16658)));
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) = ((ulong _param_0 = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16659 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16659._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16659._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU;) , ((ulong _param_1 = initialSize;)) , (alias a = ulong _param_0;
;
, (alias T0 = ulong;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref ulong a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1));
if (((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) < 2LU)
return ;
buildHeap(((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16660 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16660)).opSlice());
{
ref BinaryHeap!(Array!(Waiter), asc) this = this;
}
}
finally
{
{
s._data.~this();
}
}
}
nothrow @nogc @system void assume(Array!(Waiter) s, ulong initialSize = 18446744073709551615LU)
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16661 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16661;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16661;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16662 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16662)).opAssign(((Array!(Waiter) __copytmp7865 = (ref Array!(Waiter) this = __copytmp7865 = s;) , this._data.__postblit();) , __copytmp7865));
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) = ((ulong _param_0 = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16663 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16663._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16663._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU;) , ((ulong _param_1 = initialSize;)) , (alias a = ulong _param_0;
;
, (alias T0 = ulong;
) , (alias b = ulong _param_1;
;
) , (alias T1 = ulong;
) , ((immutable immutable(bool) chooseA = (ref ulong a = _param_0;) , ((ref ulong b = _param_1;)) , ((immutable immutable(bool) result = a < b;) , result);)) , chooseA ? _param_0 : _param_1));
{
ref BinaryHeap!(Array!(Waiter), asc) this = this;
}
{
s._data.~this();
}
}
auto nothrow @nogc @system RangeT!(Array!(Waiter)) release()
{
if (!((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16664 = this._refCounted;)) , __inlineretval16664._store !is null))
{
return RangeT([Array(RefCounted(RefCountedStore(null)))], 0LU, 0LU);
}
{
ref BinaryHeap!(Array!(Waiter), asc) this = this;
}
RangeT!(Array!(Waiter)) result = (ref Array!(Waiter) __dop7867 = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16665 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16665);) , result = __dop7867.opSlice(0LU, ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)));
try
{
{
ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;
RefCounted!(Data, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
return (RangeT!(Array!(Waiter)) __copytmp7868 = (__copytmp7868 = result).__fieldPostblit();) , __copytmp7868;
}
finally
{
{
{
Array!(Waiter)[] a = (&result._outer_)[0..1];
{
Array!(Waiter)[] __r5042 = a[];
ulong __key5043 = __r5042.length;
for (; __key5043--;)
{
ref Array!(Waiter) e = __r5042[__key5043];
{
e._data.~this();
}
}
}
}
}
}
}
pure nothrow @nogc @property @safe bool empty()
{
return !((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16666 = this._refCounted;)) , __inlineretval16666._store !is null) ? (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length) : 0LU);
}
static if (is(Array!(Waiter) == Array!(Waiter)))
{
nothrow @nogc @property @system BinaryHeap!(Array!(Waiter), asc) dup()
{
BinaryHeap!(Array!(Waiter), asc) result = 0;
try
if (!((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16667 = this._refCounted;)) , __inlineretval16667._store !is null))
return result;
result.assume(((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16668 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16668)).dup(), ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16666 = this._refCounted;)) , __inlineretval16666._store !is null) ? (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length) : 0LU));
return result;
catch(Throwable __o7869)
{
{
result._payload.~this();
}
throw __o7869;
}
}
}
pure nothrow @nogc @property @safe ulong length()
{
return ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16666 = this._refCounted;)) , __inlineretval16666._store !is null) ? (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length) : 0LU;
}
pure nothrow @nogc @property @safe ulong capacity()
{
if (!((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16669 = this._refCounted;)) , __inlineretval16669._store !is null))
return 0LU;
return (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16670 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16670._data;) , ((ref inout(RefCountedStore) __inlineretval16583 = this._refCounted;)) , __inlineretval16583._store !is null) ? ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = __inlineretval16670._data;) , ((ref inout(Payload) __inlineretval16584 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16584))._capacity : 0LU;
}
pure @property @safe Waiter front()
{
enforce(!((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , !((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16666 = this._refCounted;)) , __inlineretval16666._store !is null) ? (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length) : 0LU)), delegate const(char)[]() => "Cannot call front on an empty heap.", "/usr/include/dmd/phobos/std/container/binaryheap.d", 248LU);
return (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16671 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref inout(Waiter) __inlineretval16672 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16671._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16671._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];) , __inlineretval16672);
}
nothrow @nogc @system void clear()
{
{
ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;
RefCounted!(Data, cast(RefCountedAutoInitialize)0) rhs = RefCounted(RefCountedStore(null));
{
(ref Impl* lhs = this._refCounted._store;) , ((ref Impl* rhs = rhs._refCounted._store;));
if (!__ctfe)
{
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs internal pointer.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs internal pointer.");
assert(!((ref const(Impl*) source = lhs;) , ((ref const(Impl*) target = rhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: lhs points to rhs.");
assert(!((ref const(Impl*) source = rhs;) , ((ref const(Impl*) target = lhs;)) , ((const const(void*) m = *cast(void**)&source;) , ((const const(void*) b = cast(void*)&target;)) , ((const const(void*) e = b + 8L;)) , b <= m && m < e)), "Swap: rhs points to lhs.");
}
Impl* tmp = lhs;
lhs = rhs;
rhs = tmp;
}
rhs.~this();
}
}
@system ulong insert(Waiter value)
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16673 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16673;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16673;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
if (((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16666 = this._refCounted;)) , __inlineretval16666._store !is null) ? (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length) : 0LU) == ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16674 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16674._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16674._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU))
{
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16675 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16675)).insertBack(value);
}
else
{
((ref Array!(Waiter) __dop7870 = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16676 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16676);) , ((ulong i = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length);) , ((ref inout(Waiter) __inlineretval16677 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7870._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7870._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16677))) = value;
}
{
ulong n = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length);
for (; n;)
{
{
ulong parentIdx = (n - 1LU) / 2LU;
if (!((ref Waiter a = (ref Array!(Waiter) __dop7871 = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16678 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16678);) , ((ulong i = parentIdx;) , ((ref inout(Waiter) __inlineretval16679 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7871._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7871._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16679));) , ((ref Waiter b = (ref Array!(Waiter) __dop7872 = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16680 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16680);) , ((ulong i = n;) , ((ref inout(Waiter) __inlineretval16681 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7872._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7872._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16681));)) , a.seq == b.seq ? cast(int)a.priority == cast(int)b.priority ? cast(ulong)&a.signal > cast(ulong)&b.signal : cast(int)a.priority < cast(int)b.priority : a.seq > b.seq))
break;
{
(ref Array!(Waiter) r = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16682 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16682);) , ((ulong i1 = parentIdx;)) , ((ulong i2 = n;));
{
(ref Waiter lhs = (ulong i = i1;) , ((ref inout(Waiter) __inlineretval15097 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = r._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = r._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval15097);) , ((ref Waiter rhs = (ulong i = i2;) , ((ref inout(Waiter) __inlineretval15098 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = r._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = r._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval15098);));
if (!__ctfe)
{
assert(!doesPointTo(lhs, lhs), "Swap: lhs internal pointer.");
assert(!doesPointTo(rhs, rhs), "Swap: rhs internal pointer.");
assert(!doesPointTo(lhs, rhs), "Swap: lhs points to rhs.");
assert(!doesPointTo(rhs, lhs), "Swap: rhs points to lhs.");
}
Waiter tmp = lhs;
lhs = rhs;
rhs = tmp;
}
}
n = parentIdx;
}
}
}
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) += 1LU;
return 1LU;
}
@system void removeFront()
{
enforce(!((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , !((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16666 = this._refCounted;)) , __inlineretval16666._store !is null) ? (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length) : 0LU)), delegate const(char)[]() => "Cannot call removeFront on an empty heap.", "/usr/include/dmd/phobos/std/container/binaryheap.d", 318LU);
if (((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) > 1LU)
{
Waiter t1 = (RangeT!(Array!(Waiter)) __tmpfordtor7873 = ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16683 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16683)).opSlice();) , ((Waiter __inlineretval16684 = assert(!((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7873;) , this._a >= this._b) && __tmpfordtor7873._a < ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7873;) , ((ref inout(Array!(Waiter)) __inlineretval16607 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16607._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16607._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU)) , ((ref Waiter source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7873;) , ((ref inout(Array!(Waiter)) __inlineretval16608 = this._outer_[0];) , __inlineretval16608))._data;) , ((ref inout(Payload) __inlineretval16609 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16609))._payload[__tmpfordtor7873._a];) , ((Waiter __inlineretval16610 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16610));) , __inlineretval16684);
Waiter t2 = (RangeT!(Array!(Waiter)) __tmpfordtor7874 = ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16685 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16685)).opSlice();) , ((ulong i = ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) - 1LU;)) , ((Waiter __inlineretval16686 = assert(__tmpfordtor7874._a + i < __tmpfordtor7874._b && __tmpfordtor7874._a + i < ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7874;) , ((ref inout(Array!(Waiter)) __inlineretval16615 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16615._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16615._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU)) , ((ref Waiter source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7874;) , ((ref inout(Array!(Waiter)) __inlineretval16616 = this._outer_[0];) , __inlineretval16616))._data;) , ((ref inout(Payload) __inlineretval16617 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16617))._payload[__tmpfordtor7874._a + i];) , ((Waiter __inlineretval16618 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16618));) , __inlineretval16686);
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16687 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref inout(Waiter) __inlineretval16688 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16687._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16687._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];) , __inlineretval16688)) = ((ref Waiter source = t2;) , ((Waiter __inlineretval16689 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16689));
((ref Array!(Waiter) __dop7875 = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16690 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16690);) , ((ulong i = ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) - 1LU;) , ((ref inout(Waiter) __inlineretval16691 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7875._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7875._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16691))) = ((ref Waiter source = t1;) , ((Waiter __inlineretval16692 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16692));
}
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) -= 1LU;
percolate(((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16693 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16693)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)));
}
alias popFront = @system void removeFront()
{
enforce(!((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , !((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16666 = this._refCounted;)) , __inlineretval16666._store !is null) ? (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length) : 0LU)), delegate const(char)[]() => "Cannot call removeFront on an empty heap.", "/usr/include/dmd/phobos/std/container/binaryheap.d", 318LU);
if (((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) > 1LU)
{
Waiter t1 = (RangeT!(Array!(Waiter)) __tmpfordtor7873 = ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16683 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16683)).opSlice();) , ((Waiter __inlineretval16684 = assert(!((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7873;) , this._a >= this._b) && __tmpfordtor7873._a < ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7873;) , ((ref inout(Array!(Waiter)) __inlineretval16607 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16607._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16607._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU)) , ((ref Waiter source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7873;) , ((ref inout(Array!(Waiter)) __inlineretval16608 = this._outer_[0];) , __inlineretval16608))._data;) , ((ref inout(Payload) __inlineretval16609 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16609))._payload[__tmpfordtor7873._a];) , ((Waiter __inlineretval16610 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16610));) , __inlineretval16684);
Waiter t2 = (RangeT!(Array!(Waiter)) __tmpfordtor7874 = ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16685 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16685)).opSlice();) , ((ulong i = ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) - 1LU;)) , ((Waiter __inlineretval16686 = assert(__tmpfordtor7874._a + i < __tmpfordtor7874._b && __tmpfordtor7874._a + i < ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7874;) , ((ref inout(Array!(Waiter)) __inlineretval16615 = this._outer_[0];)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16615._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16615._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU)) , ((ref Waiter source = ((ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = ((ref RangeT!(Array!(Waiter)) this = __tmpfordtor7874;) , ((ref inout(Array!(Waiter)) __inlineretval16616 = this._outer_[0];) , __inlineretval16616))._data;) , ((ref inout(Payload) __inlineretval16617 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16617))._payload[__tmpfordtor7874._a + i];) , ((Waiter __inlineretval16618 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16618));) , __inlineretval16686);
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16687 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref inout(Waiter) __inlineretval16688 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16687._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16687._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];) , __inlineretval16688)) = ((ref Waiter source = t2;) , ((Waiter __inlineretval16689 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16689));
((ref Array!(Waiter) __dop7875 = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16690 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16690);) , ((ulong i = ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) - 1LU;) , ((ref inout(Waiter) __inlineretval16691 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7875._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7875._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16691))) = ((ref Waiter source = t1;) , ((Waiter __inlineretval16692 = (ref Waiter source = source;) , ((Waiter __inlineretval14764 = (ref Waiter source = source;) , ((Waiter __inlineretval14763 = (Waiter result = void;) , ((ref Waiter source = source;) , ((ref Waiter target = result;)) , (!__ctfe && assert(!doesPointTo(source, source), "Cannot move object with internal pointer.") , assert(&source !is &target, "source and target must not be identical") , target = source)) , result;) , __inlineretval14763);) , __inlineretval14764);) , __inlineretval16692));
}
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) -= 1LU;
percolate(((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16693 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16693)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)));
}
;
@system Waiter removeAny()
{
this.removeFront();
ref Array!(Waiter) __dop7876 = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16694 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16694);
return (ulong i = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length);) , ((ref inout(Waiter) __inlineretval16695 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7876._data;) , ((ref inout(RefCountedStore) __inlineretval14708 = this._refCounted;)) , __inlineretval14708._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __dop7876._data;) , ((ref inout(Payload) __inlineretval14709 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval14709))._payload[i];) , __inlineretval16695);
}
@system void replaceFront(Waiter value)
{
assert(!((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , !((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16666 = this._refCounted;)) , __inlineretval16666._store !is null) ? (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length) : 0LU)), "Cannot call replaceFront on an empty heap.");
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16696 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref inout(Waiter) __inlineretval16697 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16696._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16696._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];) , __inlineretval16697)) = value;
percolate(((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16698 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16698)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)));
}
@system bool conditionalInsert(Waiter value)
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16699 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16699;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16699;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
if (((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) < ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16700 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16700._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16700._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU))
{
this.insert(value);
return true;
}
assert(!((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16701 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16701._data;) , ((ref inout(RefCountedStore) __inlineretval16575 = this._refCounted;)) , __inlineretval16575._store !is null) || ((const(Waiter[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16701._data;) , ((ref inout(Payload) __inlineretval16576 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16576))._payload;) , !a.length)), "Cannot replace front of an empty heap.");
if (!((ref Waiter a = value;) , ((ref Waiter b = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16702 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref inout(Waiter) __inlineretval16703 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16702._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16702._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];) , __inlineretval16703);)) , a.seq == b.seq ? cast(int)a.priority == cast(int)b.priority ? cast(ulong)&a.signal > cast(ulong)&b.signal : cast(int)a.priority < cast(int)b.priority : a.seq > b.seq))
return false;
((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16704 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref inout(Waiter) __inlineretval16705 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16704._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16704._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];) , __inlineretval16705)) = value;
percolate(((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16706 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16706)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)));
return true;
}
@system bool conditionalSwap(ref Waiter value)
{
{
(ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16707 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16707;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16707;
this._store = cast(Impl*)((ulong size = 24LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 16LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
assert(((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)) == ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16708 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16708._data;) , ((ref inout(RefCountedStore) __inlineretval16581 = this._refCounted;)) , __inlineretval16581._store !is null) ? ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16708._data;) , ((ref inout(Payload) __inlineretval16582 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16582))._payload.length : 0LU));
assert(!((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16709 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , !((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16709._data;) , ((ref inout(RefCountedStore) __inlineretval16575 = this._refCounted;)) , __inlineretval16575._store !is null) || ((const(Waiter[]) a = ((ref const(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16709._data;) , ((ref inout(Payload) __inlineretval16576 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16576))._payload;) , !a.length)), "Cannot swap front of an empty heap.");
if (!((ref Waiter a = value;) , ((ref Waiter b = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16710 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref inout(Waiter) __inlineretval16711 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16710._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16710._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];) , __inlineretval16711);)) , a.seq == b.seq ? cast(int)a.priority == cast(int)b.priority ? cast(ulong)&a.signal > cast(ulong)&b.signal : cast(int)a.priority < cast(int)b.priority : a.seq > b.seq))
return false;
import std.algorithm.mutation : swap;
{
(ref Waiter lhs = (ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16712 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;)) , ((ref inout(Waiter) __inlineretval16713 = assert(((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16712._data;) , ((ref inout(RefCountedStore) __inlineretval16588 = this._refCounted;)) , __inlineretval16588._store !is null)) , ((ref inout(RefCounted!(Payload, cast(RefCountedAutoInitialize)0)) this = __inlineretval16712._data;) , ((ref inout(Payload) __inlineretval16589 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16589))._payload[0];) , __inlineretval16713);) , ((ref Waiter rhs = value;));
if (!__ctfe)
{
assert(!doesPointTo(lhs, lhs), "Swap: lhs internal pointer.");
assert(!doesPointTo(rhs, rhs), "Swap: rhs internal pointer.");
assert(!doesPointTo(lhs, rhs), "Swap: lhs points to rhs.");
assert(!doesPointTo(rhs, lhs), "Swap: rhs points to lhs.");
}
Waiter tmp = lhs;
lhs = rhs;
rhs = tmp;
}
percolate(((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , ((ref Array!(Waiter) __inlineretval16714 = assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16646 = this._refCounted;)) , __inlineretval16646._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16647 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16647))._store;) , __inlineretval16714)).opSlice(), 0LU, ((ref BinaryHeap!(Array!(Waiter), asc) this = this;) , (assert(((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(RefCountedStore) __inlineretval16648 = this._refCounted;)) , __inlineretval16648._store !is null)) , ((ref RefCounted!(Data, cast(RefCountedAutoInitialize)0) this = this._payload;) , ((ref inout(Data) __inlineretval16649 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;) , __inlineretval16649))._length)));
return true;
}
}
~this()
{
this._payload.~this();
}
alias __xdtor = ~this()
{
this._payload.~this();
}
;
this(this)
{
this._payload.__postblit();
}
alias __xpostblit = this(this)
{
this._payload.__postblit();
}
;
nothrow @nogc ref return @system BinaryHeap!(Array!(Waiter), asc) opAssign(BinaryHeap!(Array!(Waiter), asc) p)
{
(BinaryHeap!(Array!(Waiter), asc) __swap5086 = void;) , __swap5086 = this , this = p;
{
__swap5086._payload.~this();
}
return this;
}
}
__ctor!(Waiter)
nothrow @nogc @system this(Waiter[] values...)
{
import std.conv : emplace;
import core.checkedint : mulu;
bool overflow = false;
const const(ulong) nbytes = (ulong x = values.length;) , ((ulong y = 16LU;)) , ((ref bool overflow = overflow;)) , ((@nogc ulong r = x * y;) , x && r / x != y && (overflow = true) , r);
if (overflow)
halt;
Waiter* p = cast(Waiter*)malloc(nbytes);
if (p)
{
(const(void*) p = cast(const(void*))p;) , ((ulong sz = 16LU * values.length;)) , ((const(TypeInfo) ti = null;));
gc_addRange(p, sz, ti);
}
{
Waiter[] __r5075 = values[];
ulong __key5074 = 0LU;
for (; __key5074 < __r5075.length; __key5074 += 1LU)
{
Waiter e = __r5075[__key5074];
ulong i = __key5074;
emplace(p + cast(long)i * 16L, e);
}
}
this._data = 0 , this._data.this(p[0..values.length]);
return this;
}
writeln!(string, string)
@safe void writeln(string _param_0, string _param_1)
{
import std.traits : isAggregateType;
((File __tmpfordtor6484 = (File __inlineretval16716 = (File __copytmp16715 = (__copytmp16715 = stdout).__postblit();) , __copytmp16715;) , __inlineretval16716;) , __tmpfordtor6484).write(_param_0, _param_1, '\x0a');
}
write!(string, string, char)
@safe void write(string _param_0, string _param_1, char _param_2)
{
import std.traits : isBoolean, isIntegral, isAggregateType;
LockingTextWriter w = this.lockingTextWriter();
try
{
unrolled {
{
string arg = _param_0;
alias A = string;
{
(ref LockingTextWriter r = w;) , ((string e = arg;));
{
(ref LockingTextWriter r = r;) , ((ref string e = e;));
enum bool usingPut = true;
r.put(e);
}
}
}
{
string arg = _param_1;
alias A = string;
{
(ref LockingTextWriter r = w;) , ((string e = arg;));
{
(ref LockingTextWriter r = r;) , ((ref string e = e;));
enum bool usingPut = true;
r.put(e);
}
}
}
{
char arg = _param_2;
alias A = char;
{
(ref LockingTextWriter r = w;) , ((char e = arg;));
{
(ref LockingTextWriter r = r;) , ((ref char e = e;));
enum bool usingPut = true;
r.put(e);
}
}
}
}
}
finally
{
{
if (w.fps_)
{
funlockfile(w.fps_);
w.fps_ = null;
}
}
}
}
put!string
@safe void put(string writeme)
{
import std.exception : errnoEnforce;
alias C = immutable(char);
if (this.orientation_ <= 0)
{
ulong result = (shared(_IO_FILE)* f = this.fps_;) , ((const(char[]) obj = writeme;)) , fwrite(cast(const(void*))cast(const(char)*)obj, 1LU, obj.length, f);
if (result != writeme.length)
errnoEnforce(0, delegate string() => null);
return ;
}
alias Elem = dchar;
cast(void)_aApplycd1(writeme, delegate int(ref dchar __applyArg0) => 0);
}
trustedFwrite!char
auto nothrow @nogc @trusted ulong trustedFwrite(shared(_IO_FILE)* f, const(char[]) obj)
{
return fwrite(cast(const(void*))cast(const(char)*)obj, 1LU, obj.length, f);
}
put!dchar
@safe void put(dchar c)
{
import std.traits : Parameters;
auto static nothrow @nogc @trusted int trustedFPUTC(int ch, _IO_FILE* h)
{
return fputc_unlocked(ch, h);
}
auto static nothrow @nogc @trusted int trustedFPUTWC(dchar ch, _IO_FILE* h)
{
return fputwc_unlocked(ch, h);
}
import std.utf : encode;
if (this.orientation_ <= 0)
{
if (cast(uint)c <= 127u)
{
trustedFPUTC(cast(int)c, ((ref LockingTextWriter this = this;) , cast(_IO_FILE*)this.fps_));
}
else
{
char[4] buf = void;
immutable immutable(ulong) len = encode(buf, c);
{
ulong __key6482 = 0LU;
ulong __limit6483 = len;
for (; __key6482 < __limit6483; __key6482 += 1LU)
{
ulong i = __key6482;
trustedFPUTC(cast(int)buf[i], ((ref LockingTextWriter this = this;) , cast(_IO_FILE*)this.fps_));
}
}
}
}
else
{
trustedFPUTWC(c, ((ref LockingTextWriter this = this;) , cast(_IO_FILE*)this.fps_));
}
}
put!char
@safe void put(char c)
{
import std.traits : Parameters;
auto static nothrow @nogc @trusted int trustedFPUTC(int ch, _IO_FILE* h)
{
return fputc_unlocked(ch, h);
}
auto static nothrow @nogc @trusted int trustedFPUTWC(dchar ch, _IO_FILE* h)
{
return fputwc_unlocked(ch, h);
}
if (this.orientation_ <= 0)
trustedFPUTC(cast(int)c, ((ref LockingTextWriter this = this;) , cast(_IO_FILE*)this.fps_));
else
trustedFPUTWC(cast(dchar)c, ((ref LockingTextWriter this = this;) , cast(_IO_FILE*)this.fps_));
}
static __gshared TypeInfo_Const _D14TypeInfo_xDFZv6__initZ;
insertBack!ulong
nothrow @nogc @system ulong insertBack(ulong stuff)
{
{
(ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(RefCountedStore) __inlineretval16717 = this._refCounted;));
if (!((ref RefCountedStore this = __inlineretval16717;) , this._store !is null))
{
ref RefCountedStore this = __inlineretval16717;
this._store = cast(Impl*)((ulong size = 32LU;) , ((const const(int) errno = fakePureGetErrno();) , ((void* ret = fakePureMalloc(size);)) , (!ret || errno != 0) && cast(void)fakePureSetErrno(errno) , ret));
if (this._store is null)
{
void* pretend_sideffect = null;
throw staticError();
}
pureGcAddRange(cast(const(void*))&(*this._store)._payload, 24LU, null);
emplace(&(*this._store)._payload);
(*this._store)._count = 1LU;
}
}
return (ref RefCounted!(Payload, cast(RefCountedAutoInitialize)0) this = this._data;) , ((ref inout(Payload) __inlineretval16718 = assert(((ref inout(RefCountedStore) this = this._refCounted;) , this._store !is null), "Attempted to access an uninitialized payload.") , (*this._refCounted._store)._payload;)) , ((ulong stuff = stuff;))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment