summary refs log tree commit diff stats
path: root/tests/gc
Commit message (Expand)AuthorAgeFilesLines
* gc_regions: cleanup & fixes for deallocation (#11920)alaviss2020-08-171-0/+23
* Remove deprecated stuff from stdlib (#14699)Miran2020-06-171-1/+1
* new implementations for --gc:orc (#14121)Andreas Rumpf2020-04-271-1/+2
* faster CIs (#13803)Miran2020-03-303-10/+10
* save another 33s of CI for tests/gc/gcleak.nimTimothee Cour2020-02-271-1/+8
* CI tests run faster: save 120s in azure machines, 335s on local OSXTimothee Cour2020-02-271-1/+13
* revert changes to tests/gc/gcleak2.nimTimothee Cour2020-02-271-72/+5
* make CI tests faster + more preciseTimothee Cour2020-02-271-5/+72
* TlSF Alloctor: use less memory for --gc:arc (#13280)Andreas Rumpf2020-01-281-0/+2
* fixes #12899 (#12921)Andreas Rumpf2019-12-181-2/+2
* ARC: cycle detector (#12823)Andreas Rumpf2019-12-172-17/+29
* fixes a flaky test for the realtime GCAraq2019-11-281-3/+0
* 2018-01-142-21/+36
* fixArne Döring2017-07-241-1/+1
* Add ``tearDownForeignThreadGc`` function (#5369)Anatoly Galiulin2017-02-131-0/+88
* fixes #3184Andreas Rumpf2016-05-221-0/+457
* fixes #3793Andreas Rumpf2016-05-161-0/+37
* makes tests greenAndreas Rumpf2016-01-151-1/+1
* Added a test to check how gc works in emscripten.Andrey Sobolev2015-09-231-0/+59
* tests: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-046-173/+173
* Don't access GCed field in finalizer. Fixes #2305Yuriy Glukhov2015-08-241-8/+7
* renamed writeln to writeLine in testspatrick dw2015-06-191-14/+14
* increase limit for 64bit systemsAraq2015-02-101-1/+1
* fixes #2070Araq2015-02-101-0/+29
* cleaned up GC tests; fixes object variant re-assign bugAraq2015-02-101-1/+3
* fixes #1796Araq2015-01-053-3/+25
span> 'copy'): content = other._tree.copy() else: content = other._tree return type(self)(content) def set(self, keys, value, force=True): """Sets the element at the end of the path to <value>.""" if not isinstance(keys, (list, tuple)): keys = tuple(keys) if len(keys) == 0: self.replace(value) else: fnc = force and self.plow or self.traverse subtree = fnc(keys) subtree.replace(value) def unset(self, iterable): chars = list(iterable) first = True while chars: if first or isinstance(subtree, Tree) and subtree.empty(): top = chars.pop() subtree = self.traverse(chars) assert top in subtree._tree, "no such key: " + chr(top) del subtree._tree[top] else: break first = False def empty(self): return len(self._tree) == 0 def replace(self, value): if self.parent: self.parent[self.key] = value self._tree = value def plow(self, iterable): """Move along a path, creating nonexistant subtrees""" tree = self._tree last_tree = None char = None for char in iterable: try: newtree = tree[char] if not isinstance(newtree, dict): raise KeyError() except KeyError: newtree = dict() tree[char] = newtree last_tree = tree tree = newtree if isinstance(tree, dict): return type(self)(tree, parent=last_tree, key=char) else: return tree def traverse(self, iterable): """Move along a path, raising exceptions when failed""" tree = self._tree last_tree = tree char = None for char in iterable: last_tree = tree try: tree = tree[char] except TypeError: raise KeyError("trying to enter leaf") except KeyError: raise KeyError(repr(char) + " not in tree " + str(tree)) if isinstance(tree, dict): return type(self)(tree, parent=last_tree, key=char) else: return tree __getitem__ = traverse