diff options
author | WhiteDuke <Wh1teDuke@users.noreply.github.com> | 2018-03-16 15:55:00 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-03-16 15:55:00 +0100 |
commit | d56ca42b1ae06814077003e0f8fbb8f6d99c8afe (patch) | |
tree | 958da052e7abc1dd5ad047769187df3bbacbb758 /lib | |
parent | 37a3eb5170e2f6c9c0e6489bd40f1b4cd8200eb5 (diff) | |
download | Nim-d56ca42b1ae06814077003e0f8fbb8f6d99c8afe.tar.gz |
[Documentation] free -> dealloc (#7334)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/system.nim b/lib/system.nim index b71a3c73c..7a8c81666 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1774,7 +1774,7 @@ when not defined(nimscript): proc createU*(T: typedesc, size = 1.Positive): ptr T {.inline, benign.} = ## allocates a new memory block with at least ``T.sizeof * size`` ## bytes. The block has to be freed with ``resize(block, 0)`` or - ## ``free(block)``. The block is not initialized, so reading + ## ``dealloc(block)``. The block is not initialized, so reading ## from it before writing to it is undefined behaviour! ## The allocated memory belongs to its allocating thread! ## Use `createSharedU` to allocate from a shared heap. @@ -1789,7 +1789,7 @@ when not defined(nimscript): proc create*(T: typedesc, size = 1.Positive): ptr T {.inline, benign.} = ## allocates a new memory block with at least ``T.sizeof * size`` ## bytes. The block has to be freed with ``resize(block, 0)`` or - ## ``free(block)``. The block is initialized with all bytes + ## ``dealloc(block)``. The block is initialized with all bytes ## containing zero, so it is somewhat safer than ``createU``. ## The allocated memory belongs to its allocating thread! ## Use `createShared` to allocate from a shared heap. @@ -1807,7 +1807,7 @@ when not defined(nimscript): ## grows or shrinks a given memory block. If p is **nil** then a new ## memory block is returned. In either way the block has at least ## ``T.sizeof * newSize`` bytes. If ``newSize == 0`` and p is not - ## **nil** ``resize`` calls ``free(p)``. In other cases the block + ## **nil** ``resize`` calls ``dealloc(p)``. In other cases the block ## has to be freed with ``free``. The allocated memory belongs to ## its allocating thread! ## Use `resizeShared` to reallocate from a shared heap. |