1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00
Commit graph

3859 commits

Author SHA1 Message Date
Rob Browning
92e6989fda * __scm.h: move libguile/scmconfig.h include up to the top, so
we're sure to pick up any critical defines like _GNU_SOURCE early.
#include <limits.h> removed in favor of scmconfig.h inclusion when
appropriate.  STDC_HEADERS based inclusion of stdlib.h,
sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of
scmconfig.h inclusion when appropriate.  Various Win32 related
definitions removed in favor of scmconfig.h inclusion when
appropriate.
(HAVE_UINTPTR_T): definition removed (see NEWS).
(SIZEOF_PTRDIFF_T): definition removed (see NEWS).
(HAVE_LONG_LONGS): definition removed (see NEWS).
(HAVE_LONG_LONG): definition removed (see NEWS).
(HAVE_PTRDIFF_T): definition removed (see NEWS).
2003-03-25 23:51:57 +00:00
Rob Browning
64c2db807d * Makefile.am: scmconfig.h is now generated by building and
running gen-scmconfig.h and capturing its output.  gen-scmconfig
uses config.h and the configure.in generated gen-scmconfig.h to
decide what to output.  See gen-scmconfig.c for details.
(noinst_PROGRAMS): add gen-scmconfig.
(gen_scmconfig_SOURCES): new variable.
(gen-scmconfig.$(OBJEXT)): new target - be careful to handle
cross-compiling right.
(scmconfig.h): build scmconfig.h from gen-scmconfig's output.
(BUILT_SOURCES): add scmconfig.h.
2003-03-25 23:51:37 +00:00
Rob Browning
ed2b47e773 * scmconfig.h.top: new file -- preamble for scmconfig.h. 2003-03-25 23:49:14 +00:00
Rob Browning
38bf25a71f * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details. 2003-03-25 23:49:03 +00:00
Rob Browning
caeef9cb7c * gen-scmconfig.c: new file -- see comments in file for details. 2003-03-25 23:48:53 +00:00
Rob Browning
c62fdb8ee0 *** empty log message *** 2003-03-25 02:14:06 +00:00
Marius Vollmer
25e0bf97cf *** empty log message *** 2003-03-19 22:00:31 +00:00
Marius Vollmer
598b6787bc Added defines for sparc-unknown-netbsdelf1.5 from Adrian Bunk.
Thanks!
2003-03-19 21:59:14 +00:00
Mikael Djurfeldt
74b6d6e456 * goops.c (make_class_from_template): New fourth arg:
applicablep.
(scm_class_extended_generic_with_setter, scm_class_self): Fixed
cpls.

* smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable.

* goops.c, objects.c, objects.h (scm_make_extended_class): New
second arg: applicablep.
(scm_i_inherit_applicable): New function.

* goops.c, goops.h (scm_class_applicable,
scm_class_extended_accessor): New classes.
2003-03-19 08:57:47 +00:00
Dirk Herrmann
5c9e7dad75 * procs.c (scm_procedure_documentation): Removed redundant
SCM_NIMP test and replaced other calls to SCM_IMP by more explicit
	predicates.
2003-03-18 19:06:03 +00:00
Mikael Djurfeldt
c614a00b8c * srfi-1.scm (filter, filter!): Removed. (Now implemented in the core.)
* goops/util.scm (filter): Removed.  (Now supplied by core.)

* list.c, list.h (scm_filter, scm_filter_x): New functions.

* debugger/command-loop.scm: Prefix all commands imported from
(ice-9 debugger command-loop) with debugger:.

* boot-9.scm (resolve-interface): Process #:hide; Name custom interfaces
appropriately.
(module-use!, module-use-interfaces!): Remove existing interfaces
on the use-list based on module name rather than interface
identity so that custom interfaces truly replaces their previous
version.
2003-03-11 19:58:14 +00:00
Mikael Djurfeldt
109c2c9f29 * modules.c (scm_module_import_interface): New function.
* boot-9.scm (process-duplicates): Use module-import-interface.
(module-symbol-interface): Removed.
2003-03-11 15:58:02 +00:00
Mikael Djurfeldt
f8af5c6d35 * goops.scm (define-extended-generics): New syntax.
(<class> <operator-class> <entity-class> <entity>): Marked as
replacements.
(upgrade-accessor): Renamed from upgrade-generic-with-setter.
(ensure-accessor, upgrade-accessor): Rewritten to accomodate the
new <accessor> class.
(merge-accessors): Provide for merging of accessors imported from
different modules under the same name.

* goops.c, goops.h (scm_class_accessor_method): Renamed from
scm_class_accessor.
(scm_class_accessor): New class.
2003-03-11 14:50:08 +00:00
Mikael Djurfeldt
a48d60b1c0 * srfi-1.c (scm_init_srfi_1): Extend root module map and for-each
with the versions in this module using
scm_c_extend_primitive_generic.

* goops.scm (equal?): Define default method.

* goops.c (scm_primitive_generic_generic): Enable primitive
generic if not enabled.
(scm_sys_goops_loaded): Setup unextended primitive generics.

* goops.c, goops.h (scm_c_extend_primitive_generic): New function.

* snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
snarf macros.

* numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC.  (This is only a
testing example.  All uses of SCM_GPROC should be converted.)

* procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
scm_assoc.

* eq.c (scm_equal_p): Turned into a primitive generic.
2003-03-06 12:51:57 +00:00
Mikael Djurfeldt
ea7f6344cf Added comments to scm_c_random_bignum 2003-03-03 13:19:46 +00:00
Rob Browning
84edc04952 *** empty log message *** 2003-02-27 07:04:25 +00:00
Rob Browning
93ff93f6f5 * Makefile.am (scmconfig.h): new target -- generate file from
../config.h.
(modinclude_HEADERS): remove version.h.
(nodist_modinclude_HEADERS): add version.h.
2003-02-27 07:04:16 +00:00
Mikael Djurfeldt
b4a1358cfb * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
SCM_EOL.
(scm_struct_prehistory): Move scm_free_structs to
scm_before_mark_c_hook.

* gc-card.c (sweep_card): Check that we haven't swept structs on
this card before.  That can happen if scm_i_sweep_all_segments has
been called from some other place than scm_igc.
2003-02-24 19:21:56 +00:00
Mikael Djurfeldt
53af825522 * struct.c (scm_struct_prehistory): Move scm_free_structs to
scm_before_mark_c_hook.
2003-02-24 11:26:46 +00:00
Mikael Djurfeldt
ea5c928530 * struct.c (scm_struct_gc_init): Removed.
(scm_struct_prehistory): Init scm_i_structs_to_free to SCM_EOL.
(This fixes a serious GC bug, introduced during the latest
reorganization of the GC, preventing freeing of structs and GOOPS
objects.)
2003-02-24 10:46:29 +00:00
Mikael Djurfeldt
9358af6a3e Fix of previous change 2003-02-19 17:57:01 +00:00
Mikael Djurfeldt
231a4ea849 * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31
(since hash tables now adapt their size).

* modules.c (scm_modules_prehistory): Changed from 2001 to 1533
(current number of prehistory bindings; hashtable code will select
a prime which is greater than this value).

* symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139
(current number of initial symbols).

* properties.c (scm_init_properties): Don't specify size of
scm_properties_whash.

* objprop.c (scm_init_objprop): Don't specify size of
scm_object_whash.

* keywords.c (scm_init_keywords): Don't specify a hash table size.
2003-02-19 16:16:46 +00:00
Mikael Djurfeldt
110beb83a5 Fix of last change. 2003-02-19 15:43:00 +00:00
Mikael Djurfeldt
c35738c1ae * hooks.c (scm_c_hook_add): Fixed bug in append mode.
* environments.c (obarray_enter, obarray_retrieve, obarray_remove,
leaf_environment_fold, obarray_remove_all): Use hashtable
accessors.

* gc.c (scm_init_storage): Moved hook initialization to
scm_storage_prehistory.
(scm_storage_prehistory): New function.
(scm_igc): Added commentary about placement of
scm_after_sweep_c_hook.

* gc-mark.c (scm_mark_all): Use hashtable accessors.
(scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and
SCM_WVECT_WEAK_VALUE_P.

* hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New
functions.
(scm_vector_to_hash_table, scm_c_make_resizing_hash_table):
Removed.
(scm_make_weak_key_hash_table, scm_make_weak_value_hash_table,
scm_make_doubly_weak_hash_table): Moved here from weaks.c.

* init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added
calls to scm_storage_prehistory and scm_hashtab_prehistory.

* modules.c (module-reverse-lookup): Use hashtable accessors.

* symbols.c, symbols.h (scm_i_hash_symbol): New function.

* weaks.c, weaks.h (scm_make_weak_key_alist_vector,
scm_make_weak_value_alist_vector,
scm_make_doubly_weak_alist_vector): New functions.

* weaks.c (scm_init_weaks_builtins): New function.

* weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE,
SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P,
SCM_WVECT_NOSCAN_P): New macros.

* weaks.c (scm_scan_weak_vectors):  Use SCM_WVECT_WEAK_KEY_P
and SCM_WVECT_WEAK_VALUE_P.

* weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from
allocate_weak_vector and exported.

* Makefile.am (ice9_sources): Added weak-vector.scm.

* weak-vector.scm: New file.

* boot-9.scm (module-clear!): Use hash-clear!.
(module-for-each): Use hash-for-each.
(module-map): Use hash-map.
2003-02-19 15:04:51 +00:00
Mikael Djurfeldt
0a4c135550 * hashtab.c: Undid thread safety. (We decided that it's better to
let the user explicitly protect the tables (or not) according what
is suitable for the application.)
2003-02-13 10:42:59 +00:00
Mikael Djurfeldt
87ca11ff19 * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made
thread safe and handle resizing tables.
(scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed
SCM_DEFER/ALLOW_INTS.
2003-02-12 09:55:10 +00:00
Mikael Djurfeldt
f59a096e59 * hashtab.c (scm_vector_to_hash_table,
scm_c_make_resizing_hash_table, scm_make_hash_table): New
functions.
(scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread
safe and handle resizing tables.

* weaks.c (scm_make_weak_key_hash_table,
scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table):
Size argument made optional.  Return resizable table if not
specified.

* boot-9.scm (make-hash-table): Turned primitive.
2003-02-11 13:49:32 +00:00
Mikael Djurfeldt
4b612c5be7 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
Fixed formals tests for closures.  (Thanks to Kevin Ryde.)
2003-02-10 12:39:11 +00:00
Mikael Djurfeldt
b3d7f6dfea * debug.c (scm_procedure_source): Handle all objects for which
procedure? is #t.  (Thanks to Bill Schottstaedt.)
2003-02-05 19:04:40 +00:00
Mikael Djurfeldt
361d631fb7 * futures.c (mark_futures): Don't need to mark data of recycled
futures.
(scan_futures, cleanup_undead): Be smarter about marking
futures---avoid unnecessary passes through future lists.
2003-01-23 20:31:38 +00:00
Mikael Djurfeldt
6b468ba449 * futures.h, futures.c: New files; Introduced recycling of
futures.  For fine-grained threading this lifts performance to
another level.  We can now use parallelization in inner loops of
Guile programs without impossible overhead.
2003-01-23 16:13:13 +00:00
Mikael Djurfeldt
756414cf2c * threads.h, threads.c: Moved futures to their own file.
* Makefile.am (libguile_la_SOURCES): Added futures.c.
(DOT_X_FILES): Added futures.x.
(DOT_DOC_FILES): Added futures.doc.
(modinclude_HEADERS): Added futures.h.

* threads.c, threads.h (scm_i_create_thread): Renamed from
create_thread and made global.

* eval.c: #include "libguile/futures.h".

* init.c: #include "futures.h"
(scm_init_guile_1): Call scm_init_futures.

* stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK.

* stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here.

* eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New
functions.

* eval.c (scm_trampoline_1): Fixed arguments test for closures.
2003-01-23 16:04:37 +00:00
Mikael Djurfeldt
b4debead6a * threads.c (create_thread): Don't unwind dynwind chain of parent
thread before creation.  Just start the new thread with an empty
dynwind chain.
2003-01-22 10:29:28 +00:00
Mikael Djurfeldt
93f26b7bcc * evalext.c, evalext.h (scm_self_evaluating_p): New function.
* psyntax.ss (self-evaluating?): Removed.  Guile now provides this
operator as a primitive procedure.
(build-data): Quote vectors (psyntax.ss requires this).
2003-01-20 10:12:39 +00:00
Mikael Djurfeldt
41c96c3252 * threads.c (scm_timed_wait_condition_variable): Support timed
waiting also for simple condition variables.
2003-01-10 22:16:56 +00:00
Mikael Djurfeldt
38d8927ca8 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
of calling the procedure change-object-class.
2003-01-10 12:58:40 +00:00
Mikael Djurfeldt
9cf5d9b7d2 * ramap.c (scm_ramapc): Typo in error message. 2003-01-09 15:21:33 +00:00
Mikael Djurfeldt
b46fae006d * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
slots with instance allocation.
2003-01-08 15:05:55 +00:00
Mikael Djurfeldt
bbf8d52350 * goops.scm (upgrade-generic-with-setter,
compute-new-list-of-methods): Use methods slot directly instead of
generic-function-methods.
(upgrade-generic-with-setter): Handle <extended-generic>:s.
(define-extended-generic): New syntax.
(make-extended-generic): New function.

* goops.c, goops.h (scm_class_extended_generic_with_setter): New
class.
(scm_compute_applicable_methods): Use scm_generic_function_methods.

* goops.c (scm_generic_function_methods): Support extended
generic functions.
2003-01-08 13:24:41 +00:00
Mikael Djurfeldt
2e37d6a2fc *** empty log message *** 2002-12-29 09:56:25 +00:00
Mikael Djurfeldt
ebf9b47c8b * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future. 2002-12-29 09:54:26 +00:00
Neil Jerram
14a9ba3f2c Remove commented-out declarations (related to Elisp). 2002-12-29 01:17:39 +00:00
Neil Jerram
6054d8052e Remove superfluous code (previously commented out). 2002-12-28 20:10:49 +00:00
Neil Jerram
c6a040a82a Code (work in progress, currently disabled) for reading Elisp-syntax vectors. 2002-12-28 19:57:14 +00:00
Marius Vollmer
3742c12f5d *** empty log message *** 2002-12-26 15:00:50 +00:00
Marius Vollmer
93eaa2a224 (c-tokenize.o): Refer to source via $< so that vpath
builds work.
(EXTRA_DIST): Added version.h.in.
2002-12-26 15:00:23 +00:00
Mikael Djurfeldt
fb50ef08ec * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
* gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
scm_gc_register_collectable_memory): Substitute locking of
scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
(scm_igc): Lock sweep mutex here instead of in callers; Calls to
scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
the single-thread section (which now only contains the mark
phase).
(scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
Removed SCM_DEFER/ALLOW_INTS.  Simply call scm_igc directly.

* threads.c (gc_section_mutex): Removed.
2002-12-21 18:59:47 +00:00
Mikael Djurfeldt
0d48aca527 * threads.c (create_thread): Clear parent field in root state in
order not to unnecessarily remember dead threads.
2002-12-19 08:08:39 +00:00
Mikael Djurfeldt
b7b6a116e6 Added back two macros used when debugging. (Got lost by mistake during
a recent change.)
2002-12-19 08:00:23 +00:00
Mikael Djurfeldt
9ed246339f * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
(scm_trampoline_1, scm_trampoline_2): Use them.
2002-12-19 07:49:15 +00:00