don't use .this in tcustomstrings.nim
This commit is contained in:
parent
aa1b575133
commit
14e236af05
1 changed files with 6 additions and 8 deletions
|
|
@ -13,18 +13,16 @@ type
|
||||||
len, cap: int
|
len, cap: int
|
||||||
data: ptr UncheckedArray[char]
|
data: ptr UncheckedArray[char]
|
||||||
|
|
||||||
{.this: self.}
|
|
||||||
|
|
||||||
var
|
var
|
||||||
allocCount, deallocCount: int
|
allocCount, deallocCount: int
|
||||||
|
|
||||||
proc `=destroy`*(self: var mystring) =
|
proc `=destroy`*(s: var mystring) =
|
||||||
if data != nil:
|
if s.data != nil:
|
||||||
dealloc(data)
|
dealloc(s.data)
|
||||||
inc deallocCount
|
inc deallocCount
|
||||||
data = nil
|
s.data = nil
|
||||||
len = 0
|
s.len = 0
|
||||||
cap = 0
|
s.cap = 0
|
||||||
|
|
||||||
proc `=sink`*(a: var mystring, b: mystring) =
|
proc `=sink`*(a: var mystring, b: mystring) =
|
||||||
# we hope this is optimized away for not yet alive objects:
|
# we hope this is optimized away for not yet alive objects:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue