Commit Graph

21 Commits

Author SHA1 Message Date
Joel Dice
630d9a165e fix GC crash for bootimage builds
In a bootimage=true build, we create allocate certain objects as
"immortal fixies", which means they will never been deallocated at
runtime and should only be visited if/when they point to objects which
might move during garbage collection.  However, there was a bug in the
following case:

 1. immortal fixie F is updated to point to a movable object M and
 thus F is added to the list of fixies to visit during the next minor
 collection (but not the next major one, since all reachable objects
 are visited during a major collection, and there's no point in
 visiting an unreachable object, whereas during a minor collection we
 have to visit F because we don't know if it's reachable or not)

 2. a major collection occurs, but F is not reachable and thus is not
 visited, whereas M is moved

 3. a minor collection occurs, and since F is still in the list, it is
 visited, but since it contains a stale pointer to M's old location,
 we crash

The solution is to ensure unreachable immortal fixies are removed from
the above list after each major collection, thus guaranteeing they
won't be visited on any subsequent collection.
2015-07-07 17:28:32 -06:00
Joel Dice
cbde34620c update copyright years 2015-03-13 12:52:59 -06:00
Joshua Warner
d248ad53b0 add initial cmake script (only builds parts of the code) 2014-07-24 09:36:40 -06:00
Joshua Warner
fa1e3d74c0 reduce Allocator interface 2014-07-16 18:51:29 -06:00
Joshua Warner
a1631c00f9 use size_t in Allocator 2014-07-16 18:10:51 -06:00
Joshua Warner
836cc41320 bulk, global reformat 2014-07-11 13:25:22 -06:00
Joshua Warner
7642b94308 reformat changes since master 2014-07-11 13:25:22 -06:00
Joshua Warner
263e349cae rename assert to assertT, to avoid conflict with std assert macro 2014-07-11 09:32:57 -06:00
Joel Dice
9b7d0d1624 update copyright years 2014-04-23 15:33:41 -06:00
Joshua Warner
5ffdfecdc2 remove vm from code paths, to match namespacing 2014-02-21 13:32:28 -07:00
Johannes Schindelin
18aeeae0e8 Implement Runtime#{free,total}Memory()
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-04 15:19:06 -06:00
Joel Dice
87b02eb949 update copyright years
Previously, I used a shell script to extract modification date ranges
from the Git history, but that was complicated and unreliable, so now
every file just gets the same year range in its copyright header.  If
someone needs to know when a specific file was modified and by whom,
they can look at the Git history themselves; no need to include it
redundantly in the header.
2013-07-02 20:52:38 -06:00
Joel Dice
3c44cdc50b fix unintentionally retained finalizables and improve low mem performance
Objects which are eligable for finalization must be retained until
after their finalize methods are called.  However, the VM must
determine the entire set of such objects before retaining any of them;
otherwise the process of retaining a given object may cause others to
become reachable and thus be considered ineligible for finalization
even though they are only reachable via other finalizable objects.
The end result of this mistake is that only a few of the objects which
are finalizable will be recognized at each GC cycle, so it requires
many such cycles to find them all, and if new objects become
finalizable at a faster rate, the VM will never catch up and
eventually run out of memory.

This patch fixes the above mistake and also includes tuning to
minimize the need for GC in low memory situations.
2013-03-07 20:32:02 -07:00
Joel Dice
585186f7d3 avoid allocating a new gen2 heap larger than the available heap capacity 2013-03-05 09:35:21 -07:00
Joel Dice
c6185c8034 remove "low memory" heuristic from heap code
The original goal was to minimize memory usage by garbage collecting
more frequently and more comprehensively as we got closer to the heap
limit.  In practice, though, this just slowed the VM to a crawl as
memory pressure increased.  If an app really wants to use a lot of
memory, the VM shouldn't penalize it aside from throwing an
OutOfMemoryError if it exceeds the limit.
2013-03-04 16:02:59 -07:00
Joel Dice
5e2d00010b move headers from src to src/avian
This is necessary to avoid name conflicts on various platforms.  For
example, iOS has its own util.h, and Windows has a process.h.  By
including our version as e.g. "avian/util.h", we avoid confusion with
the system version.
2013-02-27 13:33:29 -07:00
Joshua Warner
f17b8cef08 move system.h to include 2013-02-20 20:42:09 -07:00
Joshua Warner
24ff91c229 move heap.h to include 2013-02-20 10:23:20 -07:00
Joshua Warner
52b2fd74ef move math functions out of common.h, and into include/avian/util/math.h 2013-02-20 07:51:57 -07:00
Joshua Warner
263c0dee4f move abort.h to include, add namespacing 2013-02-19 22:51:38 -07:00
Joshua Warner
a3fb540ec3 add ArchitecturePlanTest 2013-02-15 07:35:17 -07:00