summaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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