make malloc.nim consistent in style (#14427)
This commit is contained in:
parent
149251cab9
commit
f7b73e6bfd
1 changed files with 9 additions and 9 deletions
|
|
@ -7,13 +7,13 @@ proc allocImpl(size: Natural): pointer =
|
|||
proc alloc0Impl(size: Natural): pointer =
|
||||
c_calloc(size.csize_t, 1)
|
||||
|
||||
proc reallocImpl(p: pointer, newsize: Natural): pointer =
|
||||
proc reallocImpl(p: pointer, newSize: Natural): pointer =
|
||||
c_realloc(p, newSize.csize_t)
|
||||
|
||||
proc realloc0Impl(p: pointer, oldsize, newsize: Natural): pointer =
|
||||
result = realloc(p, newsize.csize_t)
|
||||
if newsize > oldsize:
|
||||
zeroMem(cast[pointer](cast[int](result) + oldsize), newsize - oldsize)
|
||||
proc realloc0Impl(p: pointer, oldsize, newSize: Natural): pointer =
|
||||
result = realloc(p, newSize.csize_t)
|
||||
if newSize > oldSize:
|
||||
zeroMem(cast[pointer](cast[int](result) + oldSize), newSize - oldSize)
|
||||
|
||||
proc deallocImpl(p: pointer) =
|
||||
c_free(p)
|
||||
|
|
@ -27,11 +27,11 @@ proc allocSharedImpl(size: Natural): pointer =
|
|||
proc allocShared0Impl(size: Natural): pointer =
|
||||
alloc0Impl(size)
|
||||
|
||||
proc reallocSharedImpl(p: pointer, newsize: Natural): pointer =
|
||||
reallocImpl(p, newsize)
|
||||
proc reallocSharedImpl(p: pointer, newSize: Natural): pointer =
|
||||
reallocImpl(p, newSize)
|
||||
|
||||
proc reallocShared0Impl(p: pointer, oldsize, newsize: Natural): pointer =
|
||||
realloc0Impl(p, oldsize, newsize)
|
||||
proc reallocShared0Impl(p: pointer, oldsize, newSize: Natural): pointer =
|
||||
realloc0Impl(p, oldSize, newSize)
|
||||
|
||||
proc deallocSharedImpl(p: pointer) = deallocImpl(p)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue