diff options
author | cooldome <ariabushenko@gmail.com> | 2020-10-19 13:50:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 14:50:06 +0200 |
commit | 833035bacd91c2cf16ea006b64bf996e87eac75d (patch) | |
tree | bb98c19200566e1a4ac4a9ad1c55916adaa6e1a5 /compiler | |
parent | 67afe72e9caa8df435738c9011135d7053e01eb2 (diff) | |
download | Nim-833035bacd91c2cf16ea006b64bf996e87eac75d.tar.gz |
arc allocation method aligned (#15588)
* progress * fix typo
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ccgexprs.nim | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index c1469fa60..004b8f41e 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2180,17 +2180,25 @@ proc genDestroy(p: BProc; n: PNode) = of tyString: var a: TLoc initLocExpr(p, arg, a) - linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" & - " #deallocShared($1.p);$n" & - "}$n", - [rdLoc(a)]) + if optThreads in p.config.globalOptions: + linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" & + " #deallocShared($1.p);$n" & + "}$n", [rdLoc(a)]) + else: + linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" & + " #dealloc($1.p);$n" & + "}$n", [rdLoc(a)]) of tySequence: var a: TLoc initLocExpr(p, arg, a) - linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" & - " #deallocShared($1.p);$n" & - "}$n", - [rdLoc(a), getTypeDesc(p.module, t.lastSon)]) + if optThreads in p.config.globalOptions: + linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" & + " #deallocShared($1.p);$n" & + "}$n", [rdLoc(a)]) + else: + linefmt(p, cpsStmts, "if ($1.p && !($1.p->cap & NIM_STRLIT_FLAG)) {$n" & + " #dealloc($1.p);$n" & + "}$n", [rdLoc(a)]) else: discard "nothing to do" else: let t = n[1].typ.skipTypes(abstractVar) |