* sort.c, pairs.h: Removed unnecessary includes.
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
c178c3a6
DH
12003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
2
3 * sort.c, pairs.h: Removed unnecessary includes.
4
d339981a
DH
52003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
6
7 * sort.c: Replaced hand-made trampline code by the new official
8 mechanism from eval.c. This fixes a segfault in the new test file
9 sort.test.
10
11 (quicksort, compare_function, scm_restricted_vector_sort_x,
12 scm_sorted_p, scm_merge, scm_merge_list_x, scm_merge_x,
13 scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x,
14 scm_merge_vector_step, scm_stable_sort_x, scm_stable_sort,
15 scm_sort_list_x, scm_sort_list): Use trampoline mechanism from
16 eval.c.
17
18 (subr2less, lsubrless, closureless, applyless, scm_cmp_function,
19 cmp_fun_t): Removed.
20
21 (compare_function): Added.
22
23 * sort.c (quicksort, SWAP, stack_node): Replaced pointer
24 arithmetics with index arithmetics. Changed quicksort to work on
25 an array of SCM values instead of an array of characters. Avoid
26 bytewise copying of SCM elements. Avoid allocating memory on the
27 stack with alloca. Fixed some comments.
28
821f18a4
DH
292003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
30
31 * eval.c (EXTEND_ENV): Eliminated.
32
33 (unmemocopy, SCM_CEVAL, SCM_APPLY): Use SCM_EXTEND_ENV instead of
34 EXTEND_ENV.
35
94fb5a6e
DH
362003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
37
38 * __scm.h (SCM_DEBUG_DEBUGGER_SUPPORT): New compile-time option.
39
40 * gc.card.c (scm_gc_marked_p): Fixed compiler warning when
41 compiling with SCM_DEBUG==1 by moving definition behind prototype.
42
43 * gc.card.c (scm_dbg_t_list_cell, scm_dbg_t_double_cell,
44 scm_dbg_gc_marked_p, scm_dbg_gc_get_card, scm_dbg_gc_get_bvec,
45 scm_t_list_cell_struct, scm_t_list_cell, scm_t_double_cell,
46 scm_gc_marked_p, scm_gc_get_card, scm_gc_get_bvec): Fixed
47 functions such that they check if the object is a non-immediate.
48 Further, renamed identifiers to use the scm_dbg_ prefix and made
49 their inclusion into the lib dependent of the
50 SCM_DEBUG_DEBUGGER_SUPPORT compile time option.
51
fce0b22d
DH
522003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
53
54 * __scm.h: Fixed comment about the SCM_DEBUG_TYPING_STRICTNESS
55 debug option.
56
1685446c
DH
572003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
58
821f18a4 59 * list.c (scm_ilength, scm_last_pair), unif.c (l2ra): Prefer
1685446c
DH
60 !SCM_CONSP over SCM_NCONSP. Now, guile itself does not include
61 any calls to SCM_NCONSP any more.
62
63 * unif.c (l2ra): Eliminate redundant check.
64
9ff1720f
DH
652003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
66
67 * list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product,
68 scm_array_map_x), unif.c (l2ra): Prefer !SCM_NULLP over
69 SCM_NNULLP. Now, guile itself does not include any calls to
70 SCM_NNULLP any more.
71
05b15362
DH
722003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
73
74 * eval.c (unmemocopy, SCM_APPLY, scm_map, scm_for_each,
75 scm_copy_tree): Place assignment expressions which are part of
76 other expressions into an expression of their own.
77
0c88d7df
DH
782003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
79
80 * goops.c (TEST_CHANGE_CLASS, scm_sys_initialize_object): Don't
81 compare SCM values with !=.
82
5cb22e96
DH
832003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
84
85 * eval.c, eval.h, evalext.c, evalext.h (scm_sym_setter,
86 scm_m_generalized_set_x, scm_init_evalext): Move the declaration
87 and definition of the memoizer for the generalized set! macro from
88 evalext.[ch] to eval.[ch]. Use the SCM_SYNTAX snarfer macro to
89 define the macro object.
90
91 * eval.c, eval.h (s_set_x, scm_s_set_x, scm_m_set_x,
92 scm_m_generalized_set_x): Since now scm_s_set_x is only used in
93 eval.c, it is made static and renamed to s_set_x.
94
95 * evalext.c (scm_defined_p, scm_m_undefine): Prefer !SCM_<foo>
96 over SCM_N<foo>.
97
a44a9715
DH
982003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
99
100 * eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds,
101 scm_init_eval): Made scm_undefineds static in eval.c, renamed it
102 to undefineds and registered the object as a permanent object.
103
104 * eval.c, eval.h (scm_f_apply, scm_init_eval): Made scm_f_apply
105 static in eval.c, renamed it to f_apply and registered the object
106 as a permanent object.
107
1b43d24c
DH
1082003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
109
5cb22e96 110 * eval.c (SCM_BIT7, SCM_BIT8, unmemocopy, SCM_CEVAL): Renamed
1b43d24c
DH
111 file-local macro SCM_BIT8 to SCM_BIT7, which is more appropriate.
112
aec16f99
DH
1132003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
114
115 * numbers.c (scm_logtest): Fixed argument bug in the call to
116 mpz_and, which showed up when compiling with SCM_DEBUG defined.
117
f96460ce
DH
1182003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
119
120 * gc-card.c (scm_i_sweep_card, scm_i_init_card_freelist): Fixed
121 type errors that showed up when compiling with SCM_DEBUG defined.
122
d0f6ceb8
DH
1232003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
124
125 * continuations.c, continuations.h, eval.c, eval.h, extensions.c,
126 gsubr.c, guile.c, init.c, read.c, root.c, root.h, stackchk.h,
127 throw.c: Removed uses of DEBUG_EXTENSIONS and DYNAMIC_LINKING to
128 fix compile errors with --disable-deprecated.
129
19a7a089
RB
1302003-04-17 Rob Browning <rlb@defaultvalue.org>
131
132 * numbers.c (scm_integer_expt): fix case where we were declaring
133 vars in the middle of a statement block. Thanks to Thamer
134 Al-Harbash.
135
47cd67db
MD
1362003-04-17 Mikael Djurfeldt <djurfeldt@nada.kth.se>
137
0fd7dcd3
MD
138 * goops.c (TEST_CHANGE_CLASS): Update variable class after class
139 change.
140
47cd67db
MD
141 * eq.c (scm_eqv_p): Turned into a primitive generic.
142
3b8b889c
RB
1432003-04-16 Rob Browning <rlb@defaultvalue.org>
144
312006bb
RB
145 * gc_os_dep.c: Added patch for UnixWare and OpenUNIX support.
146 Thanks to Boyd Gerber.
147 Added check for __arm__ in addition to arm for LINUX and copied
148 __s390__ defines from upstream libgc. Thanks to James Treacy for
149 reporting the problems.
c7ef2ea1 150
3b8b889c
RB
151 * numbers.c (PTRDIFF_MIN): use SCM_CHAR_BIT.
152
153 * socket.c: use SCM_CHAR_BIT.
154
155 * random.c (scm_c_random_bignum): use SCM_CHAR_BIT.
156
157 * num2integral.i.c (NUM2INTEGRAL): use SCM_CHAR_BIT.
158
43261b39
MD
1592003-04-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
160
161 * feature.c (scm_init_feature): Always add threads feature.
162
58241edc
MD
1632003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
164
165 * goops.c (scm_sys_fast_slot_ref): Use SCM_SLOT instead of
166 scm_at_assert_bound_ref. (We don't want the unbound check. See
167 oop/goops/active-slot.scm.)
168
94e91275
RB
1692003-04-14 Rob Browning <rlb@defaultvalue.org>
170
171 * tags.h: scm_t_intptr should have been intptr_t.
172
3071ea27
RB
1732003-04-13 Rob Browning <rlb@defaultvalue.org>
174
175 * __scm.h (SCM_FLUSH_REGISTER_WINDOWS): don't just rely on "sparc"
176 test. Instead use
177 #if defined (sparc) || defined (__sparc__) || defined (__sparc)
178 as gc_os_dep.c suggests is appropriate.
179
180 * goops.c (prep_hashsets): make static to match prototype.
181 (scm_sym_args): SCM_SYMBOL -> SCM_GLOBAL_SYMBOL. Thanks to Albert
182 Chin.
183
184 * c-tokenize.lex: remove trailing comma from enum. Thanks to
185 Albert Chin.
186
187 * gc_os_dep.c: add NetBSD powerpc config info. Thanks to Thomas
188 Klausner.
189
21ab2aeb
MD
1902003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
191
192 * goops.c (scm_sys_prep_layout_x): Instance allocation is now
193 indicated through extra fields in getters-n-setters.
194 (scm_add_slot): Adapted to new format of getters_n_setters slot.
195 (Thanks to Andy Wingo.)
196
dff96e95
HWN
1972003-02-25 Han-Wen Nienhuys <hanwen@cs.uu.nl>
198
199 * gc-segment.c: add comment
200
07921c76
RB
2012003-04-07 Rob Browning <rlb@defaultvalue.org>
202
b5331f10
RB
203 * debug.h: change "id" arg name to "info_id" to avoid objective-c
204 clash.
205
07921c76
RB
206 * num2integral.i.c (NUM2INTEGRAL): fix bug pointed out by Mikael
207 and add regression test to standalone/.
208
2092003-04-06 Rob Browning <rlb@defaultvalue.org>
210
211 * strings.c (scm_mem2string): use memcpy rather than by-hand loop.
212 Thanks to Dale P. Smith.
213
214 * random.c: #include gmp.h.
215 (scm_c_random_bignum): normalize result on return.
216
217 * init.c: #include gmp.h.
218
219 * numbers.h: remove the gmp.h #include (not needed now).
220
221 * posix.h: change occurences of "id" to something else so we don't
222 cause trouble when included via objective-c (can't hurt, might
223 help). Still have usage in debug.h, though.
224
938f6b7c
MD
2252003-04-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
226
372691d8
MD
227 * random.c (scm_c_random_bignum): Don't generate a random number
228 equal to m (the second argument of scm_c_random_bignum); only
229 generate numbers in the range 0 <= r < m.
c5f268f8
MD
230 (scm_c_default_rstate): Use SCM_VARIABLE_REF to access
231 scm_var_random_state.
372691d8 232
938f6b7c
MD
233 * num2integral.i.c (INTEGRAL2BIG): Put negation of n inside then
234 clause.
235
6cdb8c3f
RB
2362003-04-05 Rob Browning <rlb@defaultvalue.org>
237
938f6b7c 238 * modules.c (scm_module_import_interface): move declaration of
6cdb8c3f
RB
239 uses before any code.
240
15635be5
MD
2412003-04-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
242
1ecfd013
MD
243 * Makefile.am (scmconfig.h): Look for config.h in top_builddir,
244 not top_srcdir.
245
15635be5
MD
246 * hashtab.c (rehash_after_gc): Clear to_rehash list before
247 processing it in order to avoid an infinite loop.
248
249 * print.c (scm_prin1): Remember old state of pstate->writingp.
250
73be1d9e
MV
2512003-04-05 Marius Vollmer <mvo@zagadka.de>
252
253 * Changed license terms to the plain LGPL thru-out.
254
ad815c06
RB
2552003-04-04 Rob Browning <rlb@defaultvalue.org>
256
257 * socket.c (FLIPCPY_NET_HOST_128): new macro.
258 (ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p):
259 rewrite to handle GMP bignums.
260
261
262 * random.c (scm_c_random_bignum): rewrite to handle GMP bignums.
263
264 * ports.c (scm_getc): minor tweak.
265
266 * numbers.h: remove SCM_BIGDIG conditionals, reorganize, and
267 rewrite to handle GMP bignums.
268
269 * numbers.c: rewrite *many* functions to handle GMP bignums.
270
271 * num2integral.i.c (NUM2INTEGRAL, INTEGRAL2NUM, INTEGRAL2BIG):
272 handle GMP bignums.
273
274 * num2float.i.c (NUM2FLOAT): handle GMP bignums.
275
276 * init.c (check_config): remove SCM_BIGDIG conditionals.
277 (scm_init_guile_1): test to make sure mpz_t fits in a double_cell.
278
279 * gc-card.c ("sweep_card"): handle new mpz_t bignums.
280
281 * eval.c: remove SCM_BIGDIG conditionals.
282
283 * eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp.
284
6cdb8c3f
RB
2852003-03-31 Rob Browning <rlb@defaultvalue.org>
286
287 * Makefile.am (scmconfig.h): change srcdir to builddir. (Thanks
288 to Kevin Ryde.)
289
2902003-03-27 Rob Browning <rlb@defaultvalue.org>
291
292 * threads.h: fix various preprocessor usages of new public
293 symbols to expect 0 or 1 values rather than 1 or undefined.
294 i.e. change #ifdef to #if, etc.
295
296 * threads.c: fix various preprocessor usages of new public
297 symbols to expect 0 or 1 values rather than 1 or undefined.
298 i.e. change #ifdef to #if, etc.
299
300 * tags.h: fix various preprocessor usages of new public
301 symbols to expect 0 or 1 values rather than 1 or undefined.
302 i.e. change #ifdef to #if, etc.
303
304 * stacks.c: fix various preprocessor usages of new public
305 symbols to expect 0 or 1 values rather than 1 or undefined.
306 i.e. change #ifdef to #if, etc.
307
308 * stackchk.h: fix various preprocessor usages of new public
309 symbols to expect 0 or 1 values rather than 1 or undefined.
310 i.e. change #ifdef to #if, etc.
311
312 * stackchk.c: fix various preprocessor usages of new public
313 symbols to expect 0 or 1 values rather than 1 or undefined.
314 i.e. change #ifdef to #if, etc.
315
316 * sort.c: fix various preprocessor usages of new public
317 symbols to expect 0 or 1 values rather than 1 or undefined.
318 i.e. change #ifdef to #if, etc.
319
320 * read.c: fix various preprocessor usages of new public
321 symbols to expect 0 or 1 values rather than 1 or undefined.
322 i.e. change #ifdef to #if, etc.
323
324 * random.c: fix various preprocessor usages of new public
325 symbols to expect 0 or 1 values rather than 1 or undefined.
326 i.e. change #ifdef to #if, etc.
327
328 * print.c: fix various preprocessor usages of new public
329 symbols to expect 0 or 1 values rather than 1 or undefined.
330 i.e. change #ifdef to #if, etc.
331
332 * objects.c: fix various preprocessor usages of new public
333 symbols to expect 0 or 1 values rather than 1 or undefined.
334 i.e. change #ifdef to #if, etc.
335
336 * numbers.h: fix various preprocessor usages of new public
337 symbols to expect 0 or 1 values rather than 1 or undefined.
338 i.e. change #ifdef to #if, etc.
339
340 * null-threads.c: fix various preprocessor usages of new public
341 symbols to expect 0 or 1 values rather than 1 or undefined.
342 i.e. change #ifdef to #if, etc.
343
344 * lang.c: fix various preprocessor usages of new public
345 symbols to expect 0 or 1 values rather than 1 or undefined.
346 i.e. change #ifdef to #if, etc.
347
348 * lang.h: fix various preprocessor usages of new public
349 symbols to expect 0 or 1 values rather than 1 or undefined.
350 i.e. change #ifdef to #if, etc.
351
352 * iselect.h: fix various preprocessor usages of new public
353 symbols to expect 0 or 1 values rather than 1 or undefined.
354 i.e. change #ifdef to #if, etc.
355
356 * init.c: fix various preprocessor usages of new public
357 symbols to expect 0 or 1 values rather than 1 or undefined.
358 i.e. change #ifdef to #if, etc.
359
360 * gh_data.c: fix various preprocessor usages of new public
361 symbols to expect 0 or 1 values rather than 1 or undefined.
362 i.e. change #ifdef to #if, etc.
363
364 * gh.h: fix various preprocessor usages of new public
365 symbols to expect 0 or 1 values rather than 1 or undefined.
366 i.e. change #ifdef to #if, etc.
367
368 * gen-scmconfig.c: change most new public symbols to be defined to
369 0 or 1 rather than being either 1 or undefined.
370
371 * gc_os_dep.c: fix various preprocessor usages of new public
372 symbols to expect 0 or 1 values rather than 1 or undefined.
373 i.e. change #ifdef to #if, etc.
374 (STACK_GROWS_DOWN): define to 0 or 1 rather than 1 or undef.
375
376 * gc.h: fix various preprocessor usages of new public
377 symbols to expect 0 or 1 values rather than 1 or undefined.
378 i.e. change #ifdef to #if, etc.
379
380 * gc-card.c: fix various preprocessor usages of new public
381 symbols to expect 0 or 1 values rather than 1 or undefined.
382 i.e. change #ifdef to #if, etc.
383
384 * gc-mark.c: fix various preprocessor usages of new public
385 symbols to expect 0 or 1 values rather than 1 or undefined.
386 i.e. change #ifdef to #if, etc.
387
388 * feature.c: fix various preprocessor usages of new public
389 symbols to expect 0 or 1 values rather than 1 or undefined.
390 i.e. change #ifdef to #if, etc.
391
392 * evalext.c: fix various preprocessor usages of new public
393 symbols to expect 0 or 1 values rather than 1 or undefined.
394 i.e. change #ifdef to #if, etc.
395
396 * eval.h: fix various preprocessor usages of new public
397 symbols to expect 0 or 1 values rather than 1 or undefined.
398 i.e. change #ifdef to #if, etc.
399
400 * eval.c: fix various preprocessor usages of new public
401 symbols to expect 0 or 1 values rather than 1 or undefined.
402 i.e. change #ifdef to #if, etc.
403
404 * eq.c: fix various preprocessor usages of new public
405 symbols to expect 0 or 1 values rather than 1 or undefined.
406 i.e. change #ifdef to #if, etc.
407
408 * coop.c: fix various preprocessor usages of new public
409 symbols to expect 0 or 1 values rather than 1 or undefined.
410 i.e. change #ifdef to #if, etc.
411
412 * coop-threads.c: fix various preprocessor usages of new public
413 symbols to expect 0 or 1 values rather than 1 or undefined.
414 i.e. change #ifdef to #if, etc.
415
416 * coop-pthreads.c: fix various preprocessor usages of new public
417 symbols to expect 0 or 1 values rather than 1 or undefined.
418 i.e. change #ifdef to #if, etc.
419
420 * coop-defs.h: fix various preprocessor usages of new public
421 symbols to expect 0 or 1 values rather than 1 or undefined.
422 i.e. change #ifdef to #if, etc.
423
424 * convert.i.c: fix various preprocessor usages of new public
425 symbols to expect 0 or 1 values rather than 1 or undefined.
426 i.e. change #ifdef to #if, etc.
427
428 * continuations.c: fix various preprocessor usages of new public
429 symbols to expect 0 or 1 values rather than 1 or undefined.
430 i.e. change #ifdef to #if, etc.
431
432 * _scm.h: fix various preprocessor usages of new public symbols to
433 expect 0 or 1 values rather than 1 or undefined. i.e. change
434 #ifdef to #if, etc.
435
d11d697a
MV
4362003-03-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
437
9686f86d
MV
438 * init.c (scm_init_guile_1): Call scm_i_init_deprecated.
439
440 * deprecated.c, deprecated.h: New files, to collect deprecated
441 things in one place.
442 * Makefile.am: Added them in all the right places.
443
d11d697a
MV
444 * Makefile.am (EXTRA_DIST): Added "scmconfig.h.top".
445 (scmconfig.h): Get "scmconfig.h.top" from $(srcdir) so that VPATH
446 builds work.
9686f86d
MV
447 (DOT_X_FILES): Removed "iselect.x".
448 (DOT_DOC_FILES): Removed "iselect.doc".
d11d697a 449
e3c0c3b9
RB
4502003-03-25 Rob Browning <rlb@defaultvalue.org>
451
452 * win32-socket.h: #include "libguile/__scm.h". Replace usage of
453 HAVE_WINSOCK2_H with SCM_HAVE_WINSOCK2_H.
454
455 * win32-socket.c: #include <config.h> if HAVE_CONFIG_H.
456
457 * vports.c: #include <config.h> if HAVE_CONFIG_H.
458
459 * unif.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of
460 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
461
462 * threads.h: replace usage of struct timespect with
463 scm_t_timespec. Replace usage of USE_PTHREAD_THREADS with
464 SCM_USE_PTHREAD_THREADS. Remove typedef for struct timespec in
465 favor of scm_t_timespec from scmconfig.h.
466
467 * threads.c: move libguile/_scm.h include to the top so we pick up
468 any critical defines like _GNU_SOURCE early. Replace usage of
469 struct timespect with scm_t_timespec. Replace usage of
470 STACK_GROWS_UP with SCM_STACK_GROWS_UP. Replace usage of
471 USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS.
472
473 * threads-plugin.h: replace usage of struct timespect with
474 scm_t_timespec.
475
476 * threads-plugin.c: #include <config.h> if HAVE_CONFIG_H. Replace
477 usage of struct timespect with scm_t_timespec.
478
479 * tags.h: move HAVE_STDINT_H handling to scmconfig.h. Move
480 HAVE_INTTYPES_H handling to scmconfig.h. #include
481 "libguile/__scm.h". Rework handling for scm_t_bits,
482 scm_t_signed_bits, SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
483 SCM_T_SIGNED_BITS_MIN, and SIZEOF_SCM_T_BITS to use scm_t_intptr,
484 scm_t_uintptr, SCM_SIZEOF_INTPTR_T, and SCM_SIZEOF_UINTPTR_T, and
485 SCM_SIZEOF_UNSIGNED_LONG. Rename usage of HAVE_ARRAYS to
486 SCM_HAVE_ARRAYS.
487
488 * symbols.c: #include <config.h> if HAVE_CONFIG_H.
489
490 * struct.c: #include <config.h> if HAVE_CONFIG_H.
491
492 * strports.c: #include <config.h> if HAVE_CONFIG_H.
493
494 * strop.c: #include <config.h> if HAVE_CONFIG_H.
495
496 * stime.h: move handling of time related headers to scmconfig.h.
497
498 * stime.c: #include <config.h> if HAVE_CONFIG_H.
499
500 * stacks.c: replace usage of STACK_GROWS_UP with
501 SCM_STACK_GROWS_UP.
502
503 * sort.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
504 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
505
506 * socket.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
507 of uint32 and HAVE_UINT_32 with scm_t_int32.
508
509 * smob.c: #include <config.h> if HAVE_CONFIG_H.
510
511 * simpos.c: #include <config.h> if HAVE_CONFIG_H.
512
513 * script.c: #include <config.h> if HAVE_CONFIG_H.
514
515 * scmsigs.c: #include <config.h> if HAVE_CONFIG_H.
516
517 * scmconfig.h.top: new file -- preamble for scmconfig.h.
518
519 * rw.c: #include <config.h> if HAVE_CONFIG_H.
520
521 * regex-posix.c: #include <config.h> if HAVE_CONFIG_H.
522
523 * read.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
524
525 * rdelim.c: #include <config.h> if HAVE_CONFIG_H.
526
527 * random.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
528 of LONG32, LONG64, SIZEOF_LONG, and HAVE_LONG_LONGS with
529 scm_t_int32, scm_t_int64, and SCM_HAVE_T_INT64. Rename usage of
530 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
531
532 * ramap.c: replace usage of HAVE_LONG_LONGS with
533 "SCM_SIZEOF_LONG_LONG != 0".
534
535 * putenv.c: #include <config.h> if HAVE_CONFIG_H. #include
536 "libguile/scmconfig.h".
537
538 * pthread-threads.c: #include <config.h> if HAVE_CONFIG_H.
539
540 * print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
541 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
542
543 * posix.c: #include <config.h> if HAVE_CONFIG_H.
544
545 * ports.c: #include <config.h> if HAVE_CONFIG_H.
546
547 * objects.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
548
549 * numbers.h: replace usage of HAVE_FLOATINGPOINT_H with
550 SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with
551 SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with
552 SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with
553 SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with
554 scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with
555 "SCM_SIZEOF_LONG_LONG != 0".
556
557 * numbers.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
558 of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". Replace
559 usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of
560 SIZEOF_PTRDIFF_T with SCM_SIZEOF_SCM_T_PTRDIFF.
561
562 * num2integral.i.c: #include <config.h> if HAVE_CONFIG_H.
563
564 * null-threads.h: replace usage of struct timespect with
565 scm_t_timespec.
566
567 * net_db.c: #include <config.h> if HAVE_CONFIG_H.
568
569 * mkstemp.c: #include <config.h> if HAVE_CONFIG_H. #include
570 "libguile/__scm.h". Remove definition of gcc_uint64_t in favor of
571 scm_t_uint64 and rename usages.
572
573 * mallocs.c: #include <config.h> if HAVE_CONFIG_H.
574
575 * load.c: #include <config.h> if HAVE_CONFIG_H.
576
577 * iselect.h: move handling of time related headers to scmconfig.h.
578 Rename usage of HAVE_SYS_SELECT_H to SCM_HAVE_SYS_SELECT_H.
579 Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Rename
580 usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS.
581
582 * iselect.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
583 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
584 USE_NULL_THREADS to SCM_USE_NULL_THREADS.
585
586 * ioext.c: #include <config.h> if HAVE_CONFIG_H.
587
588 * inline.h: #include "libguile/__scm.h" at the top. Change code
589 to use SCM_C_INLINE and SCM_INLINE_C_INCLUDINT_INLINE_H to decide
590 what to do instead of creating a new public #define. Rename usage
591 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
592 USE_NULL_THREADS to SCM_USE_NULL_THREADS. Rename usage of
593 USE_COPT_THREADS to SCM_USE_COPT_THREADS.
594
595 * inline.c: rearrange handling -- now we just #define
596 SCM_INLINE_C_INCLUDING_INLINE_H to 1 and #include
597 "libguile/inline.h". scmconfig.h will define SCM_C_INLINE as
598 appropriate, and we use that in inline.h along with the above
599 define to determine how to respond.
600
601 * init.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
602 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
603
604 * guile.c: #include <config.h> if HAVE_CONFIG_H.
605
606 * gh_data.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
607 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
608
609 * gh.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
610
611 * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details.
612
613 * gen-scmconfig.c: new file -- see comments in file for details.
614
615 * gdbinit.c: #include <config.h> if HAVE_CONFIG_H.
616
617 * gc_os_dep.c: #include <config.h> if HAVE_CONFIG_H. Replace
618 usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP.
619
620 * gc.h: replace usage of SIZEOF_LONG with
621 SCM_SIZEOF_UNSIGNED_LONG. Replace usage of USE_PTHREAD_THREADS
622 with SCM_USE_PTHREAD_THREADS. Remove SCM_SIZEOF_LONG definition
623 since we handle that in scmconfig.h now.
624
625 * gc.c: #include <config.h> if HAVE_CONFIG_H.
626
627 * gc-mark.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
628 of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of
629 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
630
631 * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H.
632
633 * gc-card.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
634 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
635
636 * fports.c: #include <config.h> if HAVE_CONFIG_H.
637
638 * filesys.c: #include <config.h> if HAVE_CONFIG_H.
639
640 * feature.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
641 of USE_NULL_THREADS to SCM_USE_NULL_THREADS.
642
643 * extensions.c: #include <config.h> if HAVE_CONFIG_H.
644
645 * evalext.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
646 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
647
648 * eval.c: #include <config.h> if HAVE_CONFIG_H. #include
649 "libguile/__scm.h" rather than scmconfig.h. Rename usage of
650 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
651 with "SCM_SIZEOF_LONG_LONG != 0".
652
653 * error.c: #include <config.h> if HAVE_CONFIG_H.
654
655 * eq.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
656 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
657 with "SCM_SIZEOF_LONG_LONG != 0".
658
659 * deprecation.c: #include <config.h> if HAVE_CONFIG_H.
660
661 * coop.c: replace usage of struct timespect with scm_t_timespec.
662 #include <config.h> if HAVE_CONFIG_H.
663
664 * coop-threads.c: #include "libguile/_scm.h" early. Replace
665 usage of struct timespect with scm_t_timespec. Replace usage of
666 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
667
668 * coop-pthreads.c: #include "libguile/_scm.h" early. Replace
669 usage of struct timespect with scm_t_timespec. Replace usage of
670 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
671
672 * coop-defs.h: move handling of time related headers to
673 scmconfig.h. Add #include "libguile/__scm.h". Rename usage of
674 HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Replace usage of struct
675 timespect with scm_t_timespec.
676
677 * convert.i.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
678
679 * convert.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
680
681 * convert.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
682 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
683
684 * continuations.c: move libguile/_scm.h include to the top so we
685 pick up any critical defines like _GNU_SOURCE early.
686
687 * backtrace.c: #include <config.h> if HAVE_CONFIG_H.
688
689 * async.c: #include <config.h> if HAVE_CONFIG_H.
690
691 * alloca.c: #include <config.h> if HAVE_CONFIG_H.
692
693 * _scm.h: #include <config.h> if HAVE_CONFIG_H.
694 Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS.
695
696 * __scm.h: move libguile/scmconfig.h include up to the top, so
697 we're sure to pick up any critical defines like _GNU_SOURCE early.
698 #include <limits.h> removed in favor of scmconfig.h inclusion when
699 appropriate. STDC_HEADERS based inclusion of stdlib.h,
700 sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of
701 scmconfig.h inclusion when appropriate. Various Win32 related
702 definitions removed in favor of scmconfig.h inclusion when
703 appropriate.
704 (HAVE_UINTPTR_T): definition removed (see NEWS).
705 (SIZEOF_PTRDIFF_T): definition removed (see NEWS).
706 (HAVE_LONG_LONGS): definition removed (see NEWS).
707 (HAVE_LONG_LONG): definition removed (see NEWS).
708 (HAVE_PTRDIFF_T): definition removed (see NEWS).
709
710 * Makefile.am: scmconfig.h is now generated by building and
711 running gen-scmconfig.h and capturing its output. gen-scmconfig
712 uses config.h and the configure.in generated gen-scmconfig.h to
713 decide what to output. See gen-scmconfig.c for details.
714 (noinst_PROGRAMS): add gen-scmconfig.
715 (gen_scmconfig_SOURCES): new variable.
716 (gen-scmconfig.$(OBJEXT)): new target - be careful to handle
717 cross-compiling right.
718 (scmconfig.h): build scmconfig.h from gen-scmconfig's output.
719 (BUILT_SOURCES): add scmconfig.h.
720
25e0bf97
MV
7212003-03-19 Marius Vollmer <mvo@zagadka.de>
722
723 * gc_os_dep.c: Added defines for sparc-unknown-netbsdelf1.5 from
724 Adrian Bunk. Thanks!
725
74b6d6e4
MD
7262003-03-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
727
728 * goops.c (make_class_from_template): New fourth arg:
729 applicablep.
730 (scm_class_extended_generic_with_setter, scm_class_self): Fixed
731 cpls.
732
733 * smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable.
734
735 * goops.c, objects.c, objects.h (scm_make_extended_class): New
736 second arg: applicablep.
737 (scm_i_inherit_applicable): New function.
738
739 * goops.c, goops.h (scm_class_applicable,
740 scm_class_extended_accessor): New classes.
741
5c9e7dad
DH
7422003-03-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
743
744 * procs.c (scm_procedure_documentation): Removed redundant
745 SCM_NIMP test and replaced other calls to SCM_IMP by more explicit
746 predicates.
747
f8af5c6d
MD
7482003-03-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
749
c614a00b
MD
750 * list.c, list.h (scm_filter, scm_filter_x): New functions.
751
109c2c9f
MD
752 * modules.c (scm_module_import_interface): New function.
753
f8af5c6d
MD
754 * goops.c, goops.h (scm_class_accessor_method): Renamed from
755 scm_class_accessor.
756 (scm_class_accessor): New class.
757
a48d60b1
MD
7582003-03-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
759
760 * goops.c (scm_primitive_generic_generic): Enable primitive
761 generic if not enabled.
762 (scm_sys_goops_loaded): Setup unextended primitive generics.
763
764 * goops.c, goops.h (scm_c_extend_primitive_generic): New function.
765
766 * snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
767 snarf macros.
768
769 * numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
770 testing example. All uses of SCM_GPROC should be converted.)
771
772 * procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
773 scm_assoc.
774
775 * eq.c (scm_equal_p): Turned into a primitive generic.
776
84edc049
RB
7772003-02-27 Rob Browning <rlb@defaultvalue.org>
778
779 * Makefile.am (scmconfig.h): new target -- generate file from
780 ../config.h.
781 (modinclude_HEADERS): remove version.h.
782 (nodist_modinclude_HEADERS): add version.h.
783
ea5c9285
MD
7842003-02-24 Mikael Djurfeldt <djurfeldt@nada.kth.se>
785
b4a1358c
MD
786 This fixes a serious GC bug, introduced during the latest
787 reorganization of the GC, which disabled freeing of structs and
788 GOOPS objects:
789
790 * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
791 SCM_EOL.
53af8255
MD
792 (scm_struct_prehistory): Move scm_free_structs to
793 scm_before_mark_c_hook.
ea5c9285 794
b4a1358c
MD
795 * gc-card.c (sweep_card): Check that we haven't swept structs on
796 this card before. That can happen if scm_i_sweep_all_segments has
797 been called from some other place than scm_igc.
798
c35738c1
MD
7992003-02-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
800
231a4ea8
MD
801 * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31
802 (since hash tables now adapt their size).
803
804 * modules.c (scm_modules_prehistory): Changed from 2001 to 1533
805 (current number of prehistory bindings; hashtable code will select
806 a prime which is greater than this value).
807
808 * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139
809 (current number of initial symbols).
810
811 * properties.c (scm_init_properties): Don't specify size of
812 scm_properties_whash.
813
814 * objprop.c (scm_init_objprop): Don't specify size of
815 scm_object_whash.
816
817 * keywords.c (scm_init_keywords): Don't specify a hash table size.
818
c35738c1
MD
819 * hooks.c (scm_c_hook_add): Fixed bug in append mode.
820
821 The following changes introduce the use of resizable hash tables
822 throughout Guile. It also renames the old *-hash-table* functions
823 to *-alist-vector* and places them, together with the rest of the
824 weak vector support, in the module (ice-9 weak-vector). We should
825 probably introduce a new, better, API for weak references, for
826 example "weak pairs" a la MIT-Scheme. (In Chez scheme, they even
827 look like and are used like ordinary pairs.)
828
829 * environments.c (obarray_enter, obarray_retrieve, obarray_remove,
830 leaf_environment_fold, obarray_remove_all): Use hashtable
831 accessors.
832
833 * gc.c (scm_init_storage): Moved hook initialization to
834 scm_storage_prehistory.
835 (scm_storage_prehistory): New function.
836 (scm_igc): Added commentary about placement of
837 scm_after_sweep_c_hook.
838
839 * gc-mark.c (scm_mark_all): Use hashtable accessors.
840 (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and
841 SCM_WVECT_WEAK_VALUE_P.
842
843 * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New
844 functions.
845 (scm_vector_to_hash_table, scm_c_make_resizing_hash_table):
846 Removed.
847 (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table,
848 scm_make_doubly_weak_hash_table): Moved here from weaks.c.
849
850 * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added
851 calls to scm_storage_prehistory and scm_hashtab_prehistory.
852
853 * modules.c (module-reverse-lookup): Use hashtable accessors.
854
855 * symbols.c, symbols.h (scm_i_hash_symbol): New function.
856
857 * weaks.c, weaks.h (scm_make_weak_key_alist_vector,
858 scm_make_weak_value_alist_vector,
859 scm_make_doubly_weak_alist_vector): New functions.
860
861 * weaks.c (scm_init_weaks_builtins): New function.
862
863 * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE,
864 SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P,
865 SCM_WVECT_NOSCAN_P): New macros.
866
867 * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P
868 and SCM_WVECT_WEAK_VALUE_P.
869
870 * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from
871 allocate_weak_vector and exported.
872
0a4c1355
MD
8732003-02-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
874
875 * hashtab.c: Undid thread safety. (We decided that it's better to
876 let the user explicitly protect the tables (or not) according what
877 is suitable for the application.)
878
87ca11ff
MD
8792003-02-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
880
881 * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made
882 thread safe and handle resizing tables.
883 (scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed
884 SCM_DEFER/ALLOW_INTS.
885
f59a096e
MD
8862003-02-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
887
888 * hashtab.c (scm_vector_to_hash_table,
889 scm_c_make_resizing_hash_table, scm_make_hash_table): New
890 functions.
891 (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread
892 safe and handle resizing tables.
893
894 * weaks.c (scm_make_weak_key_hash_table,
895 scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table):
896 Size argument made optional. Return resizable table if not
897 specified.
898
4b612c5b
MD
8992003-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
900
901 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
902 Fixed formals tests for closures. (Thanks to Kevin Ryde.)
903
b3d7f6df
MD
9042003-02-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
905
906 * debug.c (scm_procedure_source): Handle all objects for which
907 procedure? is #t. (Thanks to Bill Schottstaedt.)
908
756414cf
MD
9092003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se>
910
361d631f
MD
911 * futures.c (mark_futures): Don't need to mark data of recycled
912 futures.
913 (scan_futures, cleanup_undead): Be smarter about marking
914 futures---avoid unnecessary passes through future lists.
915
756414cf
MD
916 * futures.h, futures.c: New files; Introduced recycling of
917 futures. For fine-grained threading this lifts performance to
918 another level. We can now use parallelization in inner loops of
919 Guile programs without impossible overhead.
920
921 * threads.h, threads.c: Moved futures to their own file.
922
923 * Makefile.am (libguile_la_SOURCES): Added futures.c.
924 (DOT_X_FILES): Added futures.x.
925 (DOT_DOC_FILES): Added futures.doc.
926 (modinclude_HEADERS): Added futures.h.
927
928 * threads.c, threads.h (scm_i_create_thread): Renamed from
929 create_thread and made global.
930
931 * futures.c (scm_make_future): New procedure.
932
933 * eval.c: #include "libguile/futures.h".
934
935 * init.c: #include "futures.h"
936 (scm_init_guile_1): Call scm_init_futures.
937
938 * stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK.
939
940 * stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here.
941
942 * eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New
943 functions.
944
945 * eval.c (scm_trampoline_1): Fixed arguments test for closures.
946
b4debead
MD
9472003-01-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
948
949 * threads.c (create_thread): Don't unwind dynwind chain of parent
950 thread before creation. Just start the new thread with an empty
951 dynwind chain.
952
93f26b7b
MD
9532003-01-20 Mikael Djurfeldt <djurfeldt@nada.kth.se>
954
955 * evalext.c, evalext.h (scm_self_evaluating_p): New function.
956
38d8927c
MD
9572003-01-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
958
41c96c32
MD
959 * threads.c (scm_timed_wait_condition_variable): Support timed
960 waiting also for simple condition variables.
961
38d8927c
MD
962 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
963 of calling the procedure change-object-class.
964
9cf5d9b7
MD
9652003-01-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
966
967 * ramap.c (scm_ramapc): Typo in error message.
968
bbf8d523
MD
9692003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
970
b46fae00
MD
971 * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
972 slots with instance allocation.
973
bbf8d523
MD
974 * goops.c, goops.h (scm_class_extended_generic_with_setter): New
975 class.
976 (scm_compute_applicable_methods): Use scm_generic_function_methods.
977
978 * goops.c (scm_generic_function_methods): Support extended
979 generic functions.
980
ebf9b47c
MD
9812002-12-29 Mikael Djurfeldt <djurfeldt@nada.kth.se>
982
983 * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future.
2e37d6a2 984 Thanks to Neil for pointing this out!
ebf9b47c 985
14a9ba3f
NJ
9862002-12-29 Neil Jerram <neil@ossau.uklinux.net>
987
988 * lang.h: Remove declarations matching definitions removed from
989 lang.c (just below).
990
c6a040a8
NJ
9912002-12-28 Neil Jerram <neil@ossau.uklinux.net>
992
6054d805
NJ
993 * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null,
994 scm_m_while, scm_nil_eq): Remove definitions that were superfluous
995 and already commented out.
996
c6a040a8
NJ
997 * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token,
998 scm_lreadparen): Support reading vectors with Elisp syntax if
999 SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS
1000 is not currently defined, and there isn't even a configure switch
1001 to enable it yet.)
1002
3742c12f
MV
10032002-12-26 Marius Vollmer <mvo@zagadka.ping.de>
1004
1005 * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath
1006 builds work.
1007 (EXTRA_DIST): Added version.h.in.
1008
fb50ef08
MD
10092002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1010
1011 This change makes it possible for one thread to do lazy sweeping
1012 while other threads are running. Now only the mark phase need to
1013 have all threads asleep. We should look further into this issue.
1014 Presently, I've put the locking of scm_i_sweep_mutex at
1015 "conservative" places due to my current lack of knowledge about
1016 the garbage collector. Please feel free to restrict these regions
1017 further to allow for maximal parallelism!
1018
1019 * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
1020
1021 * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
1022 scm_gc_register_collectable_memory): Substitute locking of
1023 scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
1024 (scm_igc): Lock sweep mutex here instead of in callers; Calls to
1025 scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
1026 the single-thread section (which now only contains the mark
1027 phase).
1028 (scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
1029 Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly.
1030
1031 * threads.c (gc_section_mutex): Removed.
1032
9ed24633
MD
10332002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1034
0d48aca5
MD
1035 * threads.c (create_thread): Clear parent field in root state in
1036 order not to unnecessarily remember dead threads.
1037
9ed24633
MD
1038 * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
1039 (scm_trampoline_1, scm_trampoline_2): Use them.
1040
29717c89
MD
10412002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1042
1043 Partial introduction of real plugin interface.
1044
1045 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
1046 (EXTRA_DIST): Added threads-plugin.c.
1047
1048 * threads-plugin.h, threads-plugin.c: New files.
1049
1050 * threads.h: #include "libguile/threads-plugin.h".
1051
1052 * threads.c: #include "libguile/threads-plugin.c".
1053
1054 * pthread-threads.c: Temporarily remove debugging functions.
1055
1056 * threads.c, threads.h (scm_yield): Added back.
1057
e29e0b09
MD
10582002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1059
1060 * threads.c (really_launch): Detach before unlocking
1061 thread_admin_mutex in order not to risk being joined.
1062 (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
1063 thread_admin_mutex locked during GC.
1064
1065 * pthread-threads.c, pthread-threads.h: Improvements to debugging
1066 functions.
1067
0b6843b1 10682002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
93cd4dcd 1069
6da2dfc4
MD
1070 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
1071 support for debugging mutex operations.
1072
1b92fb6b
MD
1073 * threads.c (scm_thread): Removed filed joining_threads.
1074 (thread_print): Print thread number as well as address of thread
1075 structure.
0b6843b1
MD
1076 (scm_join_thread): Bugfix.
1077 (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
1078 scm_timed_wait_condition_variable, scm_signal_condition_variable,
1079 scm_broadcast_condition_variable): Use the low-level API.
1080 (scm_all_threads): Return copy of thread list (to prevent
1081 unintended destruction).
1082 (scm_threads_prehistory): Initialize heap_mutex of fake thread.
1b92fb6b 1083
93cd4dcd
MD
1084 * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
1085 pthread "native" recursive mutex support.
1086
2ff4f181
MD
10872002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1088
28d52ebb
MD
1089 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
1090 Simply lock a thread C API recursive mutex.
1091 (SCM_NONREC_CRITICAL_SECTION_START,
1092 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
1093 SCM_REC_CRITICAL_SECTION_END): Removed.
1094
1095 * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
1096 direct calls to scm_rec_mutex_lock / unlock around the three calls
1097 to scm_m_expand_body.
1098
1099 * eval.c, eval.h (promise_free): New function.
1100 (scm_force): Rewritten; Now thread-safe; Removed
1101 SCM_DEFER/ALLOW_INTS.
1102
1103 * pthread-threads.h: Added partially implemented plugin interface
1104 for recursive mutexes. These are, for now, only intended to be
1105 used internally within the Guile implementation.
1106
1107 * pthread-threads.c: New file.
1108
1109 * threads.c: Conditionally #include "pthread-threads.c".
1110
1111 * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
1112 thread-safe;
1113
1114 * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
1115 SCM_GLOBAL_REC_MUTEX): New macros.
1116
1117 * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
1118 macros---use mutexes instead.
1119
1120 * tags.h (SCM_IM_FUTURE): New tag.
1121
1122 * eval.c (scm_m_future): New primitive macro.
1123 (SCM_CEVAL): Support futures.
1124 (unmemocopy): Support unmemoization of futures.
1125
1126 * print.c (scm_isymnames): Name of future isym.
1127
2ff4f181
MD
1128 * version.c: Unmade some changes to my private copy that got
1129 committed by mistake.
1130
392d2833
MD
11312002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1132
e200ddee
MD
1133 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
1134 2002-12-10.
1135
392d2833
MD
1136 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
1137
1138 * gc.c (scm_gc_sweep): Call it here instead, which is a more
1139 logical place.
1140
1141 * threads.c (create_thread): Remember root object until the handle
1142 of the new thread is on all_threads list.
1143
1144 * root.c (scm_make_root): Moved copying of fluids until after
1145 creation of root handle so that the fluids are GC protected. Also
1146 removed the critical section.
1147
c4c52ebe
MD
11482002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1149
960c408c
MD
1150 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
1151
3cdde9d6 1152 * gc-malloc.c (malloc_mutex): New mutex.
960c408c 1153 (scm_gc_malloc_prehistory): Initialize it.
3cdde9d6
MD
1154 (scm_realloc): Serialize call to realloc
1155 (scm_calloc): Same for calloc.
1156 Thanks to Wolfgang Jaehrling!
1157 (Now we have to make sure all calls to malloc/realloc are made
1158 through scm_malloc.)
1159
960c408c
MD
1160 * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
1161
c4c52ebe
MD
1162 * threads.c (really_launch): Release heap (to prevent deadlock).
1163 (create_thread): Release heap before locking thread admin mutex.
1164
b0dc3d71
MD
11652002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1166
1167 * threads.c (scm_i_thread_invalidate_freelists): New
1168 function.
1169
1170 * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
1171
1172 * modules.c (scm_export): Inserted a return statement.
1173
06e80f59
HWN
11742002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1175
1176 * modules.c (scm_export): new function
1177
1178 * gc-card.c: add a note about malloc()/free() overhead.
1179
a12611c3
MD
11802002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1181
1182 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
1183 in srcdir.
1184
c7fabadf
MD
11852002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1186
1187 These changes remove scm_ints_disabled (which hasn't has any
1188 effect in Guile for quite some time).
1189
1190 * async.c, error.h (scm_ints_disabled): Removed.
1191
1192 * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
1193 root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
1194 SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
1195 (old_ints): Removed.
1196
1197 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
1198 critical section.
1199 (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
1200 SCM_ALLOW_INTS.
1201
9bc4701c
MD
12022002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1203
52340b65
MD
1204 * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
1205 Removed accidental #if 0 around these functions.
1206
9bc4701c
MD
1207 These changes are the start of support for preemptive
1208 multithreading. Marius and I have agreed that I commit this code
1209 into the repository although it isn't thoroughly tested and surely
1210 introduces many bugs. The bugs should only be exposed when using
1211 threads, though. Signalling and error handling for threads is
1212 very likely broken. Work on making the implementation cleaner and
1213 more efficient is needed.
1214
1215 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
1216 (SCM_NONREC_CRITICAL_SECTION_START,
1217 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
1218 SCM_REC_CRITICAL_SECTION_END): New macros.
1219 (SCM_CRITICAL_SECTION_START/END): Defined here.
1220
1221 * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
1222 the three calls to scm_m_expand_body.
1223
1224 * gc.h: #include "libguile/pthread-threads.h";
1225 (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.
1226
1227 * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
1228 scm_t_key;
1229
1230 * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
1231 access.
1232
1233 * gc-freelist.c (scm_gc_init_freelist): Create freelist keys.
1234
1235 * gc-freelist.c, threads.c (really_launch): Use
1236 SCM_FREELIST_CREATE.
1237
1238 * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):
1239
1240 * gc.c (scm_i_expensive_validation_check, scm_gc,
1241 scm_gc_for_newcell): Put threads to sleep before doing GC-related
1242 heap administration so that those pieces of code are executed
1243 single-threaded. We might consider rewriting these code sections
1244 in terms of a "call_gc_code_singly_threaded" construct instead of
1245 calling the pair of scm_i_thread_put_to_sleep () and
1246 scm_i_thread_wake_up (). Also, we would want to have as many of
1247 these sections eleminated.
1248
1249 * init.c (scm_init_guile_1): Call scm_threads_prehistory.
1250
1251 * inline.h: #include "libguile/threads.h"
1252
1253 * pthread-threads.h: Macros now conform more closely to the
1254 pthreads interface. Some of them now take a second argument.
1255
1256 * threads.c, threads.h: Many changes.
1257
12582002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1259
1260 * Makefile.am (version.h): Changed $^ --> $< in rule for
1261 version.h.
1262
b2cbe8d8
RB
12632002-12-08 Rob Browning <rlb@defaultvalue.org>
1264
1265 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
1266 (SCM_MINOR_VERSION): use @--@ substitution now.
1267 (SCM_MICRO_VERSION): use @--@ substitution now.
1268 (scm_effective_version): new function prototype.
1269
1270 * version.c (scm_effective_version): new function, also add
1271 effective-version.
1272
1273 * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
1274 (libpath.h): use GUILE_EFFECTIVE_VERSION to compute
1275 SCM_LIBRARY_DIR.
1276 (version.h): generate this here rather than configure.in. This
1277 approach tracks source edits better (i.e. more immediately).
1278 Might be worth considering for other .in files too.
1279
5441c65c
MV
12802002-12-02 Marius Vollmer <mvo@zagadka.ping.de>
1281
1282 Reorganized thread package selection. A thread package now only
1283 implements a small set of pthread like functions and Guile
1284 implements the rest on top of that. Guile's implementation is
1285 what the "coop-pthreads" package has been previously. Support for
1286 "coop" threads has been removed until I get time to add it again.
1287
1288 * Makefile.am (libguile_la_SOURCES): Removed iselect.c.
1289 (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
1290 null-threads.c, coop-pthreads.c.
1291 (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added
1292 pthread-threads.h.
1293
1294 * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h.
1295
1296 * threads.h: Do not include "libguile/coop-defs.h". Include
1297 "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed
1298 (previously deprecated) C level thread API prototypes. They are
1299 now in the thread package specific headers, "null-threads.h" and
1300 "pthread-threads.h".
1301 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
1302 New.
1303 (scm_threads_init): Removed.
1304 (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
1305 SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
1306 SCM_I_THREAD_SWITCH_COUNT): Define here.
1307 (scm_single_thread_p): Removed.
1308 (scm_call_with_new_thread): Take two args directly instead of list
1309 of two args.
1310 (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
1311 SCM_SET_THREAD_LOCAL_DATA): Define here.
1312
1313 * threads.c: Merged with "coop-pthreads.c".
1314
1315 * null-threads.h: Implement pthread-like API as a set of macros.
1316
1317 * pthread-threads.h: New, implement pthread-like API by deferring
1318 to pthread itself.
1319
1320 * init.c (scm_init_guile_1): Do not call scm_init_iselect, which
1321 has been lost in the reorganization.
1322
504d99c5
MD
13232002-12-01 Mikael Djurfeldt <mdj@linnaeus>
1324
1325 The following change makes it possible to move procedure
1326 application dispatch outside inner loops. The motivation was
1327 clean implementation of efficient replacements of R5RS primitives
1328 in SRFI-1.
1329
1330 The semantics is clear: scm_trampoline_N returns an optimized
1331 version of scm_call_N (or NULL if the procedure isn't applicable
1332 on N args).
1333
1334 Applying the optimization to map and for-each increases efficiency
1335 noticeably. For example, (map abs ls) is 8 times faster than
1336 before.
1337
1338 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
1339
1340 * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.
1341
1342 * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
1343 (map, for-each): Handle also application on two args as a special
1344 case; Use trampolines.
1345
1346 Other changes:
1347
1348 * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
1349 (subr2oless): Removed.
1350 (scm_restricted_vector_sort_x): Use scm_return_first to keep the
1351 vector GC protected.
1352
1353 * eval.c (check_map_args): Use scm_out_of_range_pos instead of
1354 scm_out_of_range.
1355
63dd3413
DH
13562002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
1357
1358 * evalext.[ch] (scm_m_undefine, undefine): Deprecated.
1359
4ba5f279
MD
13602002-11-17 Mikael Djurfeldt <mdj@linnaeus>
1361
1362 * debug.c (scm_make_iloc): Added missing "return".
1363
56ae231f
MV
13642002-11-17 Marius Vollmer <mvo@zagadka.ping.de>
1365
1366 * strports.c (scm_eval_string_in_module): Validate second arg to
1367 be a module. Thanks to Arno Peters!
1368
80b28865
DH
13692002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1370
1371 * .cvsignore: remove goops.c
1372
c88b1456
DH
13732002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1374
1375 * modules.c (scm_env_top_level, scm_lookup_closure_module,
1376 module_variable, scm_module_lookup_closure,
1377 scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
1378 scm_system_module_env_p): Don't compare SCM values with C
1379 operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP
1380 over SCM_NFALSEP.
1381
a8a19efc
DH
13822002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1383
1384 * eval.h (SCM_MAKE_ILOC): New macro.
1385
1386 * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing
1387 the iloc bitpattern here.
1388
76734914
MD
13892002-11-14 Mikael Djurfeldt <mdj@linnaeus>
1390
1391 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
1392 part of the API, otherwise it's difficult to write Guile
1393 extensions using non-blocking I/O => moved #include
1394 "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.
1395
1396 * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
1397 s_unlock_mutex.
1398
8b5b4a75
MV
13992002-11-10 Marius Vollmer <mvo@zagadka.ping.de>
1400
1401 * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They
1402 are defined in configure.in.
1403
1404 * threads.c: Removed SCM_API from function definitions. SCM_API
1405 is only for declarations.
1406
e5a83084
MD
14072002-11-07 Mikael Djurfeldt <mdj@linnaeus>
1408
9be8bb45
MD
1409 * coop-pthreads.h: Added support for thread specific data to the
1410 generic C API for the coop-pthreads case.
1411
e5a83084
MD
1412 * threads.c, threads.h (scm_cond_init): Undo unintentional API
1413 change.
6c214b62 1414 (scm_cond_broadcast): Added missing function.
e5a83084 1415
7edf178e
MV
14162002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1417
1418 * coop.c (coop_next_runnable_thread): Removed, wich should have
1419 happened when GUILE_ISELECT was hard-wired.
1420
7f5b1b77
MV
14212002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
1422
7caa1b07
MV
1423 * Makefile.am (libguile_la_SOURCES): Added threads.c
1424 (DOT_DOC_FILES): Added threads.doc.
1425 (DOT_X_FILES): Added threads.x.
1426 (EXTRA_libguile_la_SOURCES): Removed threads.c.
1427 (noinst_HEADERS): Added coop-pthreads.c.
1428 (modinclude_HEADERS): Added coop-pthreads.h.
1429
1430 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
1431 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
1432
bb11cbf4
MV
1433 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
1434 Thanks to Bill Schottstaedt!
1435
1d4cbbed
MV
1436 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
1437
7f5b1b77
MV
1438 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
1439 SCM_COPT_THREADS is defined.
1440 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
1441 is defined.
1442
1443 * coop-pthreads.c: Some harmless renamings of internal stuff.
1444 (create_thread): New, generalized version of
1445 scm_call_with_new_thread.
1446 (scm_call_with_new_thread): Use it.
1447 (scm_spawn_thread): New, use create_thread.
1448
d52f53b1
MV
14492002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
1450
1451 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
1452 start testing it now.
1453
1454 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
1455 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
1456 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
1457 is defined.
1458
30f920c3
MV
14592002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
1460
1461 * scmsigs.c (signal_cell_handlers, install_handler_data,
1462 scm_delq_spine_x, really_install_handler, install_handler): New
1463 scheme for triggering signal handlers, to simplify take_signal.
1464 (take_signal): Simplified, to avoid race conditions.
1465 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
1466 hasn't exited yet.
1467
1468 * async.c (scm_async_click): Reset pending_asyncs, handle
1469 signal_asyncs. Don't set cdr of a non-signal async to #f.
1470 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
1471 always. Set pending_asyncs.
1472 (scm_system_async_mark_for_thread): Check that thread has not
1473 exited.
1474 (scm_unmask_signals, decrease_block): Call scm_async_click after
1475 block_asyncs becomes zero.
1476
1477 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
1478 active_asyncs.
1479
1480 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
1481 fields.
1482 * root.c (root_mark): Mark them.
1483 (make_root): Initialize them.
1484
1485 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
1486 USE_COOP_THREADS.
1487 (scm_internal_select): Define one version for USE_COOP_THREADS and
1488 one for USE_NULL_THREADS.
1489 (scm_init_iselect): Likewise.
1490
1491 * inline.h (scm_cell, scm_double_cell): Also allow
1492 USE_COPT_THREADS to not protect the slot initializers.
1493
1494 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
1495 because threads need to be initialized before the stack, but
1496 gsubrs such as scm_timed_condition_variable_wait can only be
1497 created later.
1498
1499 * threads.h: Include "coop-pthreads.h" when requested.
1500 (scm_threads_make_mutex, scm_threads_lock_mutex,
1501 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
1502 not implemented anyway.
1503 (scm_init_thread_procs, scm_try_mutex,
1504 scm_timed_condition_variable_wait,
1505 scm_broadcast_condition_variable, scm_c_thread_exited_p,
1506 scm_thread_exited_p): New prototypes.
1507 (struct timespec): Define if not already defined.
1508 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
1509 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
1510 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
1511 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
1512 deprecated.
1513
1514 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
1515 requested.
1516 (scm_thread_exited_p): New.
1517 (scm_try_mutex, scm_broadcast_condition_variable): Newly
1518 registered procedures.
1519 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
1520 Use the latter as the procedure for "wait-condition-variable",
1521 thus offering a optional timeout parameter to Scheme.
1522 (scm_wait_condition_variable): Implement in terms of
1523 scm_timed_wait_condition_variable.
1524 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
1525 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
1526 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
1527 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
1528 scm_make_mutex, etc, and deprecate.
1529 (scm_init_threads): Do not create smobs, leave this to
1530 scm_threads_init. Do not include "threads.x" file.
1531 (scm_init_thread_procs): New, include "threads.x" here.
1532
1533 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
1534 scm_null_mutex_lock, scm_null_mutex_unlock,
1535 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
1536 scm_null_condvar_wait, scm_null_condvar_signal,
1537 scm_null_condvar_destroy): Removed.
1538 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
1539 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
1540 scm_cond_destory): Do not define, they are now deprecated and
1541 handled by threads.{h,c}.
1542
1543 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
1544 (scm_threads_init): Create smobs here, using the appropriate
1545 sizes.
1546 (block): Removed, now unused.
1547 (scm_c_thread_exited_p): New.
1548 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
1549 scm_null_mutex_destroy, scm_null_condvar_init,
1550 scm_null_condvar_wait, scm_null_condvar_signal,
1551 scm_null_condvar_destroy): Removed and updated users to do their
1552 task directly.
1553 (scm_try_mutex, timeval_subtract,
1554 scm_timed_wait_condition_variable,
1555 scm_broadcast_condition_variable): New.
1556 (scm_wait_condition_variable): Removed.
1557
1558 * coop-defs.h (coop_m): Added 'level' field.
1559 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
1560 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
1561 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
1562 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
1563 define.
1564 (coop_condition_variable_broadcast): New.
1565
1566 * coop-threads.c (scm_threads_init): Create smobs here, using the
1567 appropriate sizes.
1568 (scm_c_thread_exited_p, scm_try_mutex,
1569 scm_timed_wait_condition_variable,
1570 scm_broadcast_condition_variable): New.
1571 (scm_wait_condition_variable): Removed.
1572
1573 * coop.c (coop_new_mutex_init): Initialize level.
1574 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
1575 level.
1576 (coop_condition_variable_signal): Renamed to
1577 coop_condition_variable_broadcast and reimplemented in terms of
1578 that. Thus...
1579 (coop_condition_variable_broadcast): New.
1580
1581 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
1582
1583 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
1584
087ed40d
MV
15852002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
1586
65a23095
MV
1587 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
1588 of system headers.
1589
087ed40d
MV
1590 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
1591 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 1592 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 1593
5ec1d2c8
DH
15942002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
1595
1596 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
1597 scm_definedp to scm_defined_p and deprecated scm_definedp.
1598
100ae50d
DH
15992002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
1600
1601 * async.h, async.c (scm_system_async): Fixed deprecation to work
1602 correctly when deprecated features are excluded.
1603
2794cb50
MV
16042002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1605
1606 * async.c (scm_system_async_mark_for_thread): Validate thread
1607 argument.
1608
1609 * coop-threads.c (scm_i_thread_root): Do not validate argument.
1610
1611 * feature.c (scm_init_feature): Don't add 'threads' for
1612 USE_NULL_THREADS.
1613
1614 * inline.h (scm_cell, scm_double_cell): Also allow
1615 USE_NULL_THREADS to not protect the slot initializers.
1616
1617 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
1618 "USE_THREAD".
1619
1620 * Makefile.am (noinst_HEADERS): Added null-threads.c.
1621 (modinclude_HEADERS): Added null-threads.h.
1622
1623 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
1624 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
1625 (scm_init_threads): Use generic type names scm_t_mutex and
1626 scm_t_cond instead of coop_m and coop_c.
1627
1628 * null-threads.c, null-threads.h: New files.
1629
ff810d7a
MV
16302002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
1631
1632 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
1633 This is to support makes that know about "$<" only in pattern
1634 rules, like Sun's make.
1635
a90bdb73
MV
16362002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
1637
1638 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
1639 substitution. Thanks to David Allouche!
1640
e71a8bf2
DH
16412002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
1642
1643 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
1644 !SCM_ENABLE_DEPRECATED.
1645
41f77ff5
MV
16462002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1647
504d99c5 1648 * async.c (scm_system_async_mark_for_thread): Only call
41f77ff5
MV
1649 scm_i_thread_root when USE_THREADS is defined. Use scm_root
1650 otherwise.
1651
1652 * scmsigs.c (take_signal): Only call scm_i_thread_root when
1653 USE_THREADS is defined. Use scm_root otherwise.
1654 (scm_sigaction_for_thread): Ignore THREAD argument when
1655 USE_THREADS is not defined. Also, move THREAD argument defaulting
1656 out of HAVE_SIGACTION section, which was a bug.
1657
6d16b125
MV
16582002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1659
1660 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
1661 signal_handlers, not the closure that is used as the async.
1662 The closure is stored in signal_handler_cells, as previously.
1663
acfa1f52
MV
16642002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
1665
1666 * root.h (scm_root_state): Added 'block_async' slot.
1667 (scm_active_asyncs): Removed abbrev.
1668 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
1669
1670 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
1671 abbrev.
1672
1673 * async.h (scm_call_with_blocked_asyncs,
1674 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
1675 scm_c_call_with_unblocked_asyncs): New prototypes.
1676 (scm_mask_signals, scm_unmask_signals): Deprecated.
1677 (scm_mask_ints): Turned into a macro.
1678 * async.c (scm_mask_ints): Removed.
1679 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
1680 this should not be necessary.
1681 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
1682 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
1683 deprecation warning and check for errornous use. Set block_asyncs
1684 instead of scm_mask_ints.
1685 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
1686 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
1687 scm_c_call_with_unblocked_asyncs): New.
1688
1689 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
1690 Asyncs are enabled by default.
1691
34010f56
NJ
16922002-10-09 Neil Jerram <neil@ossau.uklinux.net>
1693
1694 * vports.c (scm_make_soft_port): Allow vector argument to carry a
1695 6th element: an input waiting thunk.
1696 (sf_input_waiting): New.
1697
9310d6f2
MV
16982002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
1699
1700 * root.c (root_mark): Mark active_asyncs slot.
1701
1702 * async.c (scm_async_click): Set the cdr of a executed handler
1703 cell to SCM_BOOL_F, not SCM_EOL.
1704 (scm_i_queue_async_cell): Queue the cell at the end of the list,
1705 and only if the handler procedure is not already present.
1706 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
1707 with SCM_BOOL_F.
1708 * scmsigs.c (scm_sigaction_for_thread): Likewise.
1709
ac48c719
RB
17102002-10-04 Rob Browning <rlb@defaultvalue.org>
1711
1360a142
RB
1712 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
1713
1714 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
1715 scm_lt_dlopenext, and scm_lt_dlerror.
1716 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
1717 and scm_lt_dlerror.
1718 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
1719 and scm_lt_dlerror.
1720 (sysdep_dynl_init): switch to scm_lt_dlinit();
1721
1722 * Makefile.am (libguile_la_LIBADD): switch to use
1723 libguile-ltdl.la.
1724
504d99c5 1725 * numbers.c (scm_integer_expt): (expt 0 1) should be 1.
ac48c719 1726
497092c9
MV
17272002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
1728
1729 * scmsigs.h (scm_sigaction_for_thread): New prototype.
1730 * scmsigs.c (got_signal): Removed.
1731 (signal_handler_cells, signal_handler_threads): New.
1732 (take_signal): Queue the cell of the signal for the specified
1733 thread. Reset the signal handler on systems that don't have
1734 sigaction.
1735 (sys_deliver_signals): Removed.
1736 (close_1): New.
1737 (scm_sigaction_for_thread): Renamed from scm_sigaction and
1738 extended to also set the thread of a signal and allocate a cell
1739 for it. Keep the Scheme name "sigaction". Check that signum is
1740 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
1741 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
1742 (scm_init_scmsigs): Allocate signal_handler_cells and
1743 signal_handler_threads vectors.
1744
1745 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
1746 that system asnycs and user asyncs are separated. Reimplemented
1747 system asyncs to work per-thread.
1748
1749 * gc.c (scm_init_gc): Do not use scm_system_async.
1750
1751 * async.h (scm_asyncs_pending, scm_set_tick_rate,
1752 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
1753 Removed prototypes.
1754 (scm_i_queue_async_cell): New.
1755
1756 * __scm.h (scm_asyncs_pending_p): Removed.
1757 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
1758 scm_asyncs_pending_p.
1759
1760 * async.h (scm_system_async_mark_for_thread): New prototype.
1761
1762 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
1763
1764 * root.h (scm_root_state): Added new "active_asyncs" slot.
1765 * root.c (scm_make_root): Initialize it to SCM_EOL.
1766
1767 * coop-defs.h (coop_t): Added new "handle" slot.
1768 * coop-threads.c (all_threads, scm_current_thread,
1769 scm_all_threads, scm_i_thread_root): New.
1770 (scm_threads_init): Add main thread to all_threads.
1771 (scheme_launch_thread): Remove thread from all_threads when it
1772 terminates.
1773 (scm_call_with_new_thread): Initialize handle slot of coop_t
1774 structure and add new thread to all_threads.
1775 (scm_spawn_thread): Likewise.
1776
1777 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
1778 * threads.c (scm_current_thread, scm_all_threads): Register as
1779 primitives.
1780
1781 * dynl.c: Use scm_lt_ prefix for libltdl functions.
1782
480fa28d
NJ
17832002-09-29 Neil Jerram <neil@ossau.uklinux.net>
1784
1785 * script.c (scm_compile_shell_switches): Fix bad spelling of
1786 `explicitly' in comment.
1787
17882002-09-28 Neil Jerram <neil@ossau.uklinux.net>
1789
1790 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
1791 Refer to provided? in doc string rather than deprecated feature?.
1792
3553e1d1
GH
17932002-09-24 Gary Houston <ghouston@arglist.com>
1794
1795 * inline.h (scm_double_cell): prevent reordering of statements
1796 with any following code (for GCC 3 strict-aliasing).
1797 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
1798 the earlier version of the reordering prevention.
1799
4ad0814a
HWN
18002002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1801
1802 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
1803
e88e4f2e
HWN
18042002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1805
1806 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
1807 protection.
1808
1e71eafb
HWN
18092002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1810
1811 * inline.h: include stdio.h
1812
1813 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
1814
61ef9c1f
HWN
18152002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1816
dac04e9f
HWN
1817 * gc-segment.c (scm_i_make_initial_segment): check user settings
1818 for sanity.
1819
1820 * gc-malloc.c (scm_gc_init_malloc): check user settings for
1821 sanity.
dac04e9f
HWN
1822
1823 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
1824
ffd72400
HWN
1825 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
1826
1827 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
1828 these won't ever wrap around with high memory usage. Thanks to
1829 Sven Hartrumpf for finding this.
ffd72400 1830
5bd4a949
HWN
1831 * gc-freelist.c: include <stdio.h>
1832
61ef9c1f
HWN
1833 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
1834
ffd0ef3b
MV
18352002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
1836
a27e3d14
MV
1837 * vectors.h (SCM_VECTOR_REF): New.
1838
ffd0ef3b
MV
1839 * snarf.h (SCM_DEFINE_PUBLIC): New.
1840
f8a1712b
MV
18412002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
1842
1843 * socket.c (scm_addr_vector): Added size of address to arguments.
1844 Use it to avoid accessing a non-existent path in a sockaddr_un.
1845 Changed all callers.
1846
7200a36b
HWN
18472002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1848
1383773b
HWN
1849 * gc.h: remove DOUBLECELL card flags.
1850
1851 * gc-malloc.c (scm_calloc): try to use calloc() before calling
1852 scm_realloc().
1853
1854 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
1855 init loop; handle this from scm_init_card_freelist()
1856
1857 * gc-card.c (scm_init_card_freelist): init bit vector here.
1858
7200a36b 1859 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 1860 num2float.i.c (FLOAT2NUM): idem
7200a36b 1861
9981de3a
HWN
18622002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1863
1864 * eval.h: prepend libguile/ to include path
1865
19647556
MV
18662002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
1867
1868 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
1869