Commit graph

380 commits

Author SHA1 Message Date
Justin Ethier
3fcd455189 Fixes to mark_stack_or_heap_obj
- Detect value types and return early
- Attempt to lock less often
2017-07-19 16:16:40 +00:00
Justin Ethier
4e5266a78d Do not gc_heap_align result of gc_allocated_bytes
This function already heap aligns it's return value so there is no need to use the alignment macro again.
2017-06-24 17:42:37 -04:00
Justin Ethier
e6d79fb63f Do a proper trace 2017-06-16 16:39:32 +00:00
Justin Ethier
c550b15f3a Issue #150 - Inefficient (but working) thread-join! 2017-06-17 01:36:47 -04:00
Justin Ethier
64be028166 Added gc_is_mutator_active() 2017-06-17 01:01:59 -04:00
Justin Ethier
5c1048bfe0 Avoid unnecessary call to gc_allocated_bytes 2017-06-12 17:57:47 -04:00
Justin Ethier
d02437a0c5 Reorder types in gc_move/gc_copy
Attempt to speed things up by moving more commonly-used objects up, and lesser-used ones down.
2017-06-11 16:57:38 -04:00
Justin Ethier
27970524c5 Generalization of globals_changed thread param 2017-06-09 17:17:01 +00:00
Justin Ethier
ea2550a882 Issue #199 - More efficient memory usage
Only use a single int on the heap to store the number of huge heap allocations. There is no need to track allocations on the other heaps, at least at this time.
2017-05-10 10:12:25 +00:00
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