Move memory/package.d into memory.allocator

This commit is contained in:
2019-03-22 08:18:01 +01:00
parent a36b51f0c3
commit ad46afb10b
43 changed files with 489 additions and 537 deletions

View File

@ -5,7 +5,7 @@
/**
* Event loop implementation for Linux.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@ -30,7 +30,7 @@ import tanya.async.protocol;
import tanya.async.transport;
import tanya.async.watcher;
import tanya.container.array;
import tanya.memory;
import tanya.memory.allocator;
import tanya.network.socket;
extern (C) nothrow @nogc

View File

@ -5,7 +5,7 @@
/**
* Event loop implementation for Windows.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@ -26,7 +26,7 @@ import tanya.async.protocol;
import tanya.async.transport;
import tanya.async.watcher;
import tanya.container.buffer;
import tanya.memory;
import tanya.memory.allocator;
import tanya.network.socket;
import tanya.sys.windows.winbase;

View File

@ -5,7 +5,7 @@
/*
* Event loop implementation for *BSD.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@ -58,7 +58,7 @@ import tanya.async.loop;
import tanya.async.transport;
import tanya.async.watcher;
import tanya.container.array;
import tanya.memory;
import tanya.memory.allocator;
import tanya.network.socket;
void EV_SET(kevent_t* kevp, typeof(kevent_t.tupleof) args) pure nothrow @nogc

View File

@ -5,7 +5,7 @@
/*
* This module contains base implementations for reactor event loops.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@ -25,7 +25,7 @@ import tanya.async.transport;
import tanya.async.watcher;
import tanya.container.array;
import tanya.container.buffer;
import tanya.memory;
import tanya.memory.allocator;
import tanya.network.socket;
/**

View File

@ -7,7 +7,7 @@
*
* Note: Available only on Windows.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@ -62,7 +62,7 @@
* }
* ---
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@ -77,7 +77,7 @@ import tanya.async.watcher;
import tanya.bitmanip;
import tanya.container.buffer;
import tanya.container.list;
import tanya.memory;
import tanya.memory.allocator;
import tanya.network.socket;
version (DisableBackends)

View File

@ -5,7 +5,7 @@
/**
* This package provides asynchronous capabilities.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@ -9,7 +9,7 @@
* When an event from the network arrives, a protocol method gets
* called and can respond to the event.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@ -6,7 +6,7 @@
* This module contains transports which are responsible for data dilvery
* between two parties of an asynchronous communication.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@ -5,7 +5,7 @@
/**
* Watchers register user's interest in some event.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@ -19,7 +19,7 @@ import tanya.async.protocol;
import tanya.async.transport;
import tanya.container.buffer;
import tanya.container.list;
import tanya.memory;
import tanya.memory.allocator;
import tanya.network.socket;
/**

View File

@ -17,7 +17,8 @@ module tanya.container.array;
import core.checkedint;
import tanya.algorithm.comparison;
import tanya.algorithm.mutation;
import tanya.memory;
import tanya.memory.allocator;
import tanya.memory.lifetime;
import tanya.meta.trait;
import tanya.meta.transform;
import tanya.range;

View File

@ -14,7 +14,7 @@
*/
module tanya.container.buffer;
import tanya.memory;
import tanya.memory.allocator;
import tanya.meta.trait;
version (unittest)

View File

@ -18,7 +18,8 @@ import tanya.algorithm.mutation;
import tanya.container.array;
import tanya.container.entry;
import tanya.hash.lookup;
import tanya.memory;
import tanya.memory.allocator;
import tanya.memory.lifetime;
import tanya.meta.trait;
import tanya.meta.transform;
import tanya.range.primitive;

View File

@ -17,7 +17,8 @@ module tanya.container.list;
import tanya.algorithm.comparison;
import tanya.container.entry;
import tanya.memory;
import tanya.memory.allocator;
import tanya.memory.lifetime;
import tanya.meta.trait;
import tanya.meta.transform;
import tanya.range.array;

View File

@ -18,7 +18,8 @@ module tanya.container.set;
import tanya.container.array;
import tanya.container.entry;
import tanya.hash.lookup;
import tanya.memory;
import tanya.memory.allocator;
import tanya.memory.lifetime;
import tanya.meta.trait;
import tanya.meta.transform;
import tanya.range.primitive;

View File

@ -29,7 +29,8 @@ module tanya.container.string;
import tanya.algorithm.comparison;
import tanya.algorithm.mutation;
import tanya.hash.lookup;
import tanya.memory;
import tanya.memory.allocator;
import tanya.memory.lifetime;
import tanya.meta.trait;
import tanya.meta.transform;
import tanya.range.array;

View File

@ -15,7 +15,7 @@
module tanya.conv;
import tanya.container.string;
import tanya.memory;
import tanya.memory.allocator;
deprecated("Use tanya.memory.lifetime.emplace instead")
public import tanya.memory.lifetime : emplace;
import tanya.meta.trait;
@ -64,12 +64,8 @@ if (isInputRange!R
&& isSomeChar!(ElementType!R)
&& isIntegral!T
&& isUnsigned!T)
in
{
assert(base >= 2);
assert(base <= 36);
}
do
in (base >= 2)
in (base <= 36)
{
T boundary = cast(T) (T.max / base);
if (range.empty)

View File

@ -10,7 +10,7 @@
* Source: $(LINK2 https://github.com/caraus-ecms/tanya/blob/master/source/tanya/exception.d,
* tanya/exception.d)
*/
deprecated("Use tanya.memory.lifetimeinstead")
deprecated("Use tanya.memory.allocator instead")
module tanya.exception;
public import tanya.memory.lifetime : onOutOfMemoryError, OutOfMemoryError;
public import tanya.memory.allocator : onOutOfMemoryError, OutOfMemoryError;

View File

@ -1175,11 +1175,7 @@ private struct uint128
}
Tuple!(uint128, uint128) divMod(ulong rhs) const @nogc nothrow pure @safe
in
{
assert(rhs != uint128(), "Division by 0");
}
do
in (rhs != uint128(), "Division by 0")
{
if (rhs == 1)
{
@ -1279,11 +1275,7 @@ private int indexMismatch(ulong low, ulong high) @nogc nothrow pure @safe
private char[] errol2(double value,
return ref char[512] buffer,
out int exponent) @nogc nothrow pure @safe
in
{
assert(value > 9.007199254740992e15 && value < 3.40282366920938e38);
}
do
in (value > 9.007199254740992e15 && value < 3.40282366920938e38)
{
auto v = uint128(value);
auto leftBoundary = v + raise2ToExp((value - previous(value)) / 2.0);
@ -1368,11 +1360,7 @@ do
private char[] errolFixed(double value,
return ref char[512] buffer,
out int exponent) @nogc nothrow pure @safe
in
{
assert(value >= 16.0 && value <= 9.007199254740992e15);
}
do
in (value >= 16.0 && value <= 9.007199254740992e15)
{
auto decimal = cast(ulong) value;
auto n = cast(double) decimal;

View File

@ -19,7 +19,8 @@ import tanya.algorithm.iteration;
import tanya.algorithm.mutation;
import tanya.container.array;
import tanya.encoding.ascii;
import tanya.memory;
import tanya.memory.allocator;
import tanya.memory.lifetime;
import tanya.meta.trait;
import tanya.meta.transform;
import tanya.range;

View File

@ -14,7 +14,7 @@
*/
module tanya.math.random;
import tanya.memory;
import tanya.memory.allocator;
import tanya.typecons;
/// Maximum amount gathered from the entropy sources.

View File

@ -16,7 +16,7 @@ module tanya.net.uri;
import tanya.conv;
import tanya.encoding.ascii;
import tanya.memory;
import tanya.memory.allocator;
/**
* Thrown if an invalid URI was specified.

View File

@ -5,7 +5,7 @@
/**
* Network programming.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)

View File

@ -41,7 +41,7 @@
* For an example of an asynchronous server refer to the documentation of the
* $(D_PSYMBOL tanya.async.loop) module.
*
* Copyright: Eugene Wissner 2016-2018.
* Copyright: Eugene Wissner 2016-2019.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@ -55,7 +55,7 @@ import core.time;
public import std.socket : SocketOption, SocketOptionLevel;
import tanya.algorithm.comparison;
import tanya.bitmanip;
import tanya.memory;
import tanya.memory.allocator;
import tanya.meta.trait;
import tanya.os.error;

View File

@ -296,11 +296,7 @@ struct Option(T)
/// ditto
bool opEquals(U)(auto ref const U that) const
if (ifTestable!(U, a => a == T.init) && !is(U == Option))
in
{
assert(!isNothing);
}
do
in (!isNothing)
{
return get == that;
}