summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-10-08 23:38:22 +0800
committerGitHub <noreply@github.com>2022-10-08 17:38:22 +0200
commit5e4dd571d43c904c989c1a256f53df38672a20fe (patch)
tree575e2a107177d11d93266bddd07c5d25a8c585a5 /lib
parente83f27e6a0f52f167e8eb91cd8f60be62d6725c6 (diff)
downloadNim-5e4dd571d43c904c989c1a256f53df38672a20fe.tar.gz
fixes #20516; system.create doesn't work with bitfield objects (#20518)
* Revert "fixes #19000 (#19032)"

This reverts commit 2bda4a30a6b12dd0840dc347e454e54fe26721e7.

* fixes #20516; add testcase
Diffstat (limited to 'lib')
-rw-r--r--lib/system/memalloc.nim6
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/system/memalloc.nim b/lib/system/memalloc.nim
index 49766e69d..f8ebc8c5f 100644
--- a/lib/system/memalloc.nim
+++ b/lib/system/memalloc.nim
@@ -116,9 +116,6 @@ when hasAlloc and not defined(js):
     ##
     ## See also:
     ## * `create <#create,typedesc>`_
-    static:
-      when sizeof(T) <= 0:
-        {.fatal: "createU does not support types T where sizeof(T) == 0".}
     cast[ptr T](alloc(T.sizeof * size))
 
   template alloc0*(size: Natural): pointer =
@@ -144,9 +141,6 @@ when hasAlloc and not defined(js):
     ##
     ## The allocated memory belongs to its allocating thread!
     ## Use `createShared <#createShared,typedesc>`_ to allocate from a shared heap.
-    static:
-      when sizeof(T) <= 0:
-        {.fatal: "create does not support types T where sizeof(T) == 0".}
     cast[ptr T](alloc0(sizeof(T) * size))
 
   template realloc*(p: pointer, newSize: Natural): pointer =