diff options
author | Zahary Karadjov <zahary@gmail.com> | 2012-06-06 18:34:35 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2012-06-06 19:11:52 +0300 |
commit | d10b524c9a52c1d13ca175ac9781c85fad22b0f7 (patch) | |
tree | f8ce522ecb4cd01eadeb9d77905a5350696cf084 /lib/system | |
parent | 41a9a941ab627acb413f067a38406d7908dbd364 (diff) | |
download | Nim-d10b524c9a52c1d13ca175ac9781c85fad22b0f7.tar.gz |
generate default destructors
Diffstat (limited to 'lib/system')
-rwxr-xr-x | lib/system/assign.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/system/assign.nim b/lib/system/assign.nim index 59c44a6cc..f29dc547c 100755 --- a/lib/system/assign.nim +++ b/lib/system/assign.nim @@ -139,6 +139,10 @@ proc objectInit(dest: Pointer, typ: PNimType) = # ---------------------- assign zero ----------------------------------------- +proc nimDestroyRange*[T](r: T) = + # internal proc used for destroying sequences and arrays + for i in countup(0, r.len - 1): destroy(r[i]) + proc genericReset(dest: Pointer, mt: PNimType) {.compilerProc.} proc genericResetAux(dest: Pointer, n: ptr TNimNode) = var d = cast[TAddress](dest) |