Loop.maxEvents is const, not inout const

This commit is contained in:
2017-01-12 10:43:02 +01:00
parent cb6cc65113
commit 8ddea0aa46
4 changed files with 17 additions and 26 deletions

View File

@ -46,7 +46,7 @@ class EpollLoop : SelectorLoop
{
if ((fd = epoll_create1(EPOLL_CLOEXEC)) < 0)
{
throw MmapPool.instance.make!BadLoopException("epoll initialization failed");
throw defaultAllocator.make!BadLoopException("epoll initialization failed");
}
super();
events = Vector!epoll_event(maxEvents, MmapPool.instance);

View File

@ -124,8 +124,8 @@ class KqueueLoop : SelectorLoop
* Returns: Maximal event count can be got at a time
* (should be supported by the backend).
*/
override protected @property inout(uint) maxEvents()
inout const pure nothrow @safe @nogc
override protected @property uint maxEvents()
const pure nothrow @safe @nogc
{
return cast(uint) events.length;
}
@ -158,12 +158,12 @@ class KqueueLoop : SelectorLoop
changes.length = changeCount + maxEvents;
}
EV_SET(&changes[changeCount],
cast(ulong) socket,
filter,
flags,
0U,
0L,
null);
cast(ulong) socket,
filter,
flags,
0U,
0L,
null);
++changeCount;
}