Commit graph

371 commits

Author SHA1 Message Date
Justin Ethier
95e15dd3c2 Issue #199 - Initiate GC using huge GC alloc count
Free space does not work for huge heaps since often they are allocated on demand as a full page at a time. But if more than X huge pages have been allocated, it is probably a good time to initiate a major GC.
2017-05-09 23:01:44 +00:00
Justin Ethier
0d3ae68f87 Reorganize allocated_bytes to try to speed it up 2017-04-29 07:01:06 +00:00
Justin Ethier
3f75e8d231 Mark objects when collector cooperates
When the collector cooperates for a mutator it needs to mark any heap-collected objects that are stored within the mutator's data object. This prevents problems where these objects (which are essentially per-thread global roots) are incorrectly collected.
2017-03-16 14:07:36 +00:00
Justin Ethier
3b932ebfc5 WIP 2017-02-28 18:27:48 -05:00
Justin Ethier
b9253bb1d8 Added the rest of the docstrings 2017-02-28 00:07:31 -05:00
Justin Ethier
0dcbd5ecbb Added function docstrings 2017-02-27 22:23:57 -05:00
Justin Ethier
46ab172708 Added docs 2017-02-25 22:14:42 -05:00
Justin Ethier
4cfd1f06d8 Specify (void) 2017-02-24 12:59:20 -05:00
Justin Ethier
80290db8d5 Get rid of remaining sources of bignum leaks 2017-02-17 14:46:10 +00:00
Justin Ethier
876c1f0420 Cleanup, added gc_alloc_bignum() 2017-02-17 13:22:46 +00:00
Justin Ethier
b9c8d2abf4 WIP for libtommath 2017-02-08 18:33:20 -05:00
Justin Ethier
f58a44ebd0 At least for now, revert previous change
Only issue at the moment is compiler warnings on x86, which is not the primary target platform
2017-01-31 15:14:15 +00:00
Justin Ethier
2733a08f55 Fix compiler warnings on 32-bit x86 2017-02-01 00:45:14 -05:00
Justin Ethier
2b04c3b253 Set gc_cont and num args prior to blocking
This change shouldn't hurt anything and guarantees the collector thread is not trying to use gc_cont before it is set properly.
2017-01-30 14:24:57 +00:00
Justin Ethier
1e823c0d3f Issue #162 - Use platform-independent uintptr_t 2017-01-28 18:17:56 -05:00
Justin Ethier
981700af38 Remove errant semicolon 2017-01-28 17:54:35 -05:00
Justin Ethier
38ad580d33 Check return value of gc_heap_free() 2017-01-28 01:29:29 -05:00
Justin Ethier
5a25611934 Added to trace 2017-01-28 00:07:09 -05:00
Justin Ethier
8fa1bccd78 Finish heap merging, use separate heap locks 2017-01-28 00:01:01 -05:00
Justin Ethier
e30ff16b3d Added heap merge functions 2017-01-27 22:37:55 -05:00
Justin Ethier
8b530989ee Expose TODO for cleaning up old threads 2017-01-26 18:55:10 -05:00
Justin Ethier
54051ead86 Fixed up code so it builds now 2017-01-26 18:03:15 -05:00
Justin Ethier
1078c5ff27 Removed dead code 2017-01-26 23:54:42 -05:00
Justin Ethier
ce0bffb31a WIP 2017-01-26 23:45:46 -05:00
Justin Ethier
0d651d4ff7 Starting the heap changes
This leaves everything as a mess at the moment, there are still a lot of changes that need to be made.
2017-01-25 18:57:38 -05:00
Justin Ethier
befbced21c More merges from gc-opt3-dev 2017-01-24 22:19:08 -05:00
Justin Ethier
b637d13783 Merge or the worthwhile changes from gc-opt3-dev 2017-01-24 21:52:12 -05:00
Justin Ethier
33e55c3cce GC tweaks to avoid free/grow thrashing
Attempt to prevent thrashing the GC during earley benchmark by:

- Allowing a larger max page size
- Only freeing huge pages. This prevents thrashing where pages are freed only to be immediately reallocated when the heap is grown after sweep.

Longer term it may be necessary to allow freeing of pages by being more intelligent about things.
2017-01-12 14:37:48 +00:00
Justin Ethier
35b184e97d Added comment 2017-01-11 19:00:05 -05:00
Justin Ethier
649e0eb5c8 Inline gc_mark_globals
Force inlining to attempt to improve performance
2017-01-11 17:54:49 -05:00
Justin Ethier
5823b37b5d WIP 2017-01-11 18:45:28 +00:00
Justin Ethier
e6a145eeac Potential speedup?
Attempt to speed up gc_collector_mark_gray by forcing it to be inlined via a C macro. I am skeptical the compiler cannot do this already but the change seems to speed the earley benchmark up by several seconds.
2017-01-11 18:03:13 +00:00
Justin Ethier
2bee1575c0 Issue #118 - Added current-thread 2016-11-21 16:54:34 -05:00
Justin Ethier
97fa0c2dbd WIP 2016-11-19 05:35:25 +00:00
Justin Ethier
5810b7c035 Fix crash on 32-bit systems 2016-11-22 02:58:01 -05:00
Justin Ethier
063e5c8c73 Added comment, switch to >= 2016-11-11 02:07:30 +00:00
Justin Ethier
391051ba7b GC performance improvements
- Increase page size
- Cache last page that had an allocation, and start from that page next time, if possible. This speeds up allocation on large heaps because we can avoid searching through the whole heap each time.
2016-11-13 16:54:57 -05:00
Justin Ethier
4aec9a341f Added mem-streams module 2016-08-25 23:38:34 -04:00
Justin Ethier
4b7707e898 Cleanup 2016-08-11 17:57:40 -04:00
Justin Ethier
560667eef6 Only use 96-byte object heap on 64-bit platforms 2016-08-03 03:23:16 -04:00
Justin Ethier
4049304095 Added TODO 2016-08-03 00:11:48 -04:00
Justin Ethier
918e78cb21 Added another size heap (96 bytes) 2016-08-01 18:48:58 -04:00
Justin Ethier
ffb5b36869 WIP 2016-08-02 03:34:26 -04:00
Justin Ethier
352203bd32 Added additional debugging 2016-08-02 01:34:32 -04:00
Justin Ethier
dc8f4c02a1 Additional debug information 2016-08-01 21:06:35 -04:00
Justin Ethier
bd74d90100 Replace GC_DEBUG_PRINTFS with GC_DEBUG_TRACE 2016-07-30 19:13:23 -04:00
Justin Ethier
09807899d0 Fixes to debug code 2016-07-30 18:24:07 -04:00
Justin Ethier
facaf608ae Define gc_collector_mark_gray as static
This is a commonly used function that the C compiler may be able to better optimize, such as inline, now that it is guaranteed to only be used within the gc.c module.
2016-07-25 21:46:30 -04:00
Justin Ethier
d6f5a81f2d Fixed compiler warnings 2016-07-19 23:02:21 -04:00
Justin Ethier
1c0c0bb315 Change how mutations are stored in memory
Use a reallocated memory buffer instead of malloc'd pairs. This should speed things up by reducing the number of allocations and by keeping mutations in contiguous sections of memory.
2016-07-15 23:14:36 -04:00