summaryrefslogtreecommitdiffstats
path: root/HACKING
Commit message (Collapse)AuthorAgeFilesLines
* HACKING: typoReini Urban2016-05-051-1/+1
|
* Fix incorrect example and add one more approach.Kaz Kylheku2015-09-021-12/+38
| | | | | | | | HACKING: Fix wrong make_foo example which violates Rule One, by registering an uninitialized struct as a cobj handle, thereby making garbage traversable by gc. Also show alternative solution to the problem based on extending variable liveness via gc_hint.
* Correction to COBJ initialization pattern.Kaz Kylheku2015-07-301-42/+69
| | | | | | | | | | | | | In fact, the previosuly documented process is not correct and still leaves a corruption problem under generational GC (which has been the default for some time). * HACKING: Document flaw in the initialization pattern previously thought to be correct, and show fix. * hash.c (copy_hash): Fix instance of incorrect pattern. * regex.c (regex_compile): Likewise.
* * HACKING: Restore accidentally deleted document title.Kaz Kylheku2015-07-301-0/+5
|
* Fix for LLVM wchar_t literals not being four byteKaz Kylheku2015-01-121-26/+31
| | | | | | | | | | | | | | | | | aligned, affecting OS X port. * configure: Detect a SIZEOF_WCHAR_T when detecting integer type that will hold a pointer. In the lit_align test, if we are on Apple Mac OSX, use a lit_align of 2, so the logic kicks in for padding literals and handling misalignment. * lib.h (litptr): Add a case for LIT_ALIGN < 4 and SIZEOF_WCHAR_T == 4. In this case we do the arithmetic on the pointer using short *, and then convert to wchar_t. * HACKING: New section 2.4.3 about new wchar_t hack.
* Implementing finalization hooks.Kaz Kylheku2014-10-301-47/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | * gc.c (struct fin_reg): New struct type. (final_list, final_tail, mark_makefresh): New static variables. (mark_obj): Under generational GC, if make_makefresh is in effect, set the generation to -1 on all marked objects. (sweep_one): In an EXTRA_DEBUGGING build, call breakpt if the object being swept is the one in break_obj. Under generational GC, place reachable objects that are in generation -1 the freshobj nursery and assign them to generation 0, rather than sticking them into the mature generation 1. (sweep): Under generational gc, reset the freshobj_idx variable here, so that sweep_one has an empty nursery in which to place the generation -1 objects. (prepare_finals, call_finals): New static functions. (gc): Call prepare_finals before sweep, and call call_finals just before re-enabling GC and returning. Do not reset freshobj_idx to zero; this was done in sweep, which may have added entries into it. (gc_finalize): New function. (gc_late_init): Register gc_finalize as intrinsic function finalize. * txr.1: Documented finalize. * HACKING: Documented finalization, described the additional meaning of the -1 generation, and added a section on debugging with break_obj and breakpt.
* * HACKING: New section Type Safety.Kaz Kylheku2014-10-171-35/+81
| | | | | | Table of contents regenerated with line numbers. * HACKING-toc.txr: New file.
* * HACKING: Updating generational GC notes in light of changes.Kaz Kylheku2014-03-291-34/+43
|
* Fix a bug arising from putting generation 1 objects into theKaz Kylheku2014-03-271-15/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | checkobj array (via the mut macro that expands to gc_mutated). The garbage collector assumes that checkobj has only generation 0 objects, which all exist in the freshobj array, which is subject to a sweep. So gen 1 objects in checkobj are never cleaned up properly: they do not have their REACHABLE flag reset, or their generation restored to 1. To fix this, a new array for these objects is introduced separate from checkobj. * gc.c (MUTOBJ_VEC_SIZE): New preprocessor symbol. (mutobj, mutobj_idx): New static array and integer. (mark_obj): Check for REACHABLE flag before checking the full_gc flag and generation, since those cost additional memory accesses. (mark): Mark the objects in the new mutobj array. (sweep): Sweep the objects in the mutobj array. (gc): Reset mutobx_idx to zero after gc. (gc_set): Rearrange logic. In the case that the checkobj array is full and a gc is done to make room, there is no point in adding to the array: the gc pass moves all babies to generation 1, so the object that was passed into the function is no longer a baby. (gc_mutated): Rewrite in terms of mutobj rather than checkobj, fixing the bug. * HACKING: Improved documentation of GC. Describe mut macro and mutobj array.
* Fixed occurrences of "garbage allocator". :)Kaz Kylheku2013-12-101-4/+5
|
* Spellcheck.Kaz Kylheku2013-12-051-17/+17
|
* * HACKING: Added notes on generational garbage collection.Kaz Kylheku2012-04-141-0/+110
|
* * configure: Switch from _POSIX_C_SOURCE=2 to _XOPEN_SOURCE.Kaz Kylheku2012-04-101-4/+4
| | | | | | | | We will be relying on the gettimeofday function which only came into POSIX in 2001, but was in Unix long before then. * HACKING: Replace notes about -D_POSIX_C_SOURCE which are not true any more.
* * HACKING: Added note about register save areas, which can contributeKaz Kylheku2012-02-121-1/+3
| | | | to spurious retention.
* * HACKING: Grammar fixes. Expanded on lazy strings a little bit.Kaz Kylheku2011-10-291-35/+68
| | | | | Added something about mem_t *, and a few extra words here and there, including a blurb about a Valgrind debugging caveat.
* Fix section numbering mixup.Kaz Kylheku2011-10-101-2/+2
|
* * HACKING: Documented portability hacks for narrow wchar_t.Kaz Kylheku2011-10-101-1/+59
|
* * HACKING: Formatting.Kaz Kylheku2011-10-081-8/+10
|
* HACKING: Clarified that --vg-debug is also needed to turn on onKaz Kylheku2011-10-011-2/+4
| | | | the Valgrind support at run-time, in addition to building it in.
* * HACKING: Updated with debugging hints.Kaz Kylheku2011-09-301-4/+210
|
* Spelling.Kaz Kylheku2011-09-201-2/+2
|
* This should be under version control.Kaz Kylheku2011-09-011-0/+516