* modules.c (s_scm_module_import_interface): move declaration of
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
15635be5
MD
12003-04-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2
1ecfd013
MD
3 * Makefile.am (scmconfig.h): Look for config.h in top_builddir,
4 not top_srcdir.
5
15635be5
MD
6 * hashtab.c (rehash_after_gc): Clear to_rehash list before
7 processing it in order to avoid an infinite loop.
8
9 * print.c (scm_prin1): Remember old state of pstate->writingp.
10
73be1d9e
MV
112003-04-05 Marius Vollmer <mvo@zagadka.de>
12
13 * Changed license terms to the plain LGPL thru-out.
14
ad815c06
RB
152003-04-04 Rob Browning <rlb@defaultvalue.org>
16
17 * socket.c (FLIPCPY_NET_HOST_128): new macro.
18 (ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p):
19 rewrite to handle GMP bignums.
20
21
22 * random.c (scm_c_random_bignum): rewrite to handle GMP bignums.
23
24 * ports.c (scm_getc): minor tweak.
25
26 * numbers.h: remove SCM_BIGDIG conditionals, reorganize, and
27 rewrite to handle GMP bignums.
28
29 * numbers.c: rewrite *many* functions to handle GMP bignums.
30
31 * num2integral.i.c (NUM2INTEGRAL, INTEGRAL2NUM, INTEGRAL2BIG):
32 handle GMP bignums.
33
34 * num2float.i.c (NUM2FLOAT): handle GMP bignums.
35
36 * init.c (check_config): remove SCM_BIGDIG conditionals.
37 (scm_init_guile_1): test to make sure mpz_t fits in a double_cell.
38
39 * gc-card.c ("sweep_card"): handle new mpz_t bignums.
40
41 * eval.c: remove SCM_BIGDIG conditionals.
42
43 * eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp.
44
d11d697a
MV
452003-03-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
46
9686f86d
MV
47 * init.c (scm_init_guile_1): Call scm_i_init_deprecated.
48
49 * deprecated.c, deprecated.h: New files, to collect deprecated
50 things in one place.
51 * Makefile.am: Added them in all the right places.
52
d11d697a
MV
53 * Makefile.am (EXTRA_DIST): Added "scmconfig.h.top".
54 (scmconfig.h): Get "scmconfig.h.top" from $(srcdir) so that VPATH
55 builds work.
9686f86d
MV
56 (DOT_X_FILES): Removed "iselect.x".
57 (DOT_DOC_FILES): Removed "iselect.doc".
d11d697a 58
e3c0c3b9
RB
592003-03-25 Rob Browning <rlb@defaultvalue.org>
60
61 * win32-socket.h: #include "libguile/__scm.h". Replace usage of
62 HAVE_WINSOCK2_H with SCM_HAVE_WINSOCK2_H.
63
64 * win32-socket.c: #include <config.h> if HAVE_CONFIG_H.
65
66 * vports.c: #include <config.h> if HAVE_CONFIG_H.
67
68 * unif.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of
69 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
70
71 * threads.h: replace usage of struct timespect with
72 scm_t_timespec. Replace usage of USE_PTHREAD_THREADS with
73 SCM_USE_PTHREAD_THREADS. Remove typedef for struct timespec in
74 favor of scm_t_timespec from scmconfig.h.
75
76 * threads.c: move libguile/_scm.h include to the top so we pick up
77 any critical defines like _GNU_SOURCE early. Replace usage of
78 struct timespect with scm_t_timespec. Replace usage of
79 STACK_GROWS_UP with SCM_STACK_GROWS_UP. Replace usage of
80 USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS.
81
82 * threads-plugin.h: replace usage of struct timespect with
83 scm_t_timespec.
84
85 * threads-plugin.c: #include <config.h> if HAVE_CONFIG_H. Replace
86 usage of struct timespect with scm_t_timespec.
87
88 * tags.h: move HAVE_STDINT_H handling to scmconfig.h. Move
89 HAVE_INTTYPES_H handling to scmconfig.h. #include
90 "libguile/__scm.h". Rework handling for scm_t_bits,
91 scm_t_signed_bits, SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
92 SCM_T_SIGNED_BITS_MIN, and SIZEOF_SCM_T_BITS to use scm_t_intptr,
93 scm_t_uintptr, SCM_SIZEOF_INTPTR_T, and SCM_SIZEOF_UINTPTR_T, and
94 SCM_SIZEOF_UNSIGNED_LONG. Rename usage of HAVE_ARRAYS to
95 SCM_HAVE_ARRAYS.
96
97 * symbols.c: #include <config.h> if HAVE_CONFIG_H.
98
99 * struct.c: #include <config.h> if HAVE_CONFIG_H.
100
101 * strports.c: #include <config.h> if HAVE_CONFIG_H.
102
103 * strop.c: #include <config.h> if HAVE_CONFIG_H.
104
105 * stime.h: move handling of time related headers to scmconfig.h.
106
107 * stime.c: #include <config.h> if HAVE_CONFIG_H.
108
109 * stacks.c: replace usage of STACK_GROWS_UP with
110 SCM_STACK_GROWS_UP.
111
112 * sort.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
113 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
114
115 * socket.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
116 of uint32 and HAVE_UINT_32 with scm_t_int32.
117
118 * smob.c: #include <config.h> if HAVE_CONFIG_H.
119
120 * simpos.c: #include <config.h> if HAVE_CONFIG_H.
121
122 * script.c: #include <config.h> if HAVE_CONFIG_H.
123
124 * scmsigs.c: #include <config.h> if HAVE_CONFIG_H.
125
126 * scmconfig.h.top: new file -- preamble for scmconfig.h.
127
128 * rw.c: #include <config.h> if HAVE_CONFIG_H.
129
130 * regex-posix.c: #include <config.h> if HAVE_CONFIG_H.
131
132 * read.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
133
134 * rdelim.c: #include <config.h> if HAVE_CONFIG_H.
135
136 * random.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
137 of LONG32, LONG64, SIZEOF_LONG, and HAVE_LONG_LONGS with
138 scm_t_int32, scm_t_int64, and SCM_HAVE_T_INT64. Rename usage of
139 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
140
141 * ramap.c: replace usage of HAVE_LONG_LONGS with
142 "SCM_SIZEOF_LONG_LONG != 0".
143
144 * putenv.c: #include <config.h> if HAVE_CONFIG_H. #include
145 "libguile/scmconfig.h".
146
147 * pthread-threads.c: #include <config.h> if HAVE_CONFIG_H.
148
149 * print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
150 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
151
152 * posix.c: #include <config.h> if HAVE_CONFIG_H.
153
154 * ports.c: #include <config.h> if HAVE_CONFIG_H.
155
156 * objects.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
157
158 * numbers.h: replace usage of HAVE_FLOATINGPOINT_H with
159 SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with
160 SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with
161 SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with
162 SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with
163 scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with
164 "SCM_SIZEOF_LONG_LONG != 0".
165
166 * numbers.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
167 of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". Replace
168 usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of
169 SIZEOF_PTRDIFF_T with SCM_SIZEOF_SCM_T_PTRDIFF.
170
171 * num2integral.i.c: #include <config.h> if HAVE_CONFIG_H.
172
173 * null-threads.h: replace usage of struct timespect with
174 scm_t_timespec.
175
176 * net_db.c: #include <config.h> if HAVE_CONFIG_H.
177
178 * mkstemp.c: #include <config.h> if HAVE_CONFIG_H. #include
179 "libguile/__scm.h". Remove definition of gcc_uint64_t in favor of
180 scm_t_uint64 and rename usages.
181
182 * mallocs.c: #include <config.h> if HAVE_CONFIG_H.
183
184 * load.c: #include <config.h> if HAVE_CONFIG_H.
185
186 * iselect.h: move handling of time related headers to scmconfig.h.
187 Rename usage of HAVE_SYS_SELECT_H to SCM_HAVE_SYS_SELECT_H.
188 Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Rename
189 usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS.
190
191 * iselect.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
192 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
193 USE_NULL_THREADS to SCM_USE_NULL_THREADS.
194
195 * ioext.c: #include <config.h> if HAVE_CONFIG_H.
196
197 * inline.h: #include "libguile/__scm.h" at the top. Change code
198 to use SCM_C_INLINE and SCM_INLINE_C_INCLUDINT_INLINE_H to decide
199 what to do instead of creating a new public #define. Rename usage
200 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
201 USE_NULL_THREADS to SCM_USE_NULL_THREADS. Rename usage of
202 USE_COPT_THREADS to SCM_USE_COPT_THREADS.
203
204 * inline.c: rearrange handling -- now we just #define
205 SCM_INLINE_C_INCLUDING_INLINE_H to 1 and #include
206 "libguile/inline.h". scmconfig.h will define SCM_C_INLINE as
207 appropriate, and we use that in inline.h along with the above
208 define to determine how to respond.
209
210 * init.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
211 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
212
213 * guile.c: #include <config.h> if HAVE_CONFIG_H.
214
215 * gh_data.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
216 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
217
218 * gh.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
219
220 * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details.
221
222 * gen-scmconfig.c: new file -- see comments in file for details.
223
224 * gdbinit.c: #include <config.h> if HAVE_CONFIG_H.
225
226 * gc_os_dep.c: #include <config.h> if HAVE_CONFIG_H. Replace
227 usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP.
228
229 * gc.h: replace usage of SIZEOF_LONG with
230 SCM_SIZEOF_UNSIGNED_LONG. Replace usage of USE_PTHREAD_THREADS
231 with SCM_USE_PTHREAD_THREADS. Remove SCM_SIZEOF_LONG definition
232 since we handle that in scmconfig.h now.
233
234 * gc.c: #include <config.h> if HAVE_CONFIG_H.
235
236 * gc-mark.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
237 of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of
238 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
239
240 * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H.
241
242 * gc-card.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
243 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
244
245 * fports.c: #include <config.h> if HAVE_CONFIG_H.
246
247 * filesys.c: #include <config.h> if HAVE_CONFIG_H.
248
249 * feature.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
250 of USE_NULL_THREADS to SCM_USE_NULL_THREADS.
251
252 * extensions.c: #include <config.h> if HAVE_CONFIG_H.
253
254 * evalext.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
255 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
256
257 * eval.c: #include <config.h> if HAVE_CONFIG_H. #include
258 "libguile/__scm.h" rather than scmconfig.h. Rename usage of
259 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
260 with "SCM_SIZEOF_LONG_LONG != 0".
261
262 * error.c: #include <config.h> if HAVE_CONFIG_H.
263
264 * eq.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
265 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
266 with "SCM_SIZEOF_LONG_LONG != 0".
267
268 * deprecation.c: #include <config.h> if HAVE_CONFIG_H.
269
270 * coop.c: replace usage of struct timespect with scm_t_timespec.
271 #include <config.h> if HAVE_CONFIG_H.
272
273 * coop-threads.c: #include "libguile/_scm.h" early. Replace
274 usage of struct timespect with scm_t_timespec. Replace usage of
275 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
276
277 * coop-pthreads.c: #include "libguile/_scm.h" early. Replace
278 usage of struct timespect with scm_t_timespec. Replace usage of
279 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
280
281 * coop-defs.h: move handling of time related headers to
282 scmconfig.h. Add #include "libguile/__scm.h". Rename usage of
283 HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Replace usage of struct
284 timespect with scm_t_timespec.
285
286 * convert.i.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
287
288 * convert.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
289
290 * convert.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
291 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
292
293 * continuations.c: move libguile/_scm.h include to the top so we
294 pick up any critical defines like _GNU_SOURCE early.
295
296 * backtrace.c: #include <config.h> if HAVE_CONFIG_H.
297
298 * async.c: #include <config.h> if HAVE_CONFIG_H.
299
300 * alloca.c: #include <config.h> if HAVE_CONFIG_H.
301
302 * _scm.h: #include <config.h> if HAVE_CONFIG_H.
303 Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS.
304
305 * __scm.h: move libguile/scmconfig.h include up to the top, so
306 we're sure to pick up any critical defines like _GNU_SOURCE early.
307 #include <limits.h> removed in favor of scmconfig.h inclusion when
308 appropriate. STDC_HEADERS based inclusion of stdlib.h,
309 sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of
310 scmconfig.h inclusion when appropriate. Various Win32 related
311 definitions removed in favor of scmconfig.h inclusion when
312 appropriate.
313 (HAVE_UINTPTR_T): definition removed (see NEWS).
314 (SIZEOF_PTRDIFF_T): definition removed (see NEWS).
315 (HAVE_LONG_LONGS): definition removed (see NEWS).
316 (HAVE_LONG_LONG): definition removed (see NEWS).
317 (HAVE_PTRDIFF_T): definition removed (see NEWS).
318
319 * Makefile.am: scmconfig.h is now generated by building and
320 running gen-scmconfig.h and capturing its output. gen-scmconfig
321 uses config.h and the configure.in generated gen-scmconfig.h to
322 decide what to output. See gen-scmconfig.c for details.
323 (noinst_PROGRAMS): add gen-scmconfig.
324 (gen_scmconfig_SOURCES): new variable.
325 (gen-scmconfig.$(OBJEXT)): new target - be careful to handle
326 cross-compiling right.
327 (scmconfig.h): build scmconfig.h from gen-scmconfig's output.
328 (BUILT_SOURCES): add scmconfig.h.
329
15635be5 330>>>>>>> 1.1798
25e0bf97
MV
3312003-03-19 Marius Vollmer <mvo@zagadka.de>
332
333 * gc_os_dep.c: Added defines for sparc-unknown-netbsdelf1.5 from
334 Adrian Bunk. Thanks!
335
74b6d6e4
MD
3362003-03-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
337
338 * goops.c (make_class_from_template): New fourth arg:
339 applicablep.
340 (scm_class_extended_generic_with_setter, scm_class_self): Fixed
341 cpls.
342
343 * smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable.
344
345 * goops.c, objects.c, objects.h (scm_make_extended_class): New
346 second arg: applicablep.
347 (scm_i_inherit_applicable): New function.
348
349 * goops.c, goops.h (scm_class_applicable,
350 scm_class_extended_accessor): New classes.
351
5c9e7dad
DH
3522003-03-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
353
354 * procs.c (scm_procedure_documentation): Removed redundant
355 SCM_NIMP test and replaced other calls to SCM_IMP by more explicit
356 predicates.
357
f8af5c6d
MD
3582003-03-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
359
c614a00b
MD
360 * list.c, list.h (scm_filter, scm_filter_x): New functions.
361
109c2c9f
MD
362 * modules.c (scm_module_import_interface): New function.
363
f8af5c6d
MD
364 * goops.c, goops.h (scm_class_accessor_method): Renamed from
365 scm_class_accessor.
366 (scm_class_accessor): New class.
367
a48d60b1
MD
3682003-03-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
369
370 * goops.c (scm_primitive_generic_generic): Enable primitive
371 generic if not enabled.
372 (scm_sys_goops_loaded): Setup unextended primitive generics.
373
374 * goops.c, goops.h (scm_c_extend_primitive_generic): New function.
375
376 * snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
377 snarf macros.
378
379 * numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
380 testing example. All uses of SCM_GPROC should be converted.)
381
382 * procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
383 scm_assoc.
384
385 * eq.c (scm_equal_p): Turned into a primitive generic.
386
84edc049
RB
3872003-02-27 Rob Browning <rlb@defaultvalue.org>
388
389 * Makefile.am (scmconfig.h): new target -- generate file from
390 ../config.h.
391 (modinclude_HEADERS): remove version.h.
392 (nodist_modinclude_HEADERS): add version.h.
393
ea5c9285
MD
3942003-02-24 Mikael Djurfeldt <djurfeldt@nada.kth.se>
395
b4a1358c
MD
396 This fixes a serious GC bug, introduced during the latest
397 reorganization of the GC, which disabled freeing of structs and
398 GOOPS objects:
399
400 * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
401 SCM_EOL.
53af8255
MD
402 (scm_struct_prehistory): Move scm_free_structs to
403 scm_before_mark_c_hook.
ea5c9285 404
b4a1358c
MD
405 * gc-card.c (sweep_card): Check that we haven't swept structs on
406 this card before. That can happen if scm_i_sweep_all_segments has
407 been called from some other place than scm_igc.
408
c35738c1
MD
4092003-02-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
410
231a4ea8
MD
411 * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31
412 (since hash tables now adapt their size).
413
414 * modules.c (scm_modules_prehistory): Changed from 2001 to 1533
415 (current number of prehistory bindings; hashtable code will select
416 a prime which is greater than this value).
417
418 * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139
419 (current number of initial symbols).
420
421 * properties.c (scm_init_properties): Don't specify size of
422 scm_properties_whash.
423
424 * objprop.c (scm_init_objprop): Don't specify size of
425 scm_object_whash.
426
427 * keywords.c (scm_init_keywords): Don't specify a hash table size.
428
c35738c1
MD
429 * hooks.c (scm_c_hook_add): Fixed bug in append mode.
430
431 The following changes introduce the use of resizable hash tables
432 throughout Guile. It also renames the old *-hash-table* functions
433 to *-alist-vector* and places them, together with the rest of the
434 weak vector support, in the module (ice-9 weak-vector). We should
435 probably introduce a new, better, API for weak references, for
436 example "weak pairs" a la MIT-Scheme. (In Chez scheme, they even
437 look like and are used like ordinary pairs.)
438
439 * environments.c (obarray_enter, obarray_retrieve, obarray_remove,
440 leaf_environment_fold, obarray_remove_all): Use hashtable
441 accessors.
442
443 * gc.c (scm_init_storage): Moved hook initialization to
444 scm_storage_prehistory.
445 (scm_storage_prehistory): New function.
446 (scm_igc): Added commentary about placement of
447 scm_after_sweep_c_hook.
448
449 * gc-mark.c (scm_mark_all): Use hashtable accessors.
450 (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and
451 SCM_WVECT_WEAK_VALUE_P.
452
453 * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New
454 functions.
455 (scm_vector_to_hash_table, scm_c_make_resizing_hash_table):
456 Removed.
457 (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table,
458 scm_make_doubly_weak_hash_table): Moved here from weaks.c.
459
460 * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added
461 calls to scm_storage_prehistory and scm_hashtab_prehistory.
462
463 * modules.c (module-reverse-lookup): Use hashtable accessors.
464
465 * symbols.c, symbols.h (scm_i_hash_symbol): New function.
466
467 * weaks.c, weaks.h (scm_make_weak_key_alist_vector,
468 scm_make_weak_value_alist_vector,
469 scm_make_doubly_weak_alist_vector): New functions.
470
471 * weaks.c (scm_init_weaks_builtins): New function.
472
473 * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE,
474 SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P,
475 SCM_WVECT_NOSCAN_P): New macros.
476
477 * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P
478 and SCM_WVECT_WEAK_VALUE_P.
479
480 * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from
481 allocate_weak_vector and exported.
482
0a4c1355
MD
4832003-02-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
484
485 * hashtab.c: Undid thread safety. (We decided that it's better to
486 let the user explicitly protect the tables (or not) according what
487 is suitable for the application.)
488
87ca11ff
MD
4892003-02-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
490
491 * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made
492 thread safe and handle resizing tables.
493 (scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed
494 SCM_DEFER/ALLOW_INTS.
495
f59a096e
MD
4962003-02-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
497
498 * hashtab.c (scm_vector_to_hash_table,
499 scm_c_make_resizing_hash_table, scm_make_hash_table): New
500 functions.
501 (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread
502 safe and handle resizing tables.
503
504 * weaks.c (scm_make_weak_key_hash_table,
505 scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table):
506 Size argument made optional. Return resizable table if not
507 specified.
508
4b612c5b
MD
5092003-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
510
511 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
512 Fixed formals tests for closures. (Thanks to Kevin Ryde.)
513
b3d7f6df
MD
5142003-02-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
515
516 * debug.c (scm_procedure_source): Handle all objects for which
517 procedure? is #t. (Thanks to Bill Schottstaedt.)
518
756414cf
MD
5192003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se>
520
361d631f
MD
521 * futures.c (mark_futures): Don't need to mark data of recycled
522 futures.
523 (scan_futures, cleanup_undead): Be smarter about marking
524 futures---avoid unnecessary passes through future lists.
525
756414cf
MD
526 * futures.h, futures.c: New files; Introduced recycling of
527 futures. For fine-grained threading this lifts performance to
528 another level. We can now use parallelization in inner loops of
529 Guile programs without impossible overhead.
530
531 * threads.h, threads.c: Moved futures to their own file.
532
533 * Makefile.am (libguile_la_SOURCES): Added futures.c.
534 (DOT_X_FILES): Added futures.x.
535 (DOT_DOC_FILES): Added futures.doc.
536 (modinclude_HEADERS): Added futures.h.
537
538 * threads.c, threads.h (scm_i_create_thread): Renamed from
539 create_thread and made global.
540
541 * futures.c (scm_make_future): New procedure.
542
543 * eval.c: #include "libguile/futures.h".
544
545 * init.c: #include "futures.h"
546 (scm_init_guile_1): Call scm_init_futures.
547
548 * stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK.
549
550 * stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here.
551
552 * eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New
553 functions.
554
555 * eval.c (scm_trampoline_1): Fixed arguments test for closures.
556
b4debead
MD
5572003-01-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
558
559 * threads.c (create_thread): Don't unwind dynwind chain of parent
560 thread before creation. Just start the new thread with an empty
561 dynwind chain.
562
93f26b7b
MD
5632003-01-20 Mikael Djurfeldt <djurfeldt@nada.kth.se>
564
565 * evalext.c, evalext.h (scm_self_evaluating_p): New function.
566
38d8927c
MD
5672003-01-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
568
41c96c32
MD
569 * threads.c (scm_timed_wait_condition_variable): Support timed
570 waiting also for simple condition variables.
571
38d8927c
MD
572 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
573 of calling the procedure change-object-class.
574
9cf5d9b7
MD
5752003-01-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
576
577 * ramap.c (scm_ramapc): Typo in error message.
578
bbf8d523
MD
5792003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
580
b46fae00
MD
581 * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
582 slots with instance allocation.
583
bbf8d523
MD
584 * goops.c, goops.h (scm_class_extended_generic_with_setter): New
585 class.
586 (scm_compute_applicable_methods): Use scm_generic_function_methods.
587
588 * goops.c (scm_generic_function_methods): Support extended
589 generic functions.
590
ebf9b47c
MD
5912002-12-29 Mikael Djurfeldt <djurfeldt@nada.kth.se>
592
593 * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future.
2e37d6a2 594 Thanks to Neil for pointing this out!
ebf9b47c 595
14a9ba3f
NJ
5962002-12-29 Neil Jerram <neil@ossau.uklinux.net>
597
598 * lang.h: Remove declarations matching definitions removed from
599 lang.c (just below).
600
c6a040a8
NJ
6012002-12-28 Neil Jerram <neil@ossau.uklinux.net>
602
6054d805
NJ
603 * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null,
604 scm_m_while, scm_nil_eq): Remove definitions that were superfluous
605 and already commented out.
606
c6a040a8
NJ
607 * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token,
608 scm_lreadparen): Support reading vectors with Elisp syntax if
609 SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS
610 is not currently defined, and there isn't even a configure switch
611 to enable it yet.)
612
3742c12f
MV
6132002-12-26 Marius Vollmer <mvo@zagadka.ping.de>
614
615 * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath
616 builds work.
617 (EXTRA_DIST): Added version.h.in.
618
fb50ef08
MD
6192002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se>
620
621 This change makes it possible for one thread to do lazy sweeping
622 while other threads are running. Now only the mark phase need to
623 have all threads asleep. We should look further into this issue.
624 Presently, I've put the locking of scm_i_sweep_mutex at
625 "conservative" places due to my current lack of knowledge about
626 the garbage collector. Please feel free to restrict these regions
627 further to allow for maximal parallelism!
628
629 * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
630
631 * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
632 scm_gc_register_collectable_memory): Substitute locking of
633 scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
634 (scm_igc): Lock sweep mutex here instead of in callers; Calls to
635 scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
636 the single-thread section (which now only contains the mark
637 phase).
638 (scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
639 Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly.
640
641 * threads.c (gc_section_mutex): Removed.
642
9ed24633
MD
6432002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net>
644
0d48aca5
MD
645 * threads.c (create_thread): Clear parent field in root state in
646 order not to unnecessarily remember dead threads.
647
9ed24633
MD
648 * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
649 (scm_trampoline_1, scm_trampoline_2): Use them.
650
29717c89
MD
6512002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
652
653 Partial introduction of real plugin interface.
654
655 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
656 (EXTRA_DIST): Added threads-plugin.c.
657
658 * threads-plugin.h, threads-plugin.c: New files.
659
660 * threads.h: #include "libguile/threads-plugin.h".
661
662 * threads.c: #include "libguile/threads-plugin.c".
663
664 * pthread-threads.c: Temporarily remove debugging functions.
665
666 * threads.c, threads.h (scm_yield): Added back.
667
e29e0b09
MD
6682002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
669
670 * threads.c (really_launch): Detach before unlocking
671 thread_admin_mutex in order not to risk being joined.
672 (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
673 thread_admin_mutex locked during GC.
674
675 * pthread-threads.c, pthread-threads.h: Improvements to debugging
676 functions.
677
0b6843b1 6782002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
93cd4dcd 679
6da2dfc4
MD
680 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
681 support for debugging mutex operations.
682
1b92fb6b
MD
683 * threads.c (scm_thread): Removed filed joining_threads.
684 (thread_print): Print thread number as well as address of thread
685 structure.
0b6843b1
MD
686 (scm_join_thread): Bugfix.
687 (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
688 scm_timed_wait_condition_variable, scm_signal_condition_variable,
689 scm_broadcast_condition_variable): Use the low-level API.
690 (scm_all_threads): Return copy of thread list (to prevent
691 unintended destruction).
692 (scm_threads_prehistory): Initialize heap_mutex of fake thread.
1b92fb6b 693
93cd4dcd
MD
694 * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
695 pthread "native" recursive mutex support.
696
2ff4f181
MD
6972002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
698
28d52ebb
MD
699 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
700 Simply lock a thread C API recursive mutex.
701 (SCM_NONREC_CRITICAL_SECTION_START,
702 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
703 SCM_REC_CRITICAL_SECTION_END): Removed.
704
705 * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
706 direct calls to scm_rec_mutex_lock / unlock around the three calls
707 to scm_m_expand_body.
708
709 * eval.c, eval.h (promise_free): New function.
710 (scm_force): Rewritten; Now thread-safe; Removed
711 SCM_DEFER/ALLOW_INTS.
712
713 * pthread-threads.h: Added partially implemented plugin interface
714 for recursive mutexes. These are, for now, only intended to be
715 used internally within the Guile implementation.
716
717 * pthread-threads.c: New file.
718
719 * threads.c: Conditionally #include "pthread-threads.c".
720
721 * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
722 thread-safe;
723
724 * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
725 SCM_GLOBAL_REC_MUTEX): New macros.
726
727 * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
728 macros---use mutexes instead.
729
730 * tags.h (SCM_IM_FUTURE): New tag.
731
732 * eval.c (scm_m_future): New primitive macro.
733 (SCM_CEVAL): Support futures.
734 (unmemocopy): Support unmemoization of futures.
735
736 * print.c (scm_isymnames): Name of future isym.
737
2ff4f181
MD
738 * version.c: Unmade some changes to my private copy that got
739 committed by mistake.
740
392d2833
MD
7412002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net>
742
e200ddee
MD
743 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
744 2002-12-10.
745
392d2833
MD
746 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
747
748 * gc.c (scm_gc_sweep): Call it here instead, which is a more
749 logical place.
750
751 * threads.c (create_thread): Remember root object until the handle
752 of the new thread is on all_threads list.
753
754 * root.c (scm_make_root): Moved copying of fluids until after
755 creation of root handle so that the fluids are GC protected. Also
756 removed the critical section.
757
c4c52ebe
MD
7582002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
759
960c408c
MD
760 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
761
3cdde9d6 762 * gc-malloc.c (malloc_mutex): New mutex.
960c408c 763 (scm_gc_malloc_prehistory): Initialize it.
3cdde9d6
MD
764 (scm_realloc): Serialize call to realloc
765 (scm_calloc): Same for calloc.
766 Thanks to Wolfgang Jaehrling!
767 (Now we have to make sure all calls to malloc/realloc are made
768 through scm_malloc.)
769
960c408c
MD
770 * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
771
c4c52ebe
MD
772 * threads.c (really_launch): Release heap (to prevent deadlock).
773 (create_thread): Release heap before locking thread admin mutex.
774
b0dc3d71
MD
7752002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
776
777 * threads.c (scm_i_thread_invalidate_freelists): New
778 function.
779
780 * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
781
782 * modules.c (scm_export): Inserted a return statement.
783
06e80f59
HWN
7842002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl>
785
786 * modules.c (scm_export): new function
787
788 * gc-card.c: add a note about malloc()/free() overhead.
789
a12611c3
MD
7902002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
791
792 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
793 in srcdir.
794
c7fabadf
MD
7952002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
796
797 These changes remove scm_ints_disabled (which hasn't has any
798 effect in Guile for quite some time).
799
800 * async.c, error.h (scm_ints_disabled): Removed.
801
802 * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
803 root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
804 SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
805 (old_ints): Removed.
806
807 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
808 critical section.
809 (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
810 SCM_ALLOW_INTS.
811
9bc4701c
MD
8122002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
813
52340b65
MD
814 * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
815 Removed accidental #if 0 around these functions.
816
9bc4701c
MD
817 These changes are the start of support for preemptive
818 multithreading. Marius and I have agreed that I commit this code
819 into the repository although it isn't thoroughly tested and surely
820 introduces many bugs. The bugs should only be exposed when using
821 threads, though. Signalling and error handling for threads is
822 very likely broken. Work on making the implementation cleaner and
823 more efficient is needed.
824
825 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
826 (SCM_NONREC_CRITICAL_SECTION_START,
827 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
828 SCM_REC_CRITICAL_SECTION_END): New macros.
829 (SCM_CRITICAL_SECTION_START/END): Defined here.
830
831 * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
832 the three calls to scm_m_expand_body.
833
834 * gc.h: #include "libguile/pthread-threads.h";
835 (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.
836
837 * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
838 scm_t_key;
839
840 * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
841 access.
842
843 * gc-freelist.c (scm_gc_init_freelist): Create freelist keys.
844
845 * gc-freelist.c, threads.c (really_launch): Use
846 SCM_FREELIST_CREATE.
847
848 * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):
849
850 * gc.c (scm_i_expensive_validation_check, scm_gc,
851 scm_gc_for_newcell): Put threads to sleep before doing GC-related
852 heap administration so that those pieces of code are executed
853 single-threaded. We might consider rewriting these code sections
854 in terms of a "call_gc_code_singly_threaded" construct instead of
855 calling the pair of scm_i_thread_put_to_sleep () and
856 scm_i_thread_wake_up (). Also, we would want to have as many of
857 these sections eleminated.
858
859 * init.c (scm_init_guile_1): Call scm_threads_prehistory.
860
861 * inline.h: #include "libguile/threads.h"
862
863 * pthread-threads.h: Macros now conform more closely to the
864 pthreads interface. Some of them now take a second argument.
865
866 * threads.c, threads.h: Many changes.
867
8682002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
869
870 * Makefile.am (version.h): Changed $^ --> $< in rule for
871 version.h.
872
b2cbe8d8
RB
8732002-12-08 Rob Browning <rlb@defaultvalue.org>
874
875 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
876 (SCM_MINOR_VERSION): use @--@ substitution now.
877 (SCM_MICRO_VERSION): use @--@ substitution now.
878 (scm_effective_version): new function prototype.
879
880 * version.c (scm_effective_version): new function, also add
881 effective-version.
882
883 * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
884 (libpath.h): use GUILE_EFFECTIVE_VERSION to compute
885 SCM_LIBRARY_DIR.
886 (version.h): generate this here rather than configure.in. This
887 approach tracks source edits better (i.e. more immediately).
888 Might be worth considering for other .in files too.
889
5441c65c
MV
8902002-12-02 Marius Vollmer <mvo@zagadka.ping.de>
891
892 Reorganized thread package selection. A thread package now only
893 implements a small set of pthread like functions and Guile
894 implements the rest on top of that. Guile's implementation is
895 what the "coop-pthreads" package has been previously. Support for
896 "coop" threads has been removed until I get time to add it again.
897
898 * Makefile.am (libguile_la_SOURCES): Removed iselect.c.
899 (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
900 null-threads.c, coop-pthreads.c.
901 (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added
902 pthread-threads.h.
903
904 * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h.
905
906 * threads.h: Do not include "libguile/coop-defs.h". Include
907 "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed
908 (previously deprecated) C level thread API prototypes. They are
909 now in the thread package specific headers, "null-threads.h" and
910 "pthread-threads.h".
911 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
912 New.
913 (scm_threads_init): Removed.
914 (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
915 SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
916 SCM_I_THREAD_SWITCH_COUNT): Define here.
917 (scm_single_thread_p): Removed.
918 (scm_call_with_new_thread): Take two args directly instead of list
919 of two args.
920 (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
921 SCM_SET_THREAD_LOCAL_DATA): Define here.
922
923 * threads.c: Merged with "coop-pthreads.c".
924
925 * null-threads.h: Implement pthread-like API as a set of macros.
926
927 * pthread-threads.h: New, implement pthread-like API by deferring
928 to pthread itself.
929
930 * init.c (scm_init_guile_1): Do not call scm_init_iselect, which
931 has been lost in the reorganization.
932
504d99c5
MD
9332002-12-01 Mikael Djurfeldt <mdj@linnaeus>
934
935 The following change makes it possible to move procedure
936 application dispatch outside inner loops. The motivation was
937 clean implementation of efficient replacements of R5RS primitives
938 in SRFI-1.
939
940 The semantics is clear: scm_trampoline_N returns an optimized
941 version of scm_call_N (or NULL if the procedure isn't applicable
942 on N args).
943
944 Applying the optimization to map and for-each increases efficiency
945 noticeably. For example, (map abs ls) is 8 times faster than
946 before.
947
948 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
949
950 * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.
951
952 * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
953 (map, for-each): Handle also application on two args as a special
954 case; Use trampolines.
955
956 Other changes:
957
958 * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
959 (subr2oless): Removed.
960 (scm_restricted_vector_sort_x): Use scm_return_first to keep the
961 vector GC protected.
962
963 * eval.c (check_map_args): Use scm_out_of_range_pos instead of
964 scm_out_of_range.
965
63dd3413
DH
9662002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
967
968 * evalext.[ch] (scm_m_undefine, undefine): Deprecated.
969
4ba5f279
MD
9702002-11-17 Mikael Djurfeldt <mdj@linnaeus>
971
972 * debug.c (scm_make_iloc): Added missing "return".
973
56ae231f
MV
9742002-11-17 Marius Vollmer <mvo@zagadka.ping.de>
975
976 * strports.c (scm_eval_string_in_module): Validate second arg to
977 be a module. Thanks to Arno Peters!
978
80b28865
DH
9792002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
980
981 * .cvsignore: remove goops.c
982
c88b1456
DH
9832002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
984
985 * modules.c (scm_env_top_level, scm_lookup_closure_module,
986 module_variable, scm_module_lookup_closure,
987 scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
988 scm_system_module_env_p): Don't compare SCM values with C
989 operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP
990 over SCM_NFALSEP.
991
a8a19efc
DH
9922002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
993
994 * eval.h (SCM_MAKE_ILOC): New macro.
995
996 * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing
997 the iloc bitpattern here.
998
76734914
MD
9992002-11-14 Mikael Djurfeldt <mdj@linnaeus>
1000
1001 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
1002 part of the API, otherwise it's difficult to write Guile
1003 extensions using non-blocking I/O => moved #include
1004 "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.
1005
1006 * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
1007 s_unlock_mutex.
1008
8b5b4a75
MV
10092002-11-10 Marius Vollmer <mvo@zagadka.ping.de>
1010
1011 * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They
1012 are defined in configure.in.
1013
1014 * threads.c: Removed SCM_API from function definitions. SCM_API
1015 is only for declarations.
1016
e5a83084
MD
10172002-11-07 Mikael Djurfeldt <mdj@linnaeus>
1018
9be8bb45
MD
1019 * coop-pthreads.h: Added support for thread specific data to the
1020 generic C API for the coop-pthreads case.
1021
e5a83084
MD
1022 * threads.c, threads.h (scm_cond_init): Undo unintentional API
1023 change.
6c214b62 1024 (scm_cond_broadcast): Added missing function.
e5a83084 1025
7edf178e
MV
10262002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1027
1028 * coop.c (coop_next_runnable_thread): Removed, wich should have
1029 happened when GUILE_ISELECT was hard-wired.
1030
7f5b1b77
MV
10312002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
1032
7caa1b07
MV
1033 * Makefile.am (libguile_la_SOURCES): Added threads.c
1034 (DOT_DOC_FILES): Added threads.doc.
1035 (DOT_X_FILES): Added threads.x.
1036 (EXTRA_libguile_la_SOURCES): Removed threads.c.
1037 (noinst_HEADERS): Added coop-pthreads.c.
1038 (modinclude_HEADERS): Added coop-pthreads.h.
1039
1040 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
1041 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
1042
bb11cbf4
MV
1043 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
1044 Thanks to Bill Schottstaedt!
1045
1d4cbbed
MV
1046 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
1047
7f5b1b77
MV
1048 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
1049 SCM_COPT_THREADS is defined.
1050 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
1051 is defined.
1052
1053 * coop-pthreads.c: Some harmless renamings of internal stuff.
1054 (create_thread): New, generalized version of
1055 scm_call_with_new_thread.
1056 (scm_call_with_new_thread): Use it.
1057 (scm_spawn_thread): New, use create_thread.
1058
d52f53b1
MV
10592002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
1060
1061 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
1062 start testing it now.
1063
1064 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
1065 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
1066 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
1067 is defined.
1068
30f920c3
MV
10692002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
1070
1071 * scmsigs.c (signal_cell_handlers, install_handler_data,
1072 scm_delq_spine_x, really_install_handler, install_handler): New
1073 scheme for triggering signal handlers, to simplify take_signal.
1074 (take_signal): Simplified, to avoid race conditions.
1075 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
1076 hasn't exited yet.
1077
1078 * async.c (scm_async_click): Reset pending_asyncs, handle
1079 signal_asyncs. Don't set cdr of a non-signal async to #f.
1080 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
1081 always. Set pending_asyncs.
1082 (scm_system_async_mark_for_thread): Check that thread has not
1083 exited.
1084 (scm_unmask_signals, decrease_block): Call scm_async_click after
1085 block_asyncs becomes zero.
1086
1087 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
1088 active_asyncs.
1089
1090 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
1091 fields.
1092 * root.c (root_mark): Mark them.
1093 (make_root): Initialize them.
1094
1095 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
1096 USE_COOP_THREADS.
1097 (scm_internal_select): Define one version for USE_COOP_THREADS and
1098 one for USE_NULL_THREADS.
1099 (scm_init_iselect): Likewise.
1100
1101 * inline.h (scm_cell, scm_double_cell): Also allow
1102 USE_COPT_THREADS to not protect the slot initializers.
1103
1104 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
1105 because threads need to be initialized before the stack, but
1106 gsubrs such as scm_timed_condition_variable_wait can only be
1107 created later.
1108
1109 * threads.h: Include "coop-pthreads.h" when requested.
1110 (scm_threads_make_mutex, scm_threads_lock_mutex,
1111 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
1112 not implemented anyway.
1113 (scm_init_thread_procs, scm_try_mutex,
1114 scm_timed_condition_variable_wait,
1115 scm_broadcast_condition_variable, scm_c_thread_exited_p,
1116 scm_thread_exited_p): New prototypes.
1117 (struct timespec): Define if not already defined.
1118 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
1119 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
1120 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
1121 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
1122 deprecated.
1123
1124 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
1125 requested.
1126 (scm_thread_exited_p): New.
1127 (scm_try_mutex, scm_broadcast_condition_variable): Newly
1128 registered procedures.
1129 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
1130 Use the latter as the procedure for "wait-condition-variable",
1131 thus offering a optional timeout parameter to Scheme.
1132 (scm_wait_condition_variable): Implement in terms of
1133 scm_timed_wait_condition_variable.
1134 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
1135 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
1136 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
1137 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
1138 scm_make_mutex, etc, and deprecate.
1139 (scm_init_threads): Do not create smobs, leave this to
1140 scm_threads_init. Do not include "threads.x" file.
1141 (scm_init_thread_procs): New, include "threads.x" here.
1142
1143 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
1144 scm_null_mutex_lock, scm_null_mutex_unlock,
1145 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
1146 scm_null_condvar_wait, scm_null_condvar_signal,
1147 scm_null_condvar_destroy): Removed.
1148 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
1149 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
1150 scm_cond_destory): Do not define, they are now deprecated and
1151 handled by threads.{h,c}.
1152
1153 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
1154 (scm_threads_init): Create smobs here, using the appropriate
1155 sizes.
1156 (block): Removed, now unused.
1157 (scm_c_thread_exited_p): New.
1158 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
1159 scm_null_mutex_destroy, scm_null_condvar_init,
1160 scm_null_condvar_wait, scm_null_condvar_signal,
1161 scm_null_condvar_destroy): Removed and updated users to do their
1162 task directly.
1163 (scm_try_mutex, timeval_subtract,
1164 scm_timed_wait_condition_variable,
1165 scm_broadcast_condition_variable): New.
1166 (scm_wait_condition_variable): Removed.
1167
1168 * coop-defs.h (coop_m): Added 'level' field.
1169 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
1170 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
1171 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
1172 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
1173 define.
1174 (coop_condition_variable_broadcast): New.
1175
1176 * coop-threads.c (scm_threads_init): Create smobs here, using the
1177 appropriate sizes.
1178 (scm_c_thread_exited_p, scm_try_mutex,
1179 scm_timed_wait_condition_variable,
1180 scm_broadcast_condition_variable): New.
1181 (scm_wait_condition_variable): Removed.
1182
1183 * coop.c (coop_new_mutex_init): Initialize level.
1184 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
1185 level.
1186 (coop_condition_variable_signal): Renamed to
1187 coop_condition_variable_broadcast and reimplemented in terms of
1188 that. Thus...
1189 (coop_condition_variable_broadcast): New.
1190
1191 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
1192
1193 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
1194
087ed40d
MV
11952002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
1196
65a23095
MV
1197 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
1198 of system headers.
1199
087ed40d
MV
1200 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
1201 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 1202 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 1203
5ec1d2c8
DH
12042002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
1205
1206 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
1207 scm_definedp to scm_defined_p and deprecated scm_definedp.
1208
100ae50d
DH
12092002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
1210
1211 * async.h, async.c (scm_system_async): Fixed deprecation to work
1212 correctly when deprecated features are excluded.
1213
2794cb50
MV
12142002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1215
1216 * async.c (scm_system_async_mark_for_thread): Validate thread
1217 argument.
1218
1219 * coop-threads.c (scm_i_thread_root): Do not validate argument.
1220
1221 * feature.c (scm_init_feature): Don't add 'threads' for
1222 USE_NULL_THREADS.
1223
1224 * inline.h (scm_cell, scm_double_cell): Also allow
1225 USE_NULL_THREADS to not protect the slot initializers.
1226
1227 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
1228 "USE_THREAD".
1229
1230 * Makefile.am (noinst_HEADERS): Added null-threads.c.
1231 (modinclude_HEADERS): Added null-threads.h.
1232
1233 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
1234 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
1235 (scm_init_threads): Use generic type names scm_t_mutex and
1236 scm_t_cond instead of coop_m and coop_c.
1237
1238 * null-threads.c, null-threads.h: New files.
1239
ff810d7a
MV
12402002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
1241
1242 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
1243 This is to support makes that know about "$<" only in pattern
1244 rules, like Sun's make.
1245
a90bdb73
MV
12462002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
1247
1248 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
1249 substitution. Thanks to David Allouche!
1250
e71a8bf2
DH
12512002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
1252
1253 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
1254 !SCM_ENABLE_DEPRECATED.
1255
41f77ff5
MV
12562002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1257
504d99c5 1258 * async.c (scm_system_async_mark_for_thread): Only call
41f77ff5
MV
1259 scm_i_thread_root when USE_THREADS is defined. Use scm_root
1260 otherwise.
1261
1262 * scmsigs.c (take_signal): Only call scm_i_thread_root when
1263 USE_THREADS is defined. Use scm_root otherwise.
1264 (scm_sigaction_for_thread): Ignore THREAD argument when
1265 USE_THREADS is not defined. Also, move THREAD argument defaulting
1266 out of HAVE_SIGACTION section, which was a bug.
1267
6d16b125
MV
12682002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1269
1270 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
1271 signal_handlers, not the closure that is used as the async.
1272 The closure is stored in signal_handler_cells, as previously.
1273
acfa1f52
MV
12742002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
1275
1276 * root.h (scm_root_state): Added 'block_async' slot.
1277 (scm_active_asyncs): Removed abbrev.
1278 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
1279
1280 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
1281 abbrev.
1282
1283 * async.h (scm_call_with_blocked_asyncs,
1284 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
1285 scm_c_call_with_unblocked_asyncs): New prototypes.
1286 (scm_mask_signals, scm_unmask_signals): Deprecated.
1287 (scm_mask_ints): Turned into a macro.
1288 * async.c (scm_mask_ints): Removed.
1289 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
1290 this should not be necessary.
1291 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
1292 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
1293 deprecation warning and check for errornous use. Set block_asyncs
1294 instead of scm_mask_ints.
1295 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
1296 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
1297 scm_c_call_with_unblocked_asyncs): New.
1298
1299 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
1300 Asyncs are enabled by default.
1301
34010f56
NJ
13022002-10-09 Neil Jerram <neil@ossau.uklinux.net>
1303
1304 * vports.c (scm_make_soft_port): Allow vector argument to carry a
1305 6th element: an input waiting thunk.
1306 (sf_input_waiting): New.
1307
9310d6f2
MV
13082002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
1309
1310 * root.c (root_mark): Mark active_asyncs slot.
1311
1312 * async.c (scm_async_click): Set the cdr of a executed handler
1313 cell to SCM_BOOL_F, not SCM_EOL.
1314 (scm_i_queue_async_cell): Queue the cell at the end of the list,
1315 and only if the handler procedure is not already present.
1316 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
1317 with SCM_BOOL_F.
1318 * scmsigs.c (scm_sigaction_for_thread): Likewise.
1319
ac48c719
RB
13202002-10-04 Rob Browning <rlb@defaultvalue.org>
1321
1360a142
RB
1322 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
1323
1324 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
1325 scm_lt_dlopenext, and scm_lt_dlerror.
1326 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
1327 and scm_lt_dlerror.
1328 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
1329 and scm_lt_dlerror.
1330 (sysdep_dynl_init): switch to scm_lt_dlinit();
1331
1332 * Makefile.am (libguile_la_LIBADD): switch to use
1333 libguile-ltdl.la.
1334
504d99c5 1335 * numbers.c (scm_integer_expt): (expt 0 1) should be 1.
ac48c719 1336
497092c9
MV
13372002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
1338
1339 * scmsigs.h (scm_sigaction_for_thread): New prototype.
1340 * scmsigs.c (got_signal): Removed.
1341 (signal_handler_cells, signal_handler_threads): New.
1342 (take_signal): Queue the cell of the signal for the specified
1343 thread. Reset the signal handler on systems that don't have
1344 sigaction.
1345 (sys_deliver_signals): Removed.
1346 (close_1): New.
1347 (scm_sigaction_for_thread): Renamed from scm_sigaction and
1348 extended to also set the thread of a signal and allocate a cell
1349 for it. Keep the Scheme name "sigaction". Check that signum is
1350 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
1351 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
1352 (scm_init_scmsigs): Allocate signal_handler_cells and
1353 signal_handler_threads vectors.
1354
1355 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
1356 that system asnycs and user asyncs are separated. Reimplemented
1357 system asyncs to work per-thread.
1358
1359 * gc.c (scm_init_gc): Do not use scm_system_async.
1360
1361 * async.h (scm_asyncs_pending, scm_set_tick_rate,
1362 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
1363 Removed prototypes.
1364 (scm_i_queue_async_cell): New.
1365
1366 * __scm.h (scm_asyncs_pending_p): Removed.
1367 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
1368 scm_asyncs_pending_p.
1369
1370 * async.h (scm_system_async_mark_for_thread): New prototype.
1371
1372 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
1373
1374 * root.h (scm_root_state): Added new "active_asyncs" slot.
1375 * root.c (scm_make_root): Initialize it to SCM_EOL.
1376
1377 * coop-defs.h (coop_t): Added new "handle" slot.
1378 * coop-threads.c (all_threads, scm_current_thread,
1379 scm_all_threads, scm_i_thread_root): New.
1380 (scm_threads_init): Add main thread to all_threads.
1381 (scheme_launch_thread): Remove thread from all_threads when it
1382 terminates.
1383 (scm_call_with_new_thread): Initialize handle slot of coop_t
1384 structure and add new thread to all_threads.
1385 (scm_spawn_thread): Likewise.
1386
1387 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
1388 * threads.c (scm_current_thread, scm_all_threads): Register as
1389 primitives.
1390
1391 * dynl.c: Use scm_lt_ prefix for libltdl functions.
1392
480fa28d
NJ
13932002-09-29 Neil Jerram <neil@ossau.uklinux.net>
1394
1395 * script.c (scm_compile_shell_switches): Fix bad spelling of
1396 `explicitly' in comment.
1397
13982002-09-28 Neil Jerram <neil@ossau.uklinux.net>
1399
1400 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
1401 Refer to provided? in doc string rather than deprecated feature?.
1402
3553e1d1
GH
14032002-09-24 Gary Houston <ghouston@arglist.com>
1404
1405 * inline.h (scm_double_cell): prevent reordering of statements
1406 with any following code (for GCC 3 strict-aliasing).
1407 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
1408 the earlier version of the reordering prevention.
1409
4ad0814a
HWN
14102002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1411
1412 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
1413
e88e4f2e
HWN
14142002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1415
1416 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
1417 protection.
1418
1e71eafb
HWN
14192002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1420
1421 * inline.h: include stdio.h
1422
1423 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
1424
61ef9c1f
HWN
14252002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1426
dac04e9f
HWN
1427 * gc-segment.c (scm_i_make_initial_segment): check user settings
1428 for sanity.
1429
1430 * gc-malloc.c (scm_gc_init_malloc): check user settings for
1431 sanity.
dac04e9f
HWN
1432
1433 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
1434
ffd72400
HWN
1435 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
1436
1437 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
1438 these won't ever wrap around with high memory usage. Thanks to
1439 Sven Hartrumpf for finding this.
ffd72400 1440
5bd4a949
HWN
1441 * gc-freelist.c: include <stdio.h>
1442
61ef9c1f
HWN
1443 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
1444
ffd0ef3b
MV
14452002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
1446
a27e3d14
MV
1447 * vectors.h (SCM_VECTOR_REF): New.
1448
ffd0ef3b
MV
1449 * snarf.h (SCM_DEFINE_PUBLIC): New.
1450
f8a1712b
MV
14512002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
1452
1453 * socket.c (scm_addr_vector): Added size of address to arguments.
1454 Use it to avoid accessing a non-existent path in a sockaddr_un.
1455 Changed all callers.
1456
7200a36b
HWN
14572002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1458
1383773b
HWN
1459 * gc.h: remove DOUBLECELL card flags.
1460
1461 * gc-malloc.c (scm_calloc): try to use calloc() before calling
1462 scm_realloc().
1463
1464 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
1465 init loop; handle this from scm_init_card_freelist()
1466
1467 * gc-card.c (scm_init_card_freelist): init bit vector here.
1468
7200a36b 1469 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 1470 num2float.i.c (FLOAT2NUM): idem
7200a36b 1471
9981de3a
HWN
14722002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1473
1474 * eval.h: prepend libguile/ to include path
1475
19647556
MV
14762002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
1477
1478 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
1479