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