Commit Graph

16 Commits (master)

Author SHA1 Message Date
Björn Lindqvist 7661ed3b57 VM: replacing the copy assignment operators of the smart pointers
Little more to write, but much easier to see what is going on with
methods rather than assignment operator overloading.
2016-11-23 06:42:06 +01:00
Björn Lindqvist 2095fd57de VM: FACTOR_ASSERT so that data_root never wraps a null pointer, cause if it does, random crashes can happen 2014-11-17 17:27:36 -08:00
Björn Lindqvist 8741dbefce VM: bignum_roots traversal code deleted! 2014-11-17 17:27:35 -08:00
Björn Lindqvist 441a4595bb VM: the copy assignment operator is overloaded so you need a custom swap 2014-11-17 17:27:34 -08:00
Björn Lindqvist b90e52b527 VM: GC_BIGNUM must be called in the same scope as the variable declaration 2014-09-17 12:13:05 -07:00
Björn Lindqvist a6e0867b22 VM: change type of bignum_roots and remove unnecessary not-null checks
Declaring bignum_roots to contain bignum** instead of cell avoids some
superfluous casts. Casting it to cell is wrong because the items in it
are never tagged. And due to a earlier commit, bignum_roots will never
contain NULL:s so checking for them is not needed.
2014-06-12 13:50:10 -07:00
Björn Lindqvist 0c9e61ca99 VM: refactoring that removes data_root_ranges
instead of storing data_root_ranges in data_roots, you can just store
cell pointers directly. the advantage with doing it that way is that
registration and traversal code becomes simpler (and slightly faster).
2014-06-12 13:50:10 -07:00
Erik Charlebois ffe41b3d7f VM: Fixup cast formatting after clang-format
clang-format doesn't recognize casts to non-pointer/non-template types
so it winds up adding a space between the right paren and the expression
and then failing to recognize prefix operators in the process
(e.g. foo = (cell) & bar; should be foo = (cell)&bar;). This commit
manually fixes up the major cases (fixnum, cell, all types ending in _t).
2013-05-13 14:59:24 -04:00
Erik Charlebois b918c3e646 VM: Remove redundant #ifdef FACTOR_DEBUGs
FACTOR_DEBUG checks around asserts aren't needed, since FACTOR_ASSERT is
already conditionally defined by FACTOR_DEBUG.
2013-05-12 23:44:32 -04:00
Erik Charlebois 7b1b1eef23 VM: Remove unnecessary _ suffix in constructors 2013-05-12 23:20:43 -04:00
Erik Charlebois 26ff071205 VM: Remove unnecessary explicit keywords 2013-05-12 21:48:38 -04:00
Erik Charlebois 7a05bf1993 VM: Refactor data_roots.hpp to Factor style 2013-05-12 13:24:43 -04:00
Joe Groff 0a1a252cdb vm: replace assert with FACTOR_ASSERT
Factor is finally a real C++ project and has a custom assert macro. Assertion failures were still getting caught as exceptions and causing failure loops. Write our own macro that calls factor::abort on failure.
2011-11-23 11:11:26 -08:00
Slava Pestov 11075828e5 vm: faster data_root and <array> primitive 2009-11-06 05:30:37 -06:00
Slava Pestov e2107166ff vm: restructure data_roots so that its a sequence of handle/len pairs rather than just handles, use it in inline_gc() and all_instances() so that we don't run out of heap while building the object array 2009-11-06 00:54:28 -06:00
Slava Pestov 68217016d0 vm: add two missing files 2009-11-02 18:11:12 -06:00