summary refs log blame commit diff stats
path: root/lib/system/seqs_v2_reimpl.nim
blob: 09b7e7ac4815dc5309727c7a3b5717d52e86ea86 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                   






                                                           
#
#
#            Nim's Runtime Library
#        (c) Copyright 2020 Nim contributors
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

type
  NimSeqPayloadReimpl = object
    cap: int
    data: pointer

  NimSeqV2Reimpl = object
    len: int
    p: ptr NimSeqPayloadReimpl

template frees(s: NimSeqV2Reimpl) =
  if s.p != nil and (s.p.cap and strlitFlag) != strlitFlag:
    when compileOption("threads"):
      deallocShared(s.p)
    else:
      dealloc(s.p)