diff options
author | Juan Carlos <juancarlospaco@gmail.com> | 2020-06-30 14:09:13 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 19:09:13 +0200 |
commit | 05384efec53256d8917a80d1117d8f822a8a2f55 (patch) | |
tree | a89b82f12209bb86ad51adfb0e3b9bae2d1fb73f | |
parent | a519f3b03878e8525a26d726921a58fed6ec94a0 (diff) | |
download | Nim-05384efec53256d8917a80d1117d8f822a8a2f55.tar.gz |
Clean out sharedtables (#14858)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | lib/pure/collections/sharedtables.nim | 10 |
2 files changed, 1 insertions, 10 deletions
diff --git a/changelog.md b/changelog.md index 35c701a8a..f32d6f19f 100644 --- a/changelog.md +++ b/changelog.md @@ -185,6 +185,7 @@ proc mydiv(a, b): int {.raises: [].} = - Added the `thiscall` calling convention as specified by Microsoft, mostly for hooking purpose - Deprecated `{.unroll.}` pragma, was ignored by the compiler anyways, was a nop. +- Remove `sharedtables.initSharedTable`, was deprecated and produces undefined behavior. - Removed `asyncdispatch.newAsyncNativeSocket`, was deprecated since `0.18`. - Remove `dom.releaseEvents` and `dom.captureEvents`, was deprecated. diff --git a/lib/pure/collections/sharedtables.nim b/lib/pure/collections/sharedtables.nim index 23b653c82..abef89507 100644 --- a/lib/pure/collections/sharedtables.nim +++ b/lib/pure/collections/sharedtables.nim @@ -225,13 +225,3 @@ proc init*[A, B](t: var SharedTable[A, B], initialSize = 64) = proc deinitSharedTable*[A, B](t: var SharedTable[A, B]) = deallocShared(t.data) deinitLock t.lock - -proc initSharedTable*[A, B](initialSize = 64): SharedTable[A, B] {.deprecated: - "use 'init' instead".} = - ## This is not posix compliant, may introduce undefined behavior. - assert isPowerOfTwo(initialSize) - result.counter = 0 - result.dataLen = initialSize - result.data = cast[KeyValuePairSeq[A, B]](allocShared0( - sizeof(KeyValuePair[A, B]) * initialSize)) - initLock result.lock |