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