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