| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although we are garbage-collected, being able to clean up on
shutdown is nevertheless useful for uncovering leaks. Leaks
can occur, for instance, due to neglect to free out-of-heap
satellite data from objects that are reclaimed by gc.
This feature is long overdue.
* arith.c, arith.h (arith_free_all): New function.
* gc.c, gc.h (gc_free_all): New function.
* lib.c (init): Remove program name parameter and
redundant initialization of progname globl variable.
* lib.h (progname): Superfluous declaration removed.
This is already declared in txr.h.
(init): Declaration updated.
* regex.c (char_set_destroy): Do not check the static
allocation flag here; just destroy the object.
Do check for a null pointer, though.
(char_set_cobj_destroy): This cobj destructor now
checks the static flag of the char set object and
avoids freeing it. Thus our char set singletons are
left alone by gc, but our global freeing function
takes care of them.
(wide_cs): New static variable moved out of
wide_display_char_p to static scope.
(regex_free_all): New function.
* regex.h (regex_free_all): Declared.
* txr.c (progname): const qualifier and initializer removed.
(main): Ensure progname is always dynamically allocated, even
in the argv[0] == 0 case. Do not pass progname to init;
it doesn't take that argument any more.
(free_all): New static function.
(txr_main): Implement --free-all option.
* txr.h (progname): Declaration updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions convert between positive integers, and
fixed-size memory buffers representing pure binary numbers in
big endian byte order.
This functionality will be used in some upcoming networking
code.
* arith.c (num_from_buffer, num_to_buffer): New functions.
* arith.h (num_from_buffer, num_to_buffer): Declared.
* mpi/mpi.c (mp_to_unsigned_buf): New function.
* mpi/mpi.h (mp_to_unsigned_buf): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (UINT_PTR_MAX_MP): New static variable.
(biggnum_from_uintptr): New function.
(in_uint_ptr_range): New static function.
(c_uint_ptr_num): New function.
(arith_init): Initialize UINT_PTR_MAX_MP.
* arith.h (bignum_from_uintptr, c_uint_ptr_num): Declared.
* eval.c (eval_init): Register random-state-get-vec.
* mpi/mpi.c (mp_set_uintptr, mp_get_uintptr): New functions.
(mp_set_intptr, mp_get_intptr): Expressed in terms of
mp_set_uintptr and mp_get_uintptr.
* mpi/mpi.h (mp_set_uintptr, mp_get_uintptr): Declared.
* rand.c (make_random_state): Handle vector seed.
(random_state_get_vec): New function.
* rand.h (random_state_get_vec): Declared.
* txr.1: Documented new feature in make-random-state
and new random-state-get-vec function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* LICENSE, METALICENSE, Makefile, args.c, args.h, arith.c,
arith.h, cadr.c, cadr.h, combi.c, combi.h, configure,
debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, gc.c,
gc.h, glob.c, glob.h, hash.c, hash.h, jmp.S, lib.c, lib.h,
lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h,
parser.l, parser.y, rand.c, rand.h, regex.c, regex.h,
share/txr/stdlib/cadr.tl, share/txr/stdlib/except.tl,
share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl,
share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl,
share/txr/stdlib/struct.tl, share/txr/stdlib/txr-case.tl,
share/txr/stdlib/type.tl, share/txr/stdlib/with-resources.tl,
share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl,
signal.c, signal.h, stream.c, stream.h, struct.c, struct.h,
sysif.c, sysif.h, syslog.c, syslog.h, txr.1, txr.c, txr.h,
unwind.c, unwind.h, utf8.c, utf8.h: Add 2016 copyright.
* linenoise/LICENSE, linenoise/linenoise.c,
linenoise/linenoise.h: Bump one principal author's copyright
from 2014 to 2015. The code is based on a snapshot of 2015
upstream work.
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c, arith.h, combi.c, combi.h, debug.c, debug.h, eval.c, eval.h,
filter.c, filter.h, gc.c, gc.h, hash.c, hash.h, lib.c, lib.h,
match.c, match.h, parser.h, rand.c, rand.h, regex.c, regex.h,
signal.c, signal.h, stream.c, stream.h, sysif.c, sysif.h, syslog.c,
syslog.h, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h:
Update.
* LICENSE, METALICENSE: Likewise.
|
|
|
|
|
|
|
|
| |
* arith.h (width): Declared.
* eval.c (eval_init): Width registered as intrisinc.
* txr.1: Documented width.
|
|
|
|
|
|
|
|
| |
debug.h, eval.c, eval.h, filter.c, filter.h, gc.c, gc.h, hash.c,
hash.h, lib.c, lib.h, match.c, match.h, parser.h, parser.l, parser.y,
rand.c, rand.h, regex.c, regex.h, signal.c, signal.h, stream.c,
stream.h, syslog.c, syslog.h, txr.c, txr.h, unwind.c, unwind.h,
utf8.c, utf8.h: Synchronize license header with LICENSE.
|
|
|
|
|
|
|
|
|
| |
* arith.h (tofloat, toint): Declared.
* eval.c (eval_init): tofloat and toint registered
as intrinsics.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
(n_choose_k, n_perm_k): New functions.
* arith.h (n_choose_k, n_perm_k): Declared.
* eval.c (eval_init): New functions interned.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
so it doesn't have quotes around it.
(cum_norm_dist): New function.
* arith.h (cum_norm_dist): Declared.
* eval.c: Include arith.h.
(eval_init): Register cum_norm_dist as intrinsic.
* txr.1: Documented cum-norm-dist.
|
|
|
|
| |
Fixing some errors in copyright comments.
|
|
|
|
|
|
|
|
|
| |
* arith.h (bignum_from_long): Declared.
* lib.c (int_str): Streamlined. Only use mp_read_radix in the case when
wcstol fails, because now we have bignum_from_long to handle all values
of long. Ensure that the bignum is normalized, in case it falls in the
fixnum range (does not happen on our usual platforms).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(in_int_ptr_range): New function.
(arith_init): Initialize INT_PTR_MAX_MP.
* arith.h (in_int_ptr_range): Declared.
* lib.c (c_num): Allow bignums to be converted to a cnum, if
they are in range, rather than allowing only fixnums.
* rand.c (make_random_state): Now that we have such a function,
initialize random seed using time value from time_sec_usec rather than
from time and clock. clock is bad for random seeding because it
measures virtual time since the start of the process.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.h (bignum): Declared.
* configure: Added check for tm_gmtoff and tm_tmzone fields
being present in struct tm.
* eval.c (eval_init): New intrinsic functions: time, time-usec.
* lib.c (num): If the cnum is outside of the fixnum range, then
construct a bignum.
(time_sec, time_sec_usec): New functions.
* lib.h (mut): Slight change to macro to eliminate compiler warning.
(time_sec, time_sec_usec): Declared.
* txr.1: Stub section for time and time-usec.
* txr.vim: Highlighting for time and time-usec.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* arith.h (highest_bit): Declared.
* rand.c (random): Rewrote using different algorithm which
ensures even distribution, and avoids doing a bignum mod
operation.
|
|
|
|
|
|
|
|
| |
* arith.h (normalize): Declared.
* rand.c (random): Bugfix: normalize the bignum before returning it.
* txr.1: Doc stubs for PRNG functionality.
|
|
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.
|