diff options
| author | Eugen Wissner <belka@caraus.de> | 2019-03-22 08:18:01 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2019-03-22 08:18:01 +0100 |
| commit | ad46afb10bca80086b11b998bf4c992dc96f577e (patch) | |
| tree | c8ffaf54250cfe6a1818fe5a324d17c923141047 /source | |
| parent | a36b51f0c3c176d4107e7ea84a4c0dd51197b8dd (diff) | |
| download | tanya-ad46afb10bca80086b11b998bf4c992dc96f577e.tar.gz | |
Move memory/package.d into memory.allocator
Diffstat (limited to 'source')
| -rw-r--r-- | source/tanya/async/event/epoll.d | 4 | ||||
| -rw-r--r-- | source/tanya/async/event/iocp.d | 4 | ||||
| -rw-r--r-- | source/tanya/async/event/kqueue.d | 4 | ||||
| -rw-r--r-- | source/tanya/async/event/selector.d | 4 | ||||
| -rw-r--r-- | source/tanya/async/iocp.d | 2 | ||||
| -rw-r--r-- | source/tanya/async/loop.d | 4 | ||||
| -rw-r--r-- | source/tanya/async/package.d | 2 | ||||
| -rw-r--r-- | source/tanya/async/protocol.d | 2 | ||||
| -rw-r--r-- | source/tanya/async/transport.d | 2 | ||||
| -rw-r--r-- | source/tanya/async/watcher.d | 4 | ||||
| -rw-r--r-- | source/tanya/container/array.d | 3 | ||||
| -rw-r--r-- | source/tanya/container/buffer.d | 2 | ||||
| -rw-r--r-- | source/tanya/container/hashtable.d | 3 | ||||
| -rw-r--r-- | source/tanya/container/list.d | 3 | ||||
| -rw-r--r-- | source/tanya/container/set.d | 3 | ||||
| -rw-r--r-- | source/tanya/container/string.d | 3 | ||||
| -rw-r--r-- | source/tanya/conv.d | 10 | ||||
| -rw-r--r-- | source/tanya/exception.d | 4 | ||||
| -rw-r--r-- | source/tanya/format.d | 18 | ||||
| -rw-r--r-- | source/tanya/math/mp.d | 3 | ||||
| -rw-r--r-- | source/tanya/math/random.d | 2 | ||||
| -rw-r--r-- | source/tanya/net/uri.d | 2 | ||||
| -rw-r--r-- | source/tanya/network/package.d | 2 | ||||
| -rw-r--r-- | source/tanya/network/socket.d | 4 | ||||
| -rw-r--r-- | source/tanya/typecons.d | 6 |
25 files changed, 43 insertions, 57 deletions
diff --git a/source/tanya/async/event/epoll.d b/source/tanya/async/event/epoll.d index 718e5e8..291950e 100644 --- a/source/tanya/async/event/epoll.d +++ b/source/tanya/async/event/epoll.d @@ -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 diff --git a/source/tanya/async/event/iocp.d b/source/tanya/async/event/iocp.d index acd37a5..a32e04c 100644 --- a/source/tanya/async/event/iocp.d +++ b/source/tanya/async/event/iocp.d @@ -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; diff --git a/source/tanya/async/event/kqueue.d b/source/tanya/async/event/kqueue.d index 683befa..563601a 100644 --- a/source/tanya/async/event/kqueue.d +++ b/source/tanya/async/event/kqueue.d @@ -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 diff --git a/source/tanya/async/event/selector.d b/source/tanya/async/event/selector.d index 9e83261..1cc4515 100644 --- a/source/tanya/async/event/selector.d +++ b/source/tanya/async/event/selector.d @@ -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; /** diff --git a/source/tanya/async/iocp.d b/source/tanya/async/iocp.d index 2887c4a..26c99fe 100644 --- a/source/tanya/async/iocp.d +++ b/source/tanya/async/iocp.d @@ -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) diff --git a/source/tanya/async/loop.d b/source/tanya/async/loop.d index 3fba090..2c13397 100644 --- a/source/tanya/async/loop.d +++ b/source/tanya/async/loop.d @@ -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)
diff --git a/source/tanya/async/package.d b/source/tanya/async/package.d index 140206e..ef30b2d 100644 --- a/source/tanya/async/package.d +++ b/source/tanya/async/package.d @@ -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)
diff --git a/source/tanya/async/protocol.d b/source/tanya/async/protocol.d index 2795c16..035afaa 100644 --- a/source/tanya/async/protocol.d +++ b/source/tanya/async/protocol.d @@ -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)
diff --git a/source/tanya/async/transport.d b/source/tanya/async/transport.d index 108a295..c516ae2 100644 --- a/source/tanya/async/transport.d +++ b/source/tanya/async/transport.d @@ -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)
diff --git a/source/tanya/async/watcher.d b/source/tanya/async/watcher.d index b257b5b..9feb1df 100644 --- a/source/tanya/async/watcher.d +++ b/source/tanya/async/watcher.d @@ -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; /** diff --git a/source/tanya/container/array.d b/source/tanya/container/array.d index 1bad819..0afd2ac 100644 --- a/source/tanya/container/array.d +++ b/source/tanya/container/array.d @@ -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; diff --git a/source/tanya/container/buffer.d b/source/tanya/container/buffer.d index 1bb0c4d..c5e8327 100644 --- a/source/tanya/container/buffer.d +++ b/source/tanya/container/buffer.d @@ -14,7 +14,7 @@ */
module tanya.container.buffer;
-import tanya.memory;
+import tanya.memory.allocator;
import tanya.meta.trait;
version (unittest)
diff --git a/source/tanya/container/hashtable.d b/source/tanya/container/hashtable.d index 4df8af0..f458ca5 100644 --- a/source/tanya/container/hashtable.d +++ b/source/tanya/container/hashtable.d @@ -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; diff --git a/source/tanya/container/list.d b/source/tanya/container/list.d index bb1870c..279ebc4 100644 --- a/source/tanya/container/list.d +++ b/source/tanya/container/list.d @@ -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; diff --git a/source/tanya/container/set.d b/source/tanya/container/set.d index 3c9c362..7bfa6aa 100644 --- a/source/tanya/container/set.d +++ b/source/tanya/container/set.d @@ -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; diff --git a/source/tanya/container/string.d b/source/tanya/container/string.d index 4263b1c..383ee7c 100644 --- a/source/tanya/container/string.d +++ b/source/tanya/container/string.d @@ -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; diff --git a/source/tanya/conv.d b/source/tanya/conv.d index 13e9235..2efeda2 100644 --- a/source/tanya/conv.d +++ b/source/tanya/conv.d @@ -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) diff --git a/source/tanya/exception.d b/source/tanya/exception.d index b65efd1..e8b94af 100644 --- a/source/tanya/exception.d +++ b/source/tanya/exception.d @@ -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; diff --git a/source/tanya/format.d b/source/tanya/format.d index 5c63a5e..806fc1f 100644 --- a/source/tanya/format.d +++ b/source/tanya/format.d @@ -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; diff --git a/source/tanya/math/mp.d b/source/tanya/math/mp.d index 88a3fe6..f47177d 100644 --- a/source/tanya/math/mp.d +++ b/source/tanya/math/mp.d @@ -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; diff --git a/source/tanya/math/random.d b/source/tanya/math/random.d index 7423c23..8974d7b 100644 --- a/source/tanya/math/random.d +++ b/source/tanya/math/random.d @@ -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. diff --git a/source/tanya/net/uri.d b/source/tanya/net/uri.d index 00db019..6e72b45 100644 --- a/source/tanya/net/uri.d +++ b/source/tanya/net/uri.d @@ -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. diff --git a/source/tanya/network/package.d b/source/tanya/network/package.d index 185d27c..6437845 100644 --- a/source/tanya/network/package.d +++ b/source/tanya/network/package.d @@ -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) diff --git a/source/tanya/network/socket.d b/source/tanya/network/socket.d index 1b2d058..2bcab68 100644 --- a/source/tanya/network/socket.d +++ b/source/tanya/network/socket.d @@ -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; diff --git a/source/tanya/typecons.d b/source/tanya/typecons.d index 507cd3c..02f5e72 100644 --- a/source/tanya/typecons.d +++ b/source/tanya/typecons.d @@ -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; } |
