summaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* * gc.c (FRESHQ_SIZE): Preprocessor symbol renamed to FRESHOBJ_VEC_SIZE.Kaz Kylheku2012-04-051-4/+4
| | | | (freshobj, make_obj): Object and function definitions follow rename.
* * gc.c (mark_obj, sweep_one, gc_is_reachable): Check for gen > 0 ratherKaz Kylheku2012-04-051-3/+5
| | | | | | | | | than gen == 0. This allows gen == -1 objects to be considered the same as gen == 0, and traversed. (gc_set, gc_mutated): When a gen 0 object is added to the checkobj array, set its generation to -1. This prevents duplicates in the checkobj array. Also, it fixes a bug: an vector marked as mutated was not being traversed due to being in generation 1.
* Code cleanup and tweaking.Kaz Kylheku2012-04-051-24/+23
| | | | | | | | | | | | | | | | | | | | | | | * gc.c (BACKPTR_VEC_SIZE): Preprocessor symbol renamed to CHECKOBJ_VEC_SIZE. (FULL_GC_INTERVAL): Increased to 40 since the modified algorithm now leaves less work for the full gc to do. (backptr, backptr_idx): Static variables renamed to checkobj and checkobj_idx. (mark): Follows rename of backptr and backptr_idx. (gc): Commented out handy printf added. (gc_set): Use in_malloc_range check to avoid adding to the check array pointers which are being stored in non-heap locations, since non-heap locations are already GC roots. (gc_mutated): Follows variable renaming. (gc_push): Just do the push using gc_set. * lib.c (malloc_low_bound, malloc_high_bound): New variables. (chk_malloc, chk_calloc, chk_realloc): Updated malloc_low_bound and malloc_high_bound. (in_malloc_range): New function. * lib.h (in_malloc_range): Declared.
* Bunch of fixes.Kaz Kylheku2012-04-051-2/+2
| | | | | | | | | | | | | | | | | * gc.c (gc_mutated): Return the value. * gc.h (gc_mutated): Declaration updated. * hash.c (remhash): Fix unsafe assignment to use set macro. * lib.c (sort): Fix wrong use of mut macro on the list before it is sorted rather than after. * lib.h (mut): Trivial version of macro updated to return argument. * unwind.c (uw_init): The toplevel environment's match_context should be gc_protected. Though this is probably not used, which is why it has not been a problem.
* * configure (gen_gc): Default to off.Kaz Kylheku2012-04-041-0/+8
| | | | | | Help section added for gen_gc variable. * gc.c (gc): Some missing CONFIG_GEN_GC added.
* Code cleanup.Kaz Kylheku2012-04-041-67/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gc.c (backptr_oflow): Static variable removed. (freshq_head, freshq_tail, partial_gc_count): Static variables removed. (freshq): Array renamed to freshobj. (full): Variable renamed to full_gc. (freshobj_idx): New varaible. (make_obj): Add newly born objects to freshobj array rather than freshq. If freshobj array is full on entry to this function, trigger gc to empty it. make_obj no longer updates the free_tail; the gc routine takes care of restoring this invariant. (mark_obj): Follows rename of full_gc. Some code was not wrapped in #if CONFIG_GEN_GC. (mark, sweep_one): Follow rename of full_gc. (sweep): On entry, restore free_tail invariant in the empty free_list case. Code which processes freshq from tail to head replaced by simple array walk of freshobj. Code wrapped properly in #if CONFIG_GEN_GC. (gc): Logic for triggering full gc simplified. Check added for situations when a partial gc is called when the free list empties, and it doesn't liberate enough memory. This prevents the situation of partial gc being called over and over again by make_obj, squeezing less and less memory each time until finally it returns 0 objects, and more() is called. (gc_is_reachable): Follows rename of full_gc, and #if CONFIG_GEN_GC added. (gc_set, gc_mutated): Simplified. Check if the backptr array is full and trigger gc if so to flush it, then just add to the array.
* Performance tweaking and fixes.Kaz Kylheku2012-04-031-4/+7
| | | | | | | | | | | * gc.c (BACKPTR_VEC_SIZE): Increase greatly, so that we don't trigger gc due to overflow of the backptr array. This is not likely to yield a lot of free objects except in a full GC. (FULL_GC_INTERVAL): From 10 to 20. (gc): Take a not of whether or not gc was entered with free_list being exhausted or not. Call more() only if the free_list was empty, and a full sweep was done. Reset partial_gc_count only when a full gc is triggered.
* Generational GC showing signs of working. One test case inKaz Kylheku2012-04-031-77/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test suite fails. * gc.c (FRESHQ_SIZE): New preprocessor symbol. (backptr_oflow, freshq, freshq_head, freshq_tail): New static variables. (make_obj): Place newly allocated generation 0 object into freshq. If freshq becomes full, transfer oldest item into generation 1. (mark_obj): If doing only a partial gc, then do not mark objects which are not generation 0. (mark_mem_region): Valgrind support: cannot mark t.type field undefined because it is a bitfield. Just mark the first SIZEOF_PTR bytes of the object defined. (mark): Under partial gc, mark the table of back pointers. (sweep_one): New static function from the prior guts of sweep. Reachable objects now get promoted to generation 1. (sweep): Under partial gc, sweep just the freshq which identifies the generation 0 objects, rather than the entire linked list of all the heaps. (gc): Trigger full gc also if the backptr list has overflowed due to gc having been disabled. Under generational gc, reset the static variables afterward: clear the list of backpointers, and the freshq. (gc_is_reachable): Under partial gc, report any mature object as reachable. (gc_set, gc_mutated): Handle backptr array overflow situation when gc is disabled. (gc_push): Bugfix: it is the newly pushed cons cell that has to be marked as a root, not the value being pushed. * hash.c (sethash): Use set macro for storing value. * lib.h (set, mut, mpush): Fix wrong-way #if test for these macros. The trivial versions were being defined uner CONFIG_GEN_GC and vice versa!
* * eval.c (op_modplace): push replaced with mpush (mutating push).Kaz Kylheku2012-04-031-0/+6
| | | | | | | | | | | | | | | * gc.c (gc_push): New function. * gc.h (gc_push): Declared. * hash.c (pushhash): Use mpush. * lib.c (push): Reverted to unsafe operation. TODO comment replaced with warning. (lazy_flatten_scan): push occurence commented as safe. (lazy_stream_func): Unsafe push replaced with mpush. * lib.h (mpush): New macro.
* * configure: Support a gen-gc configuration variable whichKaz Kylheku2012-04-031-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | causes CONFIG_GEN_GC to be defined as 1 in config.h. * eval.c (op_defvar, dwim_loc, op_modplace, transform_op): Handle mutating assignments via set macro. (op_dohash): Inform gc about mutated variables. TODO here. * filter.c (trie_add, trie_compress): Handle mutating assignments via set macro. * gc.c (BACKPTR_VEC_SIZE, FULL_GC_INTERVAL): New preprocessor symbols. (backptr, backptr_idx, partial_gc_count, full): New static variables. (make_obj): Initialize generation to zero. (gc): Added logic for deciding between full and partial gc. (gc_set, gc_mutated): New functions. * gc.h (gc_set, gc_mutated): Declared. * hash.c (hash_mark): Changed useless use of vecref_l to vecref. (gethash_f): Use set when assigning through *found since it is a possible mutation. * lib.c (car_l, cdr_l, vecref_l): Got rid of loc macro uses. Using the value properly is going to be the caller's responsibility. (push): push may be a mutation, so use set. (intern): Uset set to mutate a hash entry. (acons_new_l, aconsq_new_l): Use set when replacing *list. * lib.h (PTR_BIT): New preprocessor symbol. (obj_common): New macro for defining common object fields. type_t is split into two bitfields, half a pointer wide, allowing for generation to be represented. (struct any, struct cons, struct string, struct sym, struct package, struct func, struct vec, struct lazy_cons, struct cobj, struct env, struct bignum, struct flonum): Use obj_common macro to defined common fields. (loc): Macro removed. (set, mut): Macros conditionally defined for real functionality. (list_collect, list_collect_nconc, list_collect_append): Replace mutating operations with set. * match.c (dest_set, v_cat, v_output, v_filter): Replace mutating operations with set. * stream.c (string_in_get_line, string_in_get_char, strlist_out_put_string, strlist_out_put_char): Replace mutating operations with set. * unwind.c (uw_register_subtype): Replace mutating operation with set.
* Performance improvement in the GC: keep at least one heap's worthKaz Kylheku2012-03-241-4/+9
| | | | | | | | | | | | | of free space, so programs close to exhausting a heap do not waste cycles frequently calling the collector. * gc.c (more): Do not assert that free_list is null; this will not be the case any more. (make_obj): Comment added regarding why we the free_tail variable is fixed up. (sweep): Now returns a count of the objects that are free. (gc): If sweep reports that less than 75% of the objects are free then let us add another heap.
* * configure (uintptr): New variable. Indicates whether unsignedKaz Kylheku2012-03-191-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | version of intptr_t is available and should be generated in config.h as uintptr_t. * eval.c (eval_init): New intrinsic functions floatp, integerp, flo-str. * gc.c (finalize): Handle FLNUM case. Rearranged cases so that all trivially returning cases are together. (mark): Handle FLNUM case. * hash.c (hash_double): New function. (equal_hash): Handle FLNUM via hash_double. (eql_hash): Likewise. * lib.c: <math.h> is included. (float_s): New symbol variable. (code2type, equal): Handle FLNUM case in switch. (integerp): New function; does the same thing as integerp before. (numberp): Returns t for floats. (flo, floatp, flo_str): New functions. (obj_init): Initialize new float_s variable. (obj_print, obj_pprint): Handle FLNUM case in switch. Printing does not work yet; needs work in stream.c. * lib.h (enum type): New enumeration FLNUM. (struct flonum): New struct type. (union obj): New member, fl. (float_s, flo, floatp, integerp, flo_str): Declared. * parser.l (FLO): New token pattern definition. Scans to a NUMBER token. Corrected uses of yylval.num to yylval.val. * parser.y (%union): Removed num member from yystype.
* Changing type function to not blow up on nil, which makes a lot of codeKaz Kylheku2012-03-171-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | simpler. A pseudo type code is introduced called NIL with value 0. * lib.h (enum type): New enumeration value, NIL. (type): Function accepts object nil and maps it to code NIL. * eval.c (dwim_loc, op_dwim): test for nil obj and goto hack is gone, just handle NIL in the switch. * gc.c (make_obj, mark): Handle new NIL type code in switch. * hash.c (equal_hash): Handle NIL in the switch instead of nil test. * lib.c (code2type): Map new NIL type code to null. (typeof, typecheck): Code simplified. (class_check, car): Move nil test into switch. (eql, equal, consp, bignump, stringp, lazy_stringp, symbolp, functionp, vectorp, cobjp): Simplified. (length, sub, ref, refset, replace, obj_print, obj_pprint): Handle NIL in switch instead of nil test. goto hack removed from refset. * match.c (do_match_line, do_output_line): switch condition simplified. * regex.c (regexp): Simplified. (regex_nfa): Assert condition simplified.
* * arith.c: Updated copyright year.Kaz Kylheku2012-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * arith.h: Likewise. * debug.c: Added copyright header. * debug.h: Updated copyright year. * eval.c: Likewise. * eval.h: Likewise. * filter.c: Likewise. * filter.h: Likewise. * gc.c: Likewise. * gc.h: Likewise. * hash.c: Likewise. * hash.h: Likewise. * lib.c: Likewise. * lib.h: Likewise. * match.c: Likewise. * match.h: Likewise. * parser.h: Likewise. * regex.c: Likewise. * regex.h: Likewise. * stream.c: Likewise. * stream.h: Likewise. * txr.c: Likewise, and e-mail address. * txr.h: Updated copyright year. * unwind.c: Likewise. * unwind.h: Likewise.
* Introducing optional arguments.Kaz Kylheku2012-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * debug.c (help, show_bindings): put_string arguments reversed. * eval.c (bind_args): Support colon notation in interpreted function lambda lists for optional arguments. Improved error checking. (apply): Allow optional arguments to be left out. (dwim_loc): Reversed arguments to replace_str, replace_vec, replace_list. (eval_init): Numerous intrinsics now have arguments that are optional. New function rand introduced which reverses arguments relative to random. New intrinsic function hash introduced for alternative construction of hashes. * gc.c (sweep): Reversed arguments to put_char. * hash.c (weak_keys_k, weak_vals_k, equal_based_k): New keyword symbol variables. (hashv): New function. (hash_init): Intern new symbols. * hash.h (weak_keys_k, weak_vals_k, equal_based_k, hashv): Declared. * lib.c (colon_k): New keyword symbol variable. (replace_list, replace_str, replace_vec): Arguments rearranged. (tree_find): testfun becomes optional argument. (int_str): base becomes optional argument. (func_f0, func_f1, func_f2, func_f3, func_f4, func_n0, func_n1, func_n2, func_n3, func_n4, func_f0v, func_f1v, func_f2v, func_f3v, func_f4v, func_n0v, func_n1v, func_n2v, func_n3v, func_n4v, func_interp): Initialize optargs to zero. (func_n0o, func_n1o, func_n2o, func_n3o, func_n4o): New functions. (cobj_print_op): Reversed arguments to put_string. (find): testfun and keyfun become optional arguments. (replace): Parameters rearranged and arguments rearranged in calls to replace_list, replace_str and replace_vec. (obj_init): colon_k initialized. (obj_print, obj_pprint): Arguments reversed, and stream defaults to std_output. Arguments reversed in calls to put_char and put_string. (dump): Arguments reversed in call to put_char. * lib.h (struct func): sizes of minparam, fixparam bitfields adjusted. New bitfield optargs. New unnamed bitfield added so the previous ones add up to 16 bits. (colon_k): Declared. (func_n0o, func_n1o, func_n2o, func_n3o, func_n4o): Declared. (replace_list, replace_str, replace_vec, replace): Declarations updated. * match.c (debuglf, dump_shell_string, dump_byte_string, dump_var, do_output_line, extract): Reversed arguments to put_char and
* Bignum support, here we go!Kaz Kylheku2011-12-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bignums, based on Michael Fromberger's MPI library, are integrated into the input syntax, stream output, equality testing, the garbage collector, and hashing. The plus operation handles transitions between fixnums and bignums. Other operations are still fixnum only. * Makefile (CFLAGS): Add mpi directory to include file search. (OBJS): Include new arith.o module and all of MPI_OBJS. (MPI_OBJS, MPI_OBJS_BASE): New variables. * configure (mpi_version, have_quilt, have_patch): New variables. Script detects whether patch and quilt are available. Unpacks mpi library, applies patches. Detects 128 bit integer type. Records more information in config.h about the sizes of types. * dep.mk: Updated. * depend.txr: Make work with paths that have directory components. * eval.c (eval_init): Rename of nump to fixnump. * gc.c (finalize, mark_obj): Handle BGNUM case. * hash.c: (hash_c_str): Changed to return unsigned long instead of long. (equal_hash): Handle BGNUM case. (eql_hash): Handle bignums with equal-hash, but other objects as eq. * lib.c (num_s): Variable renamed to fixnum_s. (bignum_s): New symbol variable. (code2type): Follow rename of num_s. Handle BGNUM case. (typeof): Follow rename of num_s. (eql): Handle bignums using equal, and other types using eq. (equal): Handle BGNUM case. (chk_calloc): New function. (c_num): Wording change in error message: is not a fixnum. (nump): Renamed to fixnump. (bignump): New function. (plus): Function removed, reimplemented in arith.c. (int_str): Handle integers which are too large for wcstol using bignum conversion. Base 0 is no longer passed to wcstol but converted to 10 because the special semantics for 0 would be inconsistent for bignums. (obj_init): Follow rename of num_s. Initialize bignum_s.
* * configure (extra_debugging): New variable. EXTRA_DEBUGGINGKaz Kylheku2011-11-301-0/+18
| | | | | | | | | | | | | conditionally generated in config.h. * gc.c (break_obj): New static variable. (mark_obj): Debugging feature: if the object is the one stored in break_obj and not yet reached, then call breakpt. (deheap): New debugging function for viewing regions of the heaps. * lib.c (breakpt): New function. * lib.h (breakpt): Declared.
* Task #11436Kaz Kylheku2011-11-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lisp interpreter added. * gc.c (finalize, mark_obj): Handle ENV objects. * hash.c (struct hash): acons_new_l_fun function pointer order of arguments change. (equal_hash): Handle ENV. (make_hash, gethash_l): Use cobj_handle for type safety. Follow change in acons_new_l. (gethash, gethash_f, remhash, hash_count, hash_get_userdata, hash_set_userdata, hash_next): Use cobj_handle. (gethash_n): New function. * hash.h (gethash_n): Declared. * lib.c (env_s): New symbol variable. (code2type, equal): Handle ENV. (plusv, minusv, mul, mulv, trunc, mod, gtv, ltv, gev, lev, maxv, minv, int_str): New functions. (rehome_sym): New static function. (func_f0, func_f1, func_f2, func_f3, func_f4, func_n0, func_n1, func_n2, func_n3, func_n4): Initialize new fields of struct func. (func_f0v, func_f1v, func_f2v, func_f3v, func_f4v, func_n0v, func_n1v, func_n2v, func_n3v, func_n4v, func_interp): New functions. (apply): Function removed: sanely re-implemented in new eval.c file. (funcall, funcall1, funcall2, funcall3, funcall4): Handle variadic and interpreted functions. (acons, acons_new, acons_new_l, aconsq_new, aconsq_new_l): Reordered arguments for compatibility with Common Lisp acons. (obj_init): Special hack to prepare hash_s symbol, which is needed for type checking inside the hash table funtions invoked by make_package, at a time when the symbol is not yet interned. Initialize new env_s variable. (obj_print, obj_pprint): Handle ENV. Fix confusing rendering of of function type. (init): Call new function eval_init. * lib.h (enum type): New enumeration member ENV. (struct func): functype member changed to bitfield. New bitfied members minparam and variadic. New members in f union: f0v, f1v, f2v, f3v, f4v, n0v, n1v, n2v, n3v, n4v. (struct env): New type. (union obj): New member e of type struct env. (env_s): Variable declared. (plusv, minusv, mul, mulv, trunc, mod, gtv, ltv, gev, lev, maxv, minv,
* * gc.c (mark_mem_region): Use the Valgrind API only to markKaz Kylheku2011-11-181-1/+1
| | | | | | | | | | | | the type field as accessible, not the whole object that we are checking. Marking the whole object accessible hides uninitialized field bugs! * lib.c: And found a bug already: lazy_str was not completely initializing all of the object fields (ls.prefix, ls.list) before invoking memory allocating operations, making it possible for the garbage collector to encounter uninitialized object areas.
* Fixed broken GC on x86_64 (Ubuntu 11, gcc 4.5.2).Kaz Kylheku2011-10-151-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | The issues is that due to the aggressive function inlining in the gc module, the mark_mem_region function is not real subroutine. The address of its local variable &gc_stack_top ended up excluding the machine context saved by setjmp in the parent function. I.e. the buffer was not between the computed stack top and bottom. Thus registers were not being scanned for references to values. I added a little abstraction to the machine context in the process of fixing this. * gc.c (struct mach_context, mach_context_t): New type. (save_context): New macro. (mark): Takes two new arguments, pointer to the stack top and machine context. It scans the machine context explicitly rather than relying it to be on the stack, between the top and bottom. This context is in fact only object within the garbage collector part of the activation chain that we need to scan. (gc): Use new abstraction to save machine context. Local variable is used to derive the stack top here. The stack top is the top of the stack above the activation frames in the garbage collector itself. The gc has nothing on its stack that should be scanned, except for the machine context, which is now handled explicitly.
* * LICENSE, Makefile, configure, filter.c, filter.h, gc.c, gc.h, hash.c,Kaz Kylheku2011-10-041-1/+1
| | | | | | hash.h, lib.c, lib.h, match.c, match.h, parser.h, parser.l, parser.y, regex.c, regex.h, stream.c, stream.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h: Updated e-mail address.
* Trie compression. Hash table iteration.Kaz Kylheku2011-09-261-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bugfix in typeof. * filter.c (trie_compress): New function. (trie_value_at, trie_lookup_feed_char, filter_string): Handle cons cell nodes in trie. (build_filter): Call trie_compress. * gc.c (cobj_destroy_op): Function renamed to cobj_destroy_stub_op since it doesn't do anything. (cobj_destroy_free_op): New function. * hash.c (struct hash_iter): New type. (hash_destroy): Function removed. (hash_ops): Reference to hash_destroy replaced with cobj_destroy_free_op. (hash_count, hash_iter_mark, hash_begin, hash_next): New functions. (hash_iter_ops): New static structure. * hash.h (hash_count, hash_begin, hash_next): New functions declared. * lib.c (hash_iter_s): New symbol variable. (typeof): Bugfix: TAG_LIT type tag not handled. (vecref): New function. (obj_init): Initialize hash_iter_s. * lib.h (cobj_destroy_op): Declaration renamed. (cobj_destroy_free_op, vecref): New functions declared. (hash_iter_s): New variable declared. * stream.c (string_in_ops, byte_in_ops): cobj_destroy_op renamed to cobj_destroy_stub_op.
* Filtering feature for variable substitution in output.Kaz Kylheku2011-09-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * filter.c, filter.h: New files. * Makefile (OBJS): filter.o added. * gc.c (mark_obj): Mark new alloc field of string objets. * hash.c (struct hash): New member, userdata. (hash_mark): Mark new userdata member of hash. (make_hash): Initialize userdata. (get_hash_userdata, set_hash_userdata, hashp): New functions. * hash.h (get_hash_userdata, set_hash_userdata, hashp): New functions declared. * lib.c (getplist, string_extend, cobjp): New functions. (string_own, string, string_utf8): Initialize new alloc field to nil. (mkstring, mkustring): Initialize new alloc field to actual size. (length_str): When length is computed and cached, also compute and cache alloc. (init): Call filter_init. * lib.h (string string): New member, alloc. (num_fast): Macro converted to inline function. (getplist, string_extend, cobjp): New functions declared. * match.c (match_line): Follows change of modifier s-exp syntax. (format_field): New parameter, filter. New modifier syntax parsed. Filter retrieved, and applied. (subst_vars): New parameter, filter. Filter is either applied in this function or passed to format_field, as needed. (eval_form): Pass nil to new parameter of subst_vars. (do_output_line): New parameter, filter. Passed down to subst_vars. (do_output): New parameter, filter. Passed down to do_output_line. (match_files): Pass nil filter to subst_vars in cat directive. Output directive refactored to parse keywords, extract the filter and pass down to do_output. * parser.y (regex): Generate (sys:regex regex syntax ...) instead of (regex syntax ...). (elem, expr): Updated w.r.t. regex syntax change. (var): Cases '{' IDENT regex '}' and '{' IDENT NUMBER '}' are removed. new syntax '{' IDENT exprs '}' to handle these more generally and allow for keywords. * txr.1: Updated.
* * LICENSE, Makefile, configure, gc.c, gc.h, hash.c, hash.h, lib.c,Kaz Kylheku2011-09-231-1/+1
| | | | | | lib.h, match.c, match.h, parser.h, parser.l, parser.y, regex.c, regex.h, stream.c, stream.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h: Updated copyright year.
* Bump copyrights to 2010.Kaz Kylheku2010-10-051-1/+1
|
* Fixing weak hash tables.Kaz Kylheku2010-01-251-2/+0
|
* Fix for unbounded memory growth problem reproduced with GCC 4.4.1Kaz Kylheku2010-01-211-0/+17
| | | | | | on 32 bit x86 Fedora. This happens because the lazy list variable ``data'' in the match_files function is optimized to a register, but a stale value of that variable persists in the backing storage.
* All COBJ operations have default implementations now;Kaz Kylheku2009-12-081-4/+10
| | | | | | no null pointer check over struct cobj_ops operations. New typechecking function for COBJ objects.
* * gc.c (heap_min_bound, heap_max_bound): New static globals.Kaz Kylheku2009-12-031-0/+13
| | | | | | | (more): Update heap_min_bound and heap_max_bound. (in_heap): Do early rejection tests on the pointer. If it's not aligned, or it's completely outside of the bounding box of the heap area, short circuit to false.
* Code cleanup. All private functions static. Private stuffKaz Kylheku2009-11-281-1/+1
| | | | in regex module not exposed in header. Etc.
* * gc.c (mark_mem_region): Bugfix: do not mess with the valgrindKaz Kylheku2009-11-261-2/+4
| | | | accessibility of the heap object if valgrind debugging is not enabled.
* Refinements to Valgrind support.Kaz Kylheku2009-11-251-2/+21
|
* More Valgrind support. New option --vg-debug which turns onKaz Kylheku2009-11-251-11/+39
| | | | | Valgrind protection of free blocks. This works independently of --gc-debug.
* First stab at Valgrind integration. First goal: eliminate falseKaz Kylheku2009-11-251-4/+8
| | | | positives when gc is accessing uninitialized parts of the stack.
* Changes to make the code portable to C++ compilers, whichKaz Kylheku2009-11-241-9/+9
| | | | can be taken advantage of for better diagnostics.
* Improving portability. It is no longer assumed that pointersKaz Kylheku2009-11-231-1/+2
| | | | | | | | can be converted to a type long and vice versa. The configure script tries to detect the appropriate type to use. Also, some run-time checking is performed in the streams module to detect which conversions specifier strings to use for printing numbers.
* Introducing symbol packages. Internal symbols are now inKaz Kylheku2009-11-211-1/+6
| | | | | | | | | | a system package instead of being hacked with the $ prefix. Keyword symbols are provided. In the matcher, evaluation is tightened up. Keywords, nil and t are not bindeable, and errors are thrown if attempts are made to bind them. Destructuring in dest_bind is strict in the number of items. String streams are exploited to print bindings to objects that are not strings or characters. Numerous bugfixes.
* Changing ``obj_t *'' occurences to a ``val'' typedef. (Ideally,Kaz Kylheku2009-11-201-29/+29
| | | | | we wouldn't have to declare object variables at all, so why use an obtuse syntax to do so?)
* Big round of changes to switch the code base to use the streamKaz Kylheku2009-11-161-2/+2
| | | | | | | | | | | | | | | | | abstraction instead of directly using C standard I/O, to eliminate most uses of C formatted I/O, and fix numerous bugs, such variadic argument lists which lack a terminating ``nao'' sentinel. Bug 28033 is addressed by this patch, since streams no longer provide printf-compatible formatting. The native formatter is extended with some additional capabilities to take over. The work on literal objects is expanded and they are now used throughout the code base. Fixed bad realloc in string output stream: reallocating by number of wide chars rather than bytes.
* Use the 11 tag bit pattern to denote a new type: LIT. This is aKaz Kylheku2009-11-161-0/+2
| | | | | pointer to a C static string, intended for literals. We can now treat literal strings as light-weight objects.
* Continuing wchar_t conversion. Making sure all stdio callsKaz Kylheku2009-11-121-2/+3
| | | | | use wide character functions so that there is no illicit mixing. (But the goal is to replace this usage with txr streams).
* Big conversion to wide characters and UTF-8 support.Kaz Kylheku2009-11-111-1/+1
| | | | | | | | | This is incomplete. There are too many dependencies on wide character support from the C stream I/O library, and implicit use of some encoding which may not be UTF-8. The regex code does not handle wide characters properly. Character type is still int in some places, rather than wchar_t. Test suite passes though.
* Changing representation of objects to allow the NUM type to beKaz Kylheku2009-11-091-2/+2
| | | | | | | | unboxed. If the lowest bit of the obj_t * pointer is 1, then the remaining bits are a number. A lot of assumptions are made: - the long type can be converted to and from a pointer - two's complement. - behavior of << and >> operators when the sign bit is involved.
* First cut at hash tables. One known problem is allocation during gc,Kaz Kylheku2009-11-091-0/+16
| | | | due to use of boxed numbers for vector access.
* Bugfix: recurse over recently addedKaz Kylheku2009-11-031-0/+1
| | | | member, opts, in the lazy_string structure.
* Start of implementation for freestyle matching.Kaz Kylheku2009-11-021-13/+17
| | | | | | | | | | | Lazy strings implemented, incompletely. Changed string function to implicitly strdup; non-strdup version changed to string_own. Fixed wrong uses of strdup rather than chk_strdup. Functions added to regex module to provide regex matching as a state machine to which characters are fed.
* txr-017 2009-10-17txr-017Kaz Kylheku2017-07-311-12/+14
| | | | Note: Version 016 ChangeLog message incorrect.
* txr-015 2009-10-15txr-015Kaz Kylheku2017-07-311-17/+26
|
* txr-013 2009-09-30txr-013Kaz Kylheku2017-07-311-8/+15
|
* txr-011 2009-09-25txr-011Kaz Kylheku2017-07-311-0/+368