| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
Table of contents regenerated with line numbers.
* HACKING-toc.txr: New file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
to spurious retention.
|
|
|
|
|
| |
Added something about mem_t *, and a few extra words here and there,
including a blurb about a Valgrind debugging caveat.
|
| |
|
| |
|
| |
|
|
|
|
| |
the Valgrind support at run-time, in addition to building it in.
|
| |
|
| |
|
|
|