(scm_product): In complex * bignum, correction to
[bpt/guile.git] / libguile / ChangeLog
CommitLineData
0aacf84e
MD
12003-07-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
2
3 * numbers.c (scm_odd_p, scm_even_p): Bugfix: Treat result of
4 scm_inf_p test as Scheme values.
5 (scm_sum): Bugfix: Normalize bignum created from a negative bignum
6 and a positive inum.
7 Use GNU indentation style.
8
192de9a4
DH
92003-07-12 Dirk Herrmann <D.Herrmann@tu-bs.de>
10
11 * values.c (scm_values): Build lists of length 1 by using
12 scm_list_1 instead of using scm_cons.
13
bbb4438a
KR
142003-07-10 Kevin Ryde <user42@zip.com.au>
15
b58c85ce
KR
16 * deprecation.c (scm_c_issue_deprecation_warning_fmt): Add va_end.
17 * list.c (scm_list_n): Ditto.
18
bbb4438a
KR
19 * gc-malloc.c (scm_gc_realloc): Define "ptr" at start of function.
20
287f8ad1
KR
212003-07-08 Matthias Koeppe <mkoeppe@merkur.math.uni-magdeburg.de>
22
23 * tags.h (scm_t_bits, scm_t_signed_bits, etc): Avoid solaris empty
24 defines of INTPTR_MAX and UINTPTR_MAX, combine conditionals for
25 scm_t_bits and scm_t_signed_bits to avoid any chance of one and not
26 the other using intptr_t.
27
005d2366
KR
282003-07-08 Kevin Ryde <user42@zip.com.au>
29
0aacf84e 30 * numbers.c (scm_make_polar): Use sincos, when available.
005d2366
KR
31 (scm_magnitude): Use hypot.
32
33 * ports.c (scm_char_ready_p, scm_peek_char): In docstrings, don't use
34 @footnote since it doesn't go through to guile-procedures.txt.
35
36 * threads.c (scm_call_with_new_thread): In docstring, use "( )"
37 outside @var to quieten makeinfo, and use @code.
38
cbfe8e62
HWN
392003-07-06 Han-Wen Nienhuys <hanwen@cs.uu.nl>
40
41 * gc-malloc.c (decrease_mtrigger): new function
42 (increase_mtrigger): new function, separate debug registering and
43 mtrigger administration.
44 (scm_gc_realloc): bugfix: do mtrigger administration before the
45 actual realloc, for the realloc might invalidate a GC-d segment of
46 memory. Thanks to Sam Hocevar for pointing this out.
47 (scm_gc_realloc): use scm_malloc_reregister instead of
48 unregistering and registering in sequence.
49
aeb4c2e1
HWN
502003-07-03 Han-Wen Nienhuys <hanwen@cs.uu.nl>
51
52 * __scm.h (SCM_ASSERT): change "else" expansion to "do { } while (0)"
53
4c27f8d2
HWN
542003-07-02 Han-Wen Nienhuys <hanwen@cs.uu.nl>
55
56 * __scm.h (SCM_ASRTGO): add "else" to macro expansions with if
57 clauses.
58
983e697d
MV
592003-06-29 Marius Vollmer <mvo@zagadka.de>
60
61 * deprecated.h (SCM_OPDIRP, scm_fport, scm_option, scm_srcprops,
62 scm_srcprops_chunk, scm_info_frame, scm_stack, scm_array,
63 scm_array_dim, SCM_ARRAY_CONTIGUOUS, SCM_FUNC_NAME, SCM_WTA,
64 RETURN_SCM_WTA, SCM_VALIDATE_NUMBER_COPY,
65 SCM_VALIDATE_NUMBER_DEF_COPY, SCM_VALIDATE_OPDIR): Re-added from
66 the release_1_6 branch.
67
78b6566e
SJ
682003-06-25 Stefan Jahn <stefan@lkcc.org>
69
70 * continuations.c: Redeclaration of getcontext() via the
71 __asm__ ("getcontext") directive.
72
73 * continuations.h: Include <ucontext.h> instead of
74 <sys/ucontext.h>.
75
1ebb8497
KR
762003-06-21 Kevin Ryde <user42@zip.com.au>
77
78 * numbers.c (_GNU_SOURCE): #define, to get C99 things.
79 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, $asinh, $acosh,
80 $atanh, truncate): Use C library asinh, acosh, atanh and trunc, when
81 available.
82 (scm_inexact_to_exact): Expand isfinite to its definition !xisinf.
83 (isfinite): Remove, conflicts with C99 isfinite().
84
fbf85ba4
MV
852003-06-19 Marius Vollmer <mvo@zagadka.de>
86
87 * deprecated.h, deprecated.c (scm_strhash, scm_sym2ovcell_soft,
88 scm_sym2ovcell, scm_intern_obarray_soft, scm_intern_obarray,
89 scm_symbol_value0, scm_string_to_obarray_symbol scm_intern_symbol,
90 scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned_p,
91 scm_symbol_bound_p, scm_symbol_set_x, scm_gentemp): Re-added from
92 the release_1_6 branch.
93
fcc5d734
SJ
942003-06-14 Stefan Jahn <stefan@lkcc.org>
95
96 * threads.h: Redefined scm_getspecific() and scm_setspecific()
97 to be functions instead of macros.
98
99 * threads.c: Conditionalized inclusion of <sys/time.h> and
100 <unistd.h>.
101 (scm_getspecific, scm_setspecific): Made these two function
102 real part of the API.
103
104 * posix.c (s_scm_putenv): Added some code to make a
105 (putenv "FOO="), i.e. setting an empty string, work also on
106 Win32 systems. Thanks to Kevin Ryde for the proposal.
107
c3ae8e07
KR
1082003-06-12 Kevin Ryde <user42@zip.com.au>
109
75b14838
KR
110 * posix.c (scm_putenv): Free temporary ptr in mingw unset. Add
111 freebsd to comment about need to use unsetenv.
c3ae8e07 112
9d9fa092
MV
1132003-06-02 Marius Vollmer <mvo@zagadka.de>
114
115 * ports.c (scm_peek_char): Safe the column of the port around the
116 getc/ungetc calls. Thanks to Dr. Peter Ivanyi!
117
f2478375
KR
1182003-06-07 Kevin Ryde <user42@zip.com.au>
119
120 * tags.h: Use inttypes.h and stdint.h when available, for INTPTR_MAX
121 and friends required by scm_t_bits setups.
122
6375e040
DH
1232003-06-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
124
125 * tags.h (scm_tc2_int): Added.
126
127 * tags.h (scm_tc3_int_1, scm_tc3_int_2): Expressed in terms of
128 scm_tc2_int.
129
130 * tags.h (scm_tcs_cons_imcar, scm_tcs_cons_nimcar, scm_tcs_struct,
131 scm_tcs_closures): Hard coded values replaced by symbolic ones.
132
f5c6ec2f
DH
1332003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
134
135 * eval.c: Partially undid my patch from 2003-05-31. This patch
136 caused the segfault referenced in the previous changelog entry.
137
47dbd81e
DH
1382003-06-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
139
140 * tags.h: Fixed comment about the immediate type code layout.
141
142 * eval.c: Fixed handling of non-special instructions. Without
143 this patch, guile will segfault on (#\0) and similar instructions.
144
3ec52c51
KR
1452003-06-05 Kevin Ryde <user42@zip.com.au>
146
147 * numbers.c (scm_max, scm_min): For inum, bignum and real, if other
148 operand is NaN, then return NaN. Also avoid passing NaN to mpz_cmp_d.
149
e418bd7c
KR
150 * read.c (scm_input_error): Pass arg list parameter to scm_error_scm,
151 rather than SCM_EOL. Needed by "Unknown # object" case in scm_lreadr.
152
d0624e39
DH
1532003-06-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
154
155 * __scm.h, gc-card.c (SCM_DEBUG_DEBUGGER_SUPPORT,
156 SCM_DEBUG_DEBUGGING_SUPPORT): Renamed macro
157 SCM_DEBUG_DEBUGGER_SUPPORT to SCM_DEBUG_DEBUGGING_SUPPORT and
158 generalized it to apply not only to C level functions but also to
159 scheme level functions.
160
161 * debug.c, debug.h, eval.c (make-iloc, scm_make_iloc, iloc?,
162 scm_iloc_p, dbg-make-iloc, scm_dbg_make_iloc, dbg-iloc?,
163 scm_dbg_iloc_p): Moved functions scm_make_iloc, scm_iloc_p to
164 eval.c, made them available under SCM_DEBUG_DEBUGGING_SUPPORT == 1
165 only and renamed them to scm_dbg_make_iloc, scm_dbg_iloc_p,
166 respectively.
167
168 * deprecated.h, eval.c, eval.h (SCM_ILOC00, SCM_IDINC,
169 SCM_IDSTMSK): Deprecated. The macro definitions are moved from
170 eval.h into eval.c and a copy is placed into deprecated.h.
171
172 * eval.c, eval.h (SCM_MAKE_ILOC): Removed from eval.h and placed
173 into eval.c. This definition was not part of the API in any
174 officially released version of guile and thus does not need to go
175 through a phase of deprecation.
176
e90c3a89
DH
1772003-06-02 Dirk Herrmann <D.Herrmann@tu-bs.de>
178
d0624e39
DH
179 * deprecated.c, deprecated.h, eval.c, eval.h (scm_s_expression,
180 scm_s_test, scm_s_body, scm_s_bindings, scm_s_variable,
181 scm_s_clauses, scm_s_formals): Deprecated. In eval.c the
e90c3a89
DH
182 definitions are make static and renamed from scm_s_xxx to s_xxx.
183 In deprecated.c the original definitions are copied.
184
d0624e39
DH
185 * deprecated.h, eval.c, eval (SCM_EVALIM2, SCM_EVALIM, SCM_XEVAL,
186 SCM_XEVALCAR): Deprecated. The macro definitions are moved from
e90c3a89
DH
187 eval.h into eval.c and a copy (slightly modified to work in user
188 code) is placed into deprecated.h.
189
190 * eval.c: Use the local static s_xxx definitions instead of the
191 scm_s_xxx definitions throughout.
192
14b18ed6
DH
1932003-06-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
194
195 This set of patches separates the representation of the cxr family
196 of functions (car, cdr etc.) from the dsubr family of functions
197 (i. e. functions that take a double precision floating point
198 argument). Further, the algorithm for handling the cxr function
199 is improved.
200
201 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_1), numbers.c
202 (scm_asinh, scm_acosh, scm_atanh, scm_truncate, scm_round, floor,
203 ceil, sqrt, fabs, exp, log, sin, cos, tan, asin, acos, atan, sinh,
204 cosh, tanh), objects.c (scm_class_of), procprop.c
205 (scm_i_procedure_arity), ramap.c (scm_array_map_x), tags.h
206 (scm_tc7_dsubr, scm_tcs_subrs): Introduce scm_tc7_dsubr as new
207 typecode for the dsubr family of functions.
208
209 * ramap.c (ramap_cxr, ramap_dsubr): Renamed ramap_cxr to
210 ramap_dsubr.
211
212 * eval.c (SCM_CEVAL, SCM_APPLY, call_cxr_1), pairs.c
213 (scm_init_pairs): Make use of the (now usable) second cell element
214 of a scm_tc7_cxr function to implement the cxr family of functions
215 more efficiently.
216
2ca0d207
DH
2172003-05-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
218
219 * eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_0,
220 scm_trampoline_1, scm_trampoline_2): Postpone error cases to the
221 end of an if-else-if-sequence of checks.
222
9a069bdd
DH
2232003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
224
225 * eval.c (SCM_CEVAL): Improved readability of call-with-values
226 execution. Generalize apply_closure to apply_proc and use that
227 for call-with-values.
228
e910e9d2
DH
2292003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
230
231 * eval.c (SCM_CEVAL): Avoid one level of indirection when applying
232 a non closure.
233
1e498fbd
SJ
2342003-05-30 Stefan Jahn <stefan@lkcc.org>
235
236 * posix.c (s_scm_putenv): Use the new HAVE_UNSETENV
237 appropriately for mingw32 hosts.
238
239 * numbers.h: Defining copysign(), isnan() and finite() to
240 be prefixed by a single '_' for mingw32 hosts.
241
c47e2599
KR
2422003-05-30 Kevin Ryde <user42@zip.com.au>
243
244 * numbers.c (z_negative_one): New variable.
245 (scm_init_numbers): Initialize it.
246 (scm_logcount): Use it and mpz_hamdist to count zeros for negatives.
247
2e945bcc
SJ
2482003-05-29 Stefan Jahn <stefan@lkcc.org>
249
250 * win32-dirent.c: Use malloc() instead of scm_malloc().
251
252 * stime.c (s_scm_strftime): Add a type cast to avoid compiler
253 warning.
254
255 * posix.c (s_scm_putenv): Disable use of unsetenv() for the
256 mingw32 build.
257
258 * modules.c (s_scm_module_import_interface): Renamed local
259 variable interface to _interface. Seems like 'interface'
260 is a special compiler directive for the mingw32 compiler.
261
262 * mkstemp.c: Provide prototype to avoid compiler warning.
263
264 * load.c (s_scm_search_path): Fixed absolute and relative
265 path detections for native Windows platforms.
266
267 * gc.h, threads.h: Export some more symbols using SCM_API (necessary
268 to build on mingw32).
269
270 * gc-freelist.c ("s_scm_map_free_list",
271 "s_scm_gc_set_debug_check_freelist_x"): Fixed use of FUNC_NAME.
272
273 * fports.c (fport_fill_input): Disable use of
274 fport_wait_for_input() on Win32 platforms.
275
276 * filesys.c (s_scm_basename): Fixed __MINGW32__ code.
277
278 * Makefile.am: Modified some rules for cross compiling.
279
ddd8f927
DH
2802003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
281
282 * eval.c (SCM_CEVAL): In case of an application, all checks for a
283 proper function object and the correct number of arguments are now
284 performed in the application part of SCM_CEVAL.
285
286 (scm_badformalsp): Removed.
287
f8ba2197
DH
2882003-05-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
289
290 * deprecated.c (scm_read_and_eval_x): Fixed C99-ism.
291
79f55b7c
MD
2922003-05-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
293
a502595f
MD
294 * num2integral.i.c (NUM2INTEGRAL): Avoid warning about conditional
295 always being false by inserting preprocessor conditional. (Thanks
296 to Bruce Korb.)
297
79f55b7c
MD
298 * __scm.h (SCM_STACK_PTR): New macro. (Cast argument through
299 (void *) in order to avoid an aliasing warning; thanks to Bruce
300 Korb.)
301
302 * stackchk.h (SCM_STACK_OVERFLOW_P): Use SCM_STACK_PTR.
303
304 * threads.c (suspend, launch_thread, scm_threads_mark_stacks): Use
305 SCM_STACK_PTR.
306
307 * threads.c (scm_threads_mark_stacks): Bugfix: Changed
308 thread->base --> t->base.
309
310 * eval.c (SCM_CEVAL): Don't cast argument of SCM_STACK_OVERFLOW_P.
311
47dee228
MV
3122003-05-20 Marius Vollmer <marius.vollmer@uni-dortmund.de>
313
314 * deprecated.h, deprecated.c (scm_makstr, scm_makfromstr,
315 scm_variable_set_name_hint, scm_builtin_variable,
316 scm_internal_with_fluids, scm_make_gsubr,
317 scm_make_gsubr_with_generic, scm_create_hook, SCM_LIST0,
318 SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6,
319 SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify, scm_sloppy_memq,
85494587
MV
320 scm_sloppy_memv, scm_sloppy_member, scm_read_and_eval_x,
321 scm_subr_entry, SCM_SUBR_DOC, scm_make_subr,
322 scm_make_subr_with_generic, scm_make_subr_opt,
323 scm_call_catching_errors, scm_make_smob_type_mfpe,
324 scm_set_smob_mfpe, scm_strprint_obj, scm_read_0str, scm_eval_0str,
325 SCM_CHARS, SCM_UCHARS, SCM_LENGTH): Re-added from the release_1_6
326 branch. Some have been slightly rewritten.
327 (scm_i_object_chars, scm_i_object_length): New, to support
328 SCM_CHARS, SCM_UCHARS, and SCM_LENTH.
329
e681d187
DH
3302003-05-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
331
332 * eval.c (scm_m_do, unmemocopy, SCM_CEVAL): Reversed order of
333 names and inits in the memoized code of do.
334
7e59d9d4
MD
3352003-05-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
336
337 * c-tokenize.lex (yyget_lineno, yyget_in, yyget_out, yyget_leng,
338 yyget_text, yyset_lineno, yyset_in, yyset_out, yyget_debug,
339 yyset_debug, yylex_destroy): Added prototypes (otherwise we'll get
340 a compilation error if error-on-warning is enabled).
341
9d9fa092 342>>>>>>> 1.1883
9950a42c
MV
3432003-05-17 Marius Vollmer <mvo@zagadka.de>
344
345 * c-tokenize.lex: Gobble up complete lines after a '#'. This
346 removes preprocessor directives from the snarfage that might
347 otherwise confuse us. These directives appear when compiling with
348 "-g3", for example.
349
0068984b
HWN
3502003-05-16 Han-Wen Nienhuys <hanwen@cs.uu.nl>
351
26e68795
HWN
352 * ChangeLog: add my surname
353
0068984b
HWN
354 * srcprop.c (scm_finish_srcprop): use
355 scm_gc_register_collectable_memory()
356 (scm_make_srcprops): idem.
357
131805f0
HWN
3582003-05-14 Han-Wen Nienhuys <hanwen@cs.uu.nl>
359
360 * gc-malloc.c (scm_gc_register_collectable_memory): avoid
361 wrap-around for scm_mtrigger
362 (scm_gc_register_collectable_memory): abort on overflowing
363 scm_mallocated().
364
d4611024
KR
3652003-05-13 Kevin Ryde <user42@zip.com.au>
366
367 * numbers.c (xmpz_cmp_d): New macro, handling infs if gmp doesn't.
368 (scm_num_eq_p, scm_less_p, scm_max, scm_min): Use it.
369
7aaf8dc9
MD
3702003-05-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
371
dfd03fb9
MD
372 * backtrace.c (scm_display_error_message): Introduced fancy
373 printing with max level 7 and length 10. (Purpose: avoid printing
374 gigantic objects in error messages.)
375
376 * print.c, print.h (scm_i_port_with_print_state): New function.
377
378 * print.c (scm_iprin1, scm_printer_apply,
379 scm_port_with_print_state): Use scm_i_port_with_print_state.
380 (scm_simple_format): Modified not to destroy print states.
381 (print_state_mutex): New mutex.
382 (scm_make_print_state, scm_free_print_state, scm_prin1):
383 Lock/unlock print_state_mutex.
384
7aaf8dc9
MD
385 * deprecated.h (SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK):
386 Use current names in definitions.
387
a4d9ffa1
KR
3882003-05-10 Kevin Ryde <user42@zip.com.au>
389
390 * numbers.c (scm_num_eq_p, scm_less_p): Don't pass NaN to mpz_cmp_d.
391
d25e96a4
KR
392 * numbers.c (scm_integer_length): On negative bignums, adjust
393 mpz_sizeinbase to account for it looking at absolute value where we
394 want ones-complement.
395
396 * numbers.c (scm_gcd): In bignum/inum, don't pass yy==0 to mpz_gcd_ui
397 since we're only using the ulong return value, and x might not fit.
398
5bf6a6f0
DH
3992003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
400
401 * eval.c, eval.h, read.c, read.h (scm_sym_dot): Moved from eval to
402 read. This will allow to make the definition in read.c static.
403
f58c472a
DH
4042003-05-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
405
406 * eval.c, eval.h, evalext.c, evalext.h (scm_m_undefine): Moved
407 from evalext to eval. This will allow to make some of the
408 definitions in eval.c static.
409
90382aeb
KR
4102003-05-06 Kevin Ryde <user42@zip.com.au>
411
412 * numbers.c (scm_difference): In inum - bignum, handle negative inum.
413 (scm_logcount): Use mpz_com, not mpz_neg.
414
3b88ed2a
DH
4152003-05-04 Dirk Herrmann <D.Herrmann@tu-bs.de>
416
417 The purpose of this patch is to make guile's internal memoizers
418 distinguishable from memoizing macros created on the scheme level
419 or from user provided primitive memoizing macros. The reason is,
420 that the internal memoizers are the only ones that are allowed to
421 transform their scheme input into memoizer byte code, while all
422 other memoizing macros may only transform scheme code into new
423 scheme code.
424
425 To achieve this, a new macro type 'builtin-macro!' is introduced.
426 Currently, 'builtin-macro!'s are handled as memoizing macros, but
427 this will change when the memoizer and executor are separated.
428
429 * macros.[ch] (scm_i_makbimacro): New.
430
431 * macros.h (SCM_BUILTIN_MACRO_P): New.
432
433 * macros.c (macro_print, scm_macro_type): Support builtin-macro!s.
434
435 * eval.c, goops.c: All of guile's primitive memoizing macros are
436 primitive builtin-macros now.
437
438 * eval.c (scm_macroexp, SCM_CEVAL): Make sure the primitive
439 builtin-macros are handled equally to memoizing macros.
440
b0780eb1
MV
4412003-05-04 Marius Vollmer <mvo@zagadka.de>
442
443 * throw.c (scm_ithrow): Remove "asm volatile" hack. It used to
444 work around a bug in GCC 2.95.2 but is now a bug in itself.
445
1cbf4fe9
MV
4462003-05-02 Marius Vollmer <mvo@zagadka.de>
447
448 * deprecated.h (scm_rstate, scm_rng, SCM_SLOPPY_CONSP,
449 SCM_SLOPPY_NCONSP, scm_tc7_ssymbol, scm_tc7_msymbol,
450 scm_tcs_symbols): New.
451
1a61d41b
MV
4522003-04-30 Marius Vollmer <marius.vollmer@uni-dortmund.de>
453
096ecbaf
MV
454 * deprecated.h, deprecated.c (scm_protect_object,
455 scm_unprotect_object, SCM_SETAND_CAR, SCM_SETOR_CAR,
456 SCM_SET_AND_CDR, SCM_SET_OR_CDR, SCM_FREEP, SCM_NFREEP,
457 SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16,
458 SCM_GCCDR, scm_remember, scm_the_root_module, scm_make_module,
459 scm_ensure_user_module, scm_load_scheme_module, scm_port,
460 scm_ptob_descriptor, scm_port_rw_active,
461 scm_close_all_ports_except): New.
462
1a61d41b
MV
463 * ports.c (scm_c_port_for_each): New function, mostly copied from
464 scm_port_for_each.
465 (scm_port_for_each): Reimplemented using scm_c_port_for_each.
466 * ports.h (scm_c_port_for_each): New prototype.
467
c8e1d354
MD
4682003-04-28 Mikael Djurfeldt <djurfeldt@nada.kth.se>
469
470 * eval.c (scm_m_atdispatch): Removed until actually needed. (This
471 macro was introduced in anticipation of GOOPS method compilation
472 code.)
473
474 * goops.c: Removed binding of @dispatch.
475
a4aa2134
DH
4762003-04-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
477
478 * eval.c, goops.c (@dispatch, @slot-ref, @slot-set!): Move the
479 instructions that bind the macros on the scheme level back to
480 goops.c in order to make sure again that the bindings go into the
481 (oop goops) module and are not visible from the outside.
482
9fbee57e
DH
4832003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
484
485 * eval.c: Non functional change: Separated R5RS and non-R5RS
486 macros into different sections of the file and ordered the
487 memoizers alphabetically.
488
12841895
DH
4892003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
490
491 * eval.c (scm_ilookup): Rewritten to improve readability.
492
6a3f13f0
DH
4932003-04-27 Dirk Herrmann <D.Herrmann@tu-bs.de>
494
495 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
496 Partially reverted patch from 2003-04-23 in oder to find a better
497 compromise between readability and debuggability.
498
b0c5d67b
DH
4992003-04-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
500
501 * eval.c, eval.h, goops.c, goops.h (scm_m_atslot_ref,
502 scm_m_atslot_set_x, scm_m_atdispatch): Move the declarations and
503 definitions of the special goops memoizers from goops.[ch] to
504 eval.[ch]. Hmm... it seems that scm_m_atdispatch is not used
505 throughout guile.
506
b9ad392e
MD
5072003-04-24 Mikael Djurfeldt <mdj@kvast.blakulla.net>
508
509 * ports.c, ports.h (scm_i_port_table_mutex): New mutex.
510
511 * fports.c (scm_evict_ports): Lock/unlock scm_i_port_table_mutex.
512
513 * ports.c (scm_close_port, scm_flush_all_ports): Ditto.
514
515 * ioext.c (scm_fdes_to_ports): Ditto.
516
517 * vports.c (scm_make_soft_port): Changed SCM_DEFER/ALLOW_INTS into
518 lock/unlock scm_i_port_table_mutex.
519
520 * strports.c (scm_mkstrport): Ditto.
521
522 * ports.c (scm_void_port, scm_port_for_each): Ditto.
523
524 * fports.c (scm_fdes_to_port): Ditto.
525
d0b07b5d
DH
5262003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
527
528 This set of patches contains no functional changes, only debatable
529 minor stylistic ones. Still, in order to prepare a patch between
530 my local copy and the CVS version, I decided to submit the changes
531 below. Then, the patch will hopefully only contain relevant
532 modifications :-)
533
534 * eval.c (iqq): Added const specifier.
535
536 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
537 Use NULL instead of 0 to indicate that a pointer is returned.
538 Removed some misleading 'fall through' comments.
539
540 * eval.c (scm_i_call_closure_0, call_closure_1, call_closure_2):
541 Split up long expressions into smaller ones to be more debugging
542 friendly.
543
a98e8e98
DH
5442003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
545
546 * eval.h (SCM_ENTER_FRAME_HDLR, SCM_APPLY_FRAME_HDLR,
547 SCM_EXIT_FRAME_HDLR): Use SCM_PACK to convert data to a SCM value
548 rather than casting to SCM.
549
c178c3a6
DH
5502003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
551
552 * sort.c, pairs.h: Removed unnecessary includes.
553
d339981a
DH
5542003-04-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
555
556 * sort.c: Replaced hand-made trampline code by the new official
557 mechanism from eval.c. This fixes a segfault in the new test file
558 sort.test.
559
560 (quicksort, compare_function, scm_restricted_vector_sort_x,
561 scm_sorted_p, scm_merge, scm_merge_list_x, scm_merge_x,
562 scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x,
563 scm_merge_vector_step, scm_stable_sort_x, scm_stable_sort,
564 scm_sort_list_x, scm_sort_list): Use trampoline mechanism from
565 eval.c.
566
567 (subr2less, lsubrless, closureless, applyless, scm_cmp_function,
568 cmp_fun_t): Removed.
569
570 (compare_function): Added.
571
572 * sort.c (quicksort, SWAP, stack_node): Replaced pointer
573 arithmetics with index arithmetics. Changed quicksort to work on
574 an array of SCM values instead of an array of characters. Avoid
575 bytewise copying of SCM elements. Avoid allocating memory on the
576 stack with alloca. Fixed some comments.
577
821f18a4
DH
5782003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
579
580 * eval.c (EXTEND_ENV): Eliminated.
581
582 (unmemocopy, SCM_CEVAL, SCM_APPLY): Use SCM_EXTEND_ENV instead of
583 EXTEND_ENV.
584
94fb5a6e
DH
5852003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
586
587 * __scm.h (SCM_DEBUG_DEBUGGER_SUPPORT): New compile-time option.
588
589 * gc.card.c (scm_gc_marked_p): Fixed compiler warning when
590 compiling with SCM_DEBUG==1 by moving definition behind prototype.
591
592 * gc.card.c (scm_dbg_t_list_cell, scm_dbg_t_double_cell,
593 scm_dbg_gc_marked_p, scm_dbg_gc_get_card, scm_dbg_gc_get_bvec,
594 scm_t_list_cell_struct, scm_t_list_cell, scm_t_double_cell,
595 scm_gc_marked_p, scm_gc_get_card, scm_gc_get_bvec): Fixed
596 functions such that they check if the object is a non-immediate.
597 Further, renamed identifiers to use the scm_dbg_ prefix and made
598 their inclusion into the lib dependent of the
599 SCM_DEBUG_DEBUGGER_SUPPORT compile time option.
600
fce0b22d
DH
6012003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
602
603 * __scm.h: Fixed comment about the SCM_DEBUG_TYPING_STRICTNESS
604 debug option.
605
1685446c
DH
6062003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
607
821f18a4 608 * list.c (scm_ilength, scm_last_pair), unif.c (l2ra): Prefer
1685446c
DH
609 !SCM_CONSP over SCM_NCONSP. Now, guile itself does not include
610 any calls to SCM_NCONSP any more.
611
612 * unif.c (l2ra): Eliminate redundant check.
613
9ff1720f
DH
6142003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
615
616 * list.c (scm_cons_star), ramap.c (scm_ra_sum, scm_ra_product,
617 scm_array_map_x), unif.c (l2ra): Prefer !SCM_NULLP over
618 SCM_NNULLP. Now, guile itself does not include any calls to
619 SCM_NNULLP any more.
620
05b15362
DH
6212003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
622
623 * eval.c (unmemocopy, SCM_APPLY, scm_map, scm_for_each,
624 scm_copy_tree): Place assignment expressions which are part of
625 other expressions into an expression of their own.
626
0c88d7df
DH
6272003-04-21 Dirk Herrmann <D.Herrmann@tu-bs.de>
628
629 * goops.c (TEST_CHANGE_CLASS, scm_sys_initialize_object): Don't
630 compare SCM values with !=.
631
5cb22e96
DH
6322003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
633
634 * eval.c, eval.h, evalext.c, evalext.h (scm_sym_setter,
635 scm_m_generalized_set_x, scm_init_evalext): Move the declaration
636 and definition of the memoizer for the generalized set! macro from
637 evalext.[ch] to eval.[ch]. Use the SCM_SYNTAX snarfer macro to
638 define the macro object.
639
640 * eval.c, eval.h (s_set_x, scm_s_set_x, scm_m_set_x,
641 scm_m_generalized_set_x): Since now scm_s_set_x is only used in
642 eval.c, it is made static and renamed to s_set_x.
643
644 * evalext.c (scm_defined_p, scm_m_undefine): Prefer !SCM_<foo>
645 over SCM_N<foo>.
646
a44a9715
DH
6472003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
648
649 * eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds,
650 scm_init_eval): Made scm_undefineds static in eval.c, renamed it
651 to undefineds and registered the object as a permanent object.
652
653 * eval.c, eval.h (scm_f_apply, scm_init_eval): Made scm_f_apply
654 static in eval.c, renamed it to f_apply and registered the object
655 as a permanent object.
656
1b43d24c
DH
6572003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
658
5cb22e96 659 * eval.c (SCM_BIT7, SCM_BIT8, unmemocopy, SCM_CEVAL): Renamed
1b43d24c
DH
660 file-local macro SCM_BIT8 to SCM_BIT7, which is more appropriate.
661
aec16f99
DH
6622003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
663
664 * numbers.c (scm_logtest): Fixed argument bug in the call to
665 mpz_and, which showed up when compiling with SCM_DEBUG defined.
666
f96460ce
DH
6672003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
668
669 * gc-card.c (scm_i_sweep_card, scm_i_init_card_freelist): Fixed
670 type errors that showed up when compiling with SCM_DEBUG defined.
671
d0f6ceb8
DH
6722003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de>
673
674 * continuations.c, continuations.h, eval.c, eval.h, extensions.c,
675 gsubr.c, guile.c, init.c, read.c, root.c, root.h, stackchk.h,
676 throw.c: Removed uses of DEBUG_EXTENSIONS and DYNAMIC_LINKING to
677 fix compile errors with --disable-deprecated.
678
19a7a089
RB
6792003-04-17 Rob Browning <rlb@defaultvalue.org>
680
681 * numbers.c (scm_integer_expt): fix case where we were declaring
682 vars in the middle of a statement block. Thanks to Thamer
683 Al-Harbash.
684
47cd67db
MD
6852003-04-17 Mikael Djurfeldt <djurfeldt@nada.kth.se>
686
0fd7dcd3
MD
687 * goops.c (TEST_CHANGE_CLASS): Update variable class after class
688 change.
689
47cd67db
MD
690 * eq.c (scm_eqv_p): Turned into a primitive generic.
691
3b8b889c
RB
6922003-04-16 Rob Browning <rlb@defaultvalue.org>
693
312006bb
RB
694 * gc_os_dep.c: Added patch for UnixWare and OpenUNIX support.
695 Thanks to Boyd Gerber.
696 Added check for __arm__ in addition to arm for LINUX and copied
697 __s390__ defines from upstream libgc. Thanks to James Treacy for
698 reporting the problems.
c7ef2ea1 699
3b8b889c
RB
700 * numbers.c (PTRDIFF_MIN): use SCM_CHAR_BIT.
701
702 * socket.c: use SCM_CHAR_BIT.
703
704 * random.c (scm_c_random_bignum): use SCM_CHAR_BIT.
705
706 * num2integral.i.c (NUM2INTEGRAL): use SCM_CHAR_BIT.
707
43261b39
MD
7082003-04-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
709
710 * feature.c (scm_init_feature): Always add threads feature.
711
58241edc
MD
7122003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
713
714 * goops.c (scm_sys_fast_slot_ref): Use SCM_SLOT instead of
715 scm_at_assert_bound_ref. (We don't want the unbound check. See
716 oop/goops/active-slot.scm.)
717
94e91275
RB
7182003-04-14 Rob Browning <rlb@defaultvalue.org>
719
720 * tags.h: scm_t_intptr should have been intptr_t.
721
3071ea27
RB
7222003-04-13 Rob Browning <rlb@defaultvalue.org>
723
724 * __scm.h (SCM_FLUSH_REGISTER_WINDOWS): don't just rely on "sparc"
725 test. Instead use
726 #if defined (sparc) || defined (__sparc__) || defined (__sparc)
727 as gc_os_dep.c suggests is appropriate.
728
729 * goops.c (prep_hashsets): make static to match prototype.
730 (scm_sym_args): SCM_SYMBOL -> SCM_GLOBAL_SYMBOL. Thanks to Albert
731 Chin.
732
733 * c-tokenize.lex: remove trailing comma from enum. Thanks to
734 Albert Chin.
735
736 * gc_os_dep.c: add NetBSD powerpc config info. Thanks to Thomas
737 Klausner.
738
21ab2aeb
MD
7392003-04-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
740
741 * goops.c (scm_sys_prep_layout_x): Instance allocation is now
742 indicated through extra fields in getters-n-setters.
743 (scm_add_slot): Adapted to new format of getters_n_setters slot.
744 (Thanks to Andy Wingo.)
745
dff96e95
HWN
7462003-02-25 Han-Wen Nienhuys <hanwen@cs.uu.nl>
747
748 * gc-segment.c: add comment
749
07921c76
RB
7502003-04-07 Rob Browning <rlb@defaultvalue.org>
751
b5331f10
RB
752 * debug.h: change "id" arg name to "info_id" to avoid objective-c
753 clash.
754
07921c76
RB
755 * num2integral.i.c (NUM2INTEGRAL): fix bug pointed out by Mikael
756 and add regression test to standalone/.
757
7582003-04-06 Rob Browning <rlb@defaultvalue.org>
759
760 * strings.c (scm_mem2string): use memcpy rather than by-hand loop.
761 Thanks to Dale P. Smith.
762
763 * random.c: #include gmp.h.
764 (scm_c_random_bignum): normalize result on return.
765
766 * init.c: #include gmp.h.
767
768 * numbers.h: remove the gmp.h #include (not needed now).
769
770 * posix.h: change occurences of "id" to something else so we don't
771 cause trouble when included via objective-c (can't hurt, might
772 help). Still have usage in debug.h, though.
773
938f6b7c
MD
7742003-04-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
775
372691d8
MD
776 * random.c (scm_c_random_bignum): Don't generate a random number
777 equal to m (the second argument of scm_c_random_bignum); only
778 generate numbers in the range 0 <= r < m.
c5f268f8
MD
779 (scm_c_default_rstate): Use SCM_VARIABLE_REF to access
780 scm_var_random_state.
372691d8 781
938f6b7c
MD
782 * num2integral.i.c (INTEGRAL2BIG): Put negation of n inside then
783 clause.
784
6cdb8c3f
RB
7852003-04-05 Rob Browning <rlb@defaultvalue.org>
786
938f6b7c 787 * modules.c (scm_module_import_interface): move declaration of
6cdb8c3f
RB
788 uses before any code.
789
15635be5
MD
7902003-04-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
791
1ecfd013
MD
792 * Makefile.am (scmconfig.h): Look for config.h in top_builddir,
793 not top_srcdir.
794
15635be5
MD
795 * hashtab.c (rehash_after_gc): Clear to_rehash list before
796 processing it in order to avoid an infinite loop.
797
798 * print.c (scm_prin1): Remember old state of pstate->writingp.
799
73be1d9e
MV
8002003-04-05 Marius Vollmer <mvo@zagadka.de>
801
802 * Changed license terms to the plain LGPL thru-out.
803
ad815c06
RB
8042003-04-04 Rob Browning <rlb@defaultvalue.org>
805
806 * socket.c (FLIPCPY_NET_HOST_128): new macro.
807 (ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p):
808 rewrite to handle GMP bignums.
809
810
811 * random.c (scm_c_random_bignum): rewrite to handle GMP bignums.
812
813 * ports.c (scm_getc): minor tweak.
814
815 * numbers.h: remove SCM_BIGDIG conditionals, reorganize, and
816 rewrite to handle GMP bignums.
817
818 * numbers.c: rewrite *many* functions to handle GMP bignums.
819
820 * num2integral.i.c (NUM2INTEGRAL, INTEGRAL2NUM, INTEGRAL2BIG):
821 handle GMP bignums.
822
823 * num2float.i.c (NUM2FLOAT): handle GMP bignums.
824
825 * init.c (check_config): remove SCM_BIGDIG conditionals.
826 (scm_init_guile_1): test to make sure mpz_t fits in a double_cell.
827
828 * gc-card.c ("sweep_card"): handle new mpz_t bignums.
829
830 * eval.c: remove SCM_BIGDIG conditionals.
831
832 * eq.c (s_scm_eqv_p): scm_i_bigcomp -> scm_i_bigcmp.
833
6cdb8c3f
RB
8342003-03-31 Rob Browning <rlb@defaultvalue.org>
835
836 * Makefile.am (scmconfig.h): change srcdir to builddir. (Thanks
837 to Kevin Ryde.)
838
8392003-03-27 Rob Browning <rlb@defaultvalue.org>
840
841 * threads.h: fix various preprocessor usages of new public
842 symbols to expect 0 or 1 values rather than 1 or undefined.
843 i.e. change #ifdef to #if, etc.
844
845 * threads.c: fix various preprocessor usages of new public
846 symbols to expect 0 or 1 values rather than 1 or undefined.
847 i.e. change #ifdef to #if, etc.
848
849 * tags.h: fix various preprocessor usages of new public
850 symbols to expect 0 or 1 values rather than 1 or undefined.
851 i.e. change #ifdef to #if, etc.
852
853 * stacks.c: fix various preprocessor usages of new public
854 symbols to expect 0 or 1 values rather than 1 or undefined.
855 i.e. change #ifdef to #if, etc.
856
857 * stackchk.h: fix various preprocessor usages of new public
858 symbols to expect 0 or 1 values rather than 1 or undefined.
859 i.e. change #ifdef to #if, etc.
860
861 * stackchk.c: fix various preprocessor usages of new public
862 symbols to expect 0 or 1 values rather than 1 or undefined.
863 i.e. change #ifdef to #if, etc.
864
865 * sort.c: fix various preprocessor usages of new public
866 symbols to expect 0 or 1 values rather than 1 or undefined.
867 i.e. change #ifdef to #if, etc.
868
869 * read.c: fix various preprocessor usages of new public
870 symbols to expect 0 or 1 values rather than 1 or undefined.
871 i.e. change #ifdef to #if, etc.
872
873 * random.c: fix various preprocessor usages of new public
874 symbols to expect 0 or 1 values rather than 1 or undefined.
875 i.e. change #ifdef to #if, etc.
876
877 * print.c: fix various preprocessor usages of new public
878 symbols to expect 0 or 1 values rather than 1 or undefined.
879 i.e. change #ifdef to #if, etc.
880
881 * objects.c: fix various preprocessor usages of new public
882 symbols to expect 0 or 1 values rather than 1 or undefined.
883 i.e. change #ifdef to #if, etc.
884
885 * numbers.h: fix various preprocessor usages of new public
886 symbols to expect 0 or 1 values rather than 1 or undefined.
887 i.e. change #ifdef to #if, etc.
888
889 * null-threads.c: fix various preprocessor usages of new public
890 symbols to expect 0 or 1 values rather than 1 or undefined.
891 i.e. change #ifdef to #if, etc.
892
893 * lang.c: fix various preprocessor usages of new public
894 symbols to expect 0 or 1 values rather than 1 or undefined.
895 i.e. change #ifdef to #if, etc.
896
897 * lang.h: fix various preprocessor usages of new public
898 symbols to expect 0 or 1 values rather than 1 or undefined.
899 i.e. change #ifdef to #if, etc.
900
901 * iselect.h: fix various preprocessor usages of new public
902 symbols to expect 0 or 1 values rather than 1 or undefined.
903 i.e. change #ifdef to #if, etc.
904
905 * init.c: fix various preprocessor usages of new public
906 symbols to expect 0 or 1 values rather than 1 or undefined.
907 i.e. change #ifdef to #if, etc.
908
909 * gh_data.c: fix various preprocessor usages of new public
910 symbols to expect 0 or 1 values rather than 1 or undefined.
911 i.e. change #ifdef to #if, etc.
912
913 * gh.h: fix various preprocessor usages of new public
914 symbols to expect 0 or 1 values rather than 1 or undefined.
915 i.e. change #ifdef to #if, etc.
916
917 * gen-scmconfig.c: change most new public symbols to be defined to
918 0 or 1 rather than being either 1 or undefined.
919
920 * gc_os_dep.c: fix various preprocessor usages of new public
921 symbols to expect 0 or 1 values rather than 1 or undefined.
922 i.e. change #ifdef to #if, etc.
923 (STACK_GROWS_DOWN): define to 0 or 1 rather than 1 or undef.
924
925 * gc.h: fix various preprocessor usages of new public
926 symbols to expect 0 or 1 values rather than 1 or undefined.
927 i.e. change #ifdef to #if, etc.
928
929 * gc-card.c: fix various preprocessor usages of new public
930 symbols to expect 0 or 1 values rather than 1 or undefined.
931 i.e. change #ifdef to #if, etc.
932
933 * gc-mark.c: fix various preprocessor usages of new public
934 symbols to expect 0 or 1 values rather than 1 or undefined.
935 i.e. change #ifdef to #if, etc.
936
937 * feature.c: fix various preprocessor usages of new public
938 symbols to expect 0 or 1 values rather than 1 or undefined.
939 i.e. change #ifdef to #if, etc.
940
941 * evalext.c: fix various preprocessor usages of new public
942 symbols to expect 0 or 1 values rather than 1 or undefined.
943 i.e. change #ifdef to #if, etc.
944
945 * eval.h: fix various preprocessor usages of new public
946 symbols to expect 0 or 1 values rather than 1 or undefined.
947 i.e. change #ifdef to #if, etc.
948
949 * eval.c: fix various preprocessor usages of new public
950 symbols to expect 0 or 1 values rather than 1 or undefined.
951 i.e. change #ifdef to #if, etc.
952
953 * eq.c: fix various preprocessor usages of new public
954 symbols to expect 0 or 1 values rather than 1 or undefined.
955 i.e. change #ifdef to #if, etc.
956
957 * coop.c: fix various preprocessor usages of new public
958 symbols to expect 0 or 1 values rather than 1 or undefined.
959 i.e. change #ifdef to #if, etc.
960
961 * coop-threads.c: fix various preprocessor usages of new public
962 symbols to expect 0 or 1 values rather than 1 or undefined.
963 i.e. change #ifdef to #if, etc.
964
965 * coop-pthreads.c: fix various preprocessor usages of new public
966 symbols to expect 0 or 1 values rather than 1 or undefined.
967 i.e. change #ifdef to #if, etc.
968
969 * coop-defs.h: fix various preprocessor usages of new public
970 symbols to expect 0 or 1 values rather than 1 or undefined.
971 i.e. change #ifdef to #if, etc.
972
973 * convert.i.c: fix various preprocessor usages of new public
974 symbols to expect 0 or 1 values rather than 1 or undefined.
975 i.e. change #ifdef to #if, etc.
976
977 * continuations.c: fix various preprocessor usages of new public
978 symbols to expect 0 or 1 values rather than 1 or undefined.
979 i.e. change #ifdef to #if, etc.
980
981 * _scm.h: fix various preprocessor usages of new public symbols to
982 expect 0 or 1 values rather than 1 or undefined. i.e. change
983 #ifdef to #if, etc.
984
d11d697a
MV
9852003-03-26 Marius Vollmer <marius.vollmer@uni-dortmund.de>
986
9686f86d
MV
987 * init.c (scm_init_guile_1): Call scm_i_init_deprecated.
988
989 * deprecated.c, deprecated.h: New files, to collect deprecated
990 things in one place.
991 * Makefile.am: Added them in all the right places.
992
d11d697a
MV
993 * Makefile.am (EXTRA_DIST): Added "scmconfig.h.top".
994 (scmconfig.h): Get "scmconfig.h.top" from $(srcdir) so that VPATH
995 builds work.
9686f86d
MV
996 (DOT_X_FILES): Removed "iselect.x".
997 (DOT_DOC_FILES): Removed "iselect.doc".
d11d697a 998
e3c0c3b9
RB
9992003-03-25 Rob Browning <rlb@defaultvalue.org>
1000
1001 * win32-socket.h: #include "libguile/__scm.h". Replace usage of
1002 HAVE_WINSOCK2_H with SCM_HAVE_WINSOCK2_H.
1003
1004 * win32-socket.c: #include <config.h> if HAVE_CONFIG_H.
1005
1006 * vports.c: #include <config.h> if HAVE_CONFIG_H.
1007
1008 * unif.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of
1009 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1010
1011 * threads.h: replace usage of struct timespect with
1012 scm_t_timespec. Replace usage of USE_PTHREAD_THREADS with
1013 SCM_USE_PTHREAD_THREADS. Remove typedef for struct timespec in
1014 favor of scm_t_timespec from scmconfig.h.
1015
1016 * threads.c: move libguile/_scm.h include to the top so we pick up
1017 any critical defines like _GNU_SOURCE early. Replace usage of
1018 struct timespect with scm_t_timespec. Replace usage of
1019 STACK_GROWS_UP with SCM_STACK_GROWS_UP. Replace usage of
1020 USE_PTHREAD_THREADS with SCM_USE_PTHREAD_THREADS.
1021
1022 * threads-plugin.h: replace usage of struct timespect with
1023 scm_t_timespec.
1024
1025 * threads-plugin.c: #include <config.h> if HAVE_CONFIG_H. Replace
1026 usage of struct timespect with scm_t_timespec.
1027
1028 * tags.h: move HAVE_STDINT_H handling to scmconfig.h. Move
1029 HAVE_INTTYPES_H handling to scmconfig.h. #include
1030 "libguile/__scm.h". Rework handling for scm_t_bits,
1031 scm_t_signed_bits, SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX,
1032 SCM_T_SIGNED_BITS_MIN, and SIZEOF_SCM_T_BITS to use scm_t_intptr,
1033 scm_t_uintptr, SCM_SIZEOF_INTPTR_T, and SCM_SIZEOF_UINTPTR_T, and
1034 SCM_SIZEOF_UNSIGNED_LONG. Rename usage of HAVE_ARRAYS to
1035 SCM_HAVE_ARRAYS.
1036
1037 * symbols.c: #include <config.h> if HAVE_CONFIG_H.
1038
1039 * struct.c: #include <config.h> if HAVE_CONFIG_H.
1040
1041 * strports.c: #include <config.h> if HAVE_CONFIG_H.
1042
1043 * strop.c: #include <config.h> if HAVE_CONFIG_H.
1044
1045 * stime.h: move handling of time related headers to scmconfig.h.
1046
1047 * stime.c: #include <config.h> if HAVE_CONFIG_H.
1048
1049 * stacks.c: replace usage of STACK_GROWS_UP with
1050 SCM_STACK_GROWS_UP.
1051
1052 * sort.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1053 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1054
1055 * socket.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1056 of uint32 and HAVE_UINT_32 with scm_t_int32.
1057
1058 * smob.c: #include <config.h> if HAVE_CONFIG_H.
1059
1060 * simpos.c: #include <config.h> if HAVE_CONFIG_H.
1061
1062 * script.c: #include <config.h> if HAVE_CONFIG_H.
1063
1064 * scmsigs.c: #include <config.h> if HAVE_CONFIG_H.
1065
1066 * scmconfig.h.top: new file -- preamble for scmconfig.h.
1067
1068 * rw.c: #include <config.h> if HAVE_CONFIG_H.
1069
1070 * regex-posix.c: #include <config.h> if HAVE_CONFIG_H.
1071
1072 * read.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1073
1074 * rdelim.c: #include <config.h> if HAVE_CONFIG_H.
1075
1076 * random.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1077 of LONG32, LONG64, SIZEOF_LONG, and HAVE_LONG_LONGS with
1078 scm_t_int32, scm_t_int64, and SCM_HAVE_T_INT64. Rename usage of
1079 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1080
1081 * ramap.c: replace usage of HAVE_LONG_LONGS with
1082 "SCM_SIZEOF_LONG_LONG != 0".
1083
1084 * putenv.c: #include <config.h> if HAVE_CONFIG_H. #include
1085 "libguile/scmconfig.h".
1086
1087 * pthread-threads.c: #include <config.h> if HAVE_CONFIG_H.
1088
1089 * print.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1090 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1091
1092 * posix.c: #include <config.h> if HAVE_CONFIG_H.
1093
1094 * ports.c: #include <config.h> if HAVE_CONFIG_H.
1095
1096 * objects.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1097
1098 * numbers.h: replace usage of HAVE_FLOATINGPOINT_H with
1099 SCM_HAVE_FLOATINGPOINT_H. Replace usage of HAVE_IEEEFP_H with
1100 SCM_HAVE_IEEEFP_H. Replace usage of HAVE_NAN_H with
1101 SCM_HAVE_NAN_H. Replace usage of STDC_HEADERS with
1102 SCM_HAVE_STDC_HEADERS. Replace usage of ptrdiff_t with
1103 scm_t_ptrdiff. Replace usage of HAVE_LONG_LONGS with
1104 "SCM_SIZEOF_LONG_LONG != 0".
1105
1106 * numbers.c: #include <config.h> if HAVE_CONFIG_H. Replace usage
1107 of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0". Replace
1108 usage of ptrdiff_t with scm_t_ptrdiff. Replace usage of
1109 SIZEOF_PTRDIFF_T with SCM_SIZEOF_SCM_T_PTRDIFF.
1110
1111 * num2integral.i.c: #include <config.h> if HAVE_CONFIG_H.
1112
1113 * null-threads.h: replace usage of struct timespect with
1114 scm_t_timespec.
1115
1116 * net_db.c: #include <config.h> if HAVE_CONFIG_H.
1117
1118 * mkstemp.c: #include <config.h> if HAVE_CONFIG_H. #include
1119 "libguile/__scm.h". Remove definition of gcc_uint64_t in favor of
1120 scm_t_uint64 and rename usages.
1121
1122 * mallocs.c: #include <config.h> if HAVE_CONFIG_H.
1123
1124 * load.c: #include <config.h> if HAVE_CONFIG_H.
1125
1126 * iselect.h: move handling of time related headers to scmconfig.h.
1127 Rename usage of HAVE_SYS_SELECT_H to SCM_HAVE_SYS_SELECT_H.
1128 Rename usage of HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Rename
1129 usage of USE_COOP_THREADS to SCM_USE_COOP_THREADS.
1130
1131 * iselect.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1132 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
1133 USE_NULL_THREADS to SCM_USE_NULL_THREADS.
1134
1135 * ioext.c: #include <config.h> if HAVE_CONFIG_H.
1136
1137 * inline.h: #include "libguile/__scm.h" at the top. Change code
1138 to use SCM_C_INLINE and SCM_INLINE_C_INCLUDINT_INLINE_H to decide
1139 what to do instead of creating a new public #define. Rename usage
1140 of USE_COOP_THREADS to SCM_USE_COOP_THREADS. Rename usage of
1141 USE_NULL_THREADS to SCM_USE_NULL_THREADS. Rename usage of
1142 USE_COPT_THREADS to SCM_USE_COPT_THREADS.
1143
1144 * inline.c: rearrange handling -- now we just #define
1145 SCM_INLINE_C_INCLUDING_INLINE_H to 1 and #include
1146 "libguile/inline.h". scmconfig.h will define SCM_C_INLINE as
1147 appropriate, and we use that in inline.h along with the above
1148 define to determine how to respond.
1149
1150 * init.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1151 HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1152
1153 * guile.c: #include <config.h> if HAVE_CONFIG_H.
1154
1155 * gh_data.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1156 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1157
1158 * gh.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1159
1160 * gen-scmconfig.h.in: new file -- see gen-scmconfig.c for details.
1161
1162 * gen-scmconfig.c: new file -- see comments in file for details.
1163
1164 * gdbinit.c: #include <config.h> if HAVE_CONFIG_H.
1165
1166 * gc_os_dep.c: #include <config.h> if HAVE_CONFIG_H. Replace
1167 usage of STACK_GROWS_UP with SCM_STACK_GROWS_UP.
1168
1169 * gc.h: replace usage of SIZEOF_LONG with
1170 SCM_SIZEOF_UNSIGNED_LONG. Replace usage of USE_PTHREAD_THREADS
1171 with SCM_USE_PTHREAD_THREADS. Remove SCM_SIZEOF_LONG definition
1172 since we handle that in scmconfig.h now.
1173
1174 * gc.c: #include <config.h> if HAVE_CONFIG_H.
1175
1176 * gc-mark.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1177 of HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of
1178 HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1179
1180 * gc-malloc.c: #include <config.h> if HAVE_CONFIG_H.
1181
1182 * gc-card.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1183 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1184
1185 * fports.c: #include <config.h> if HAVE_CONFIG_H.
1186
1187 * filesys.c: #include <config.h> if HAVE_CONFIG_H.
1188
1189 * feature.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1190 of USE_NULL_THREADS to SCM_USE_NULL_THREADS.
1191
1192 * extensions.c: #include <config.h> if HAVE_CONFIG_H.
1193
1194 * evalext.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1195 Replace usage of HAVE_LONG_LONGS with "SCM_SIZEOF_LONG_LONG != 0".
1196
1197 * eval.c: #include <config.h> if HAVE_CONFIG_H. #include
1198 "libguile/__scm.h" rather than scmconfig.h. Rename usage of
1199 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
1200 with "SCM_SIZEOF_LONG_LONG != 0".
1201
1202 * error.c: #include <config.h> if HAVE_CONFIG_H.
1203
1204 * eq.c: #include <config.h> if HAVE_CONFIG_H. Rename usage of
1205 HAVE_ARRAYS to SCM_HAVE_ARRAYS. Replace usage of HAVE_LONG_LONGS
1206 with "SCM_SIZEOF_LONG_LONG != 0".
1207
1208 * deprecation.c: #include <config.h> if HAVE_CONFIG_H.
1209
1210 * coop.c: replace usage of struct timespect with scm_t_timespec.
1211 #include <config.h> if HAVE_CONFIG_H.
1212
1213 * coop-threads.c: #include "libguile/_scm.h" early. Replace
1214 usage of struct timespect with scm_t_timespec. Replace usage of
1215 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
1216
1217 * coop-pthreads.c: #include "libguile/_scm.h" early. Replace
1218 usage of struct timespect with scm_t_timespec. Replace usage of
1219 STACK_GROWS_UP with SCM_STACK_GROWS_UP.
1220
1221 * coop-defs.h: move handling of time related headers to
1222 scmconfig.h. Add #include "libguile/__scm.h". Rename usage of
1223 HAVE_WINSOCK2_H to SCM_HAVE_WINSOCK2_H. Replace usage of struct
1224 timespect with scm_t_timespec.
1225
1226 * convert.i.c: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1227
1228 * convert.h: rename usage of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1229
1230 * convert.c: #include <config.h> if HAVE_CONFIG_H. Rename usage
1231 of HAVE_ARRAYS to SCM_HAVE_ARRAYS.
1232
1233 * continuations.c: move libguile/_scm.h include to the top so we
1234 pick up any critical defines like _GNU_SOURCE early.
1235
1236 * backtrace.c: #include <config.h> if HAVE_CONFIG_H.
1237
1238 * async.c: #include <config.h> if HAVE_CONFIG_H.
1239
1240 * alloca.c: #include <config.h> if HAVE_CONFIG_H.
1241
1242 * _scm.h: #include <config.h> if HAVE_CONFIG_H.
1243 Rename usage of USE_PTHREAD_THREADS to SCM_USE_PTHREAD_THREADS.
1244
1245 * __scm.h: move libguile/scmconfig.h include up to the top, so
1246 we're sure to pick up any critical defines like _GNU_SOURCE early.
1247 #include <limits.h> removed in favor of scmconfig.h inclusion when
1248 appropriate. STDC_HEADERS based inclusion of stdlib.h,
1249 sys/types.h, stddef.h, and sys/stdtypes.h removed in favor of
1250 scmconfig.h inclusion when appropriate. Various Win32 related
1251 definitions removed in favor of scmconfig.h inclusion when
1252 appropriate.
1253 (HAVE_UINTPTR_T): definition removed (see NEWS).
1254 (SIZEOF_PTRDIFF_T): definition removed (see NEWS).
1255 (HAVE_LONG_LONGS): definition removed (see NEWS).
1256 (HAVE_LONG_LONG): definition removed (see NEWS).
1257 (HAVE_PTRDIFF_T): definition removed (see NEWS).
1258
1259 * Makefile.am: scmconfig.h is now generated by building and
1260 running gen-scmconfig.h and capturing its output. gen-scmconfig
1261 uses config.h and the configure.in generated gen-scmconfig.h to
1262 decide what to output. See gen-scmconfig.c for details.
1263 (noinst_PROGRAMS): add gen-scmconfig.
1264 (gen_scmconfig_SOURCES): new variable.
1265 (gen-scmconfig.$(OBJEXT)): new target - be careful to handle
1266 cross-compiling right.
1267 (scmconfig.h): build scmconfig.h from gen-scmconfig's output.
1268 (BUILT_SOURCES): add scmconfig.h.
1269
25e0bf97
MV
12702003-03-19 Marius Vollmer <mvo@zagadka.de>
1271
1272 * gc_os_dep.c: Added defines for sparc-unknown-netbsdelf1.5 from
1273 Adrian Bunk. Thanks!
1274
74b6d6e4
MD
12752003-03-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1276
1277 * goops.c (make_class_from_template): New fourth arg:
1278 applicablep.
1279 (scm_class_extended_generic_with_setter, scm_class_self): Fixed
1280 cpls.
1281
1282 * smob.c (scm_set_smob_apply): Call scm_i_inherit_applicable.
1283
1284 * goops.c, objects.c, objects.h (scm_make_extended_class): New
1285 second arg: applicablep.
1286 (scm_i_inherit_applicable): New function.
1287
1288 * goops.c, goops.h (scm_class_applicable,
1289 scm_class_extended_accessor): New classes.
1290
5c9e7dad
DH
12912003-03-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
1292
1293 * procs.c (scm_procedure_documentation): Removed redundant
1294 SCM_NIMP test and replaced other calls to SCM_IMP by more explicit
1295 predicates.
1296
f8af5c6d
MD
12972003-03-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1298
c614a00b
MD
1299 * list.c, list.h (scm_filter, scm_filter_x): New functions.
1300
109c2c9f
MD
1301 * modules.c (scm_module_import_interface): New function.
1302
f8af5c6d
MD
1303 * goops.c, goops.h (scm_class_accessor_method): Renamed from
1304 scm_class_accessor.
1305 (scm_class_accessor): New class.
1306
a48d60b1
MD
13072003-03-06 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1308
1309 * goops.c (scm_primitive_generic_generic): Enable primitive
1310 generic if not enabled.
1311 (scm_sys_goops_loaded): Setup unextended primitive generics.
1312
1313 * goops.c, goops.h (scm_c_extend_primitive_generic): New function.
1314
1315 * snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
1316 snarf macros.
1317
1318 * numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
1319 testing example. All uses of SCM_GPROC should be converted.)
1320
1321 * procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
1322 scm_assoc.
1323
1324 * eq.c (scm_equal_p): Turned into a primitive generic.
1325
84edc049
RB
13262003-02-27 Rob Browning <rlb@defaultvalue.org>
1327
1328 * Makefile.am (scmconfig.h): new target -- generate file from
1329 ../config.h.
1330 (modinclude_HEADERS): remove version.h.
1331 (nodist_modinclude_HEADERS): add version.h.
1332
ea5c9285
MD
13332003-02-24 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1334
b4a1358c
MD
1335 This fixes a serious GC bug, introduced during the latest
1336 reorganization of the GC, which disabled freeing of structs and
1337 GOOPS objects:
1338
1339 * struct.c (scm_struct_prehistory): Init scm_i_structs_to_free to
1340 SCM_EOL.
53af8255
MD
1341 (scm_struct_prehistory): Move scm_free_structs to
1342 scm_before_mark_c_hook.
ea5c9285 1343
b4a1358c
MD
1344 * gc-card.c (sweep_card): Check that we haven't swept structs on
1345 this card before. That can happen if scm_i_sweep_all_segments has
1346 been called from some other place than scm_igc.
1347
c35738c1
MD
13482003-02-19 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1349
231a4ea8
MD
1350 * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31
1351 (since hash tables now adapt their size).
1352
1353 * modules.c (scm_modules_prehistory): Changed from 2001 to 1533
1354 (current number of prehistory bindings; hashtable code will select
1355 a prime which is greater than this value).
1356
1357 * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139
1358 (current number of initial symbols).
1359
1360 * properties.c (scm_init_properties): Don't specify size of
1361 scm_properties_whash.
1362
1363 * objprop.c (scm_init_objprop): Don't specify size of
1364 scm_object_whash.
1365
1366 * keywords.c (scm_init_keywords): Don't specify a hash table size.
1367
c35738c1
MD
1368 * hooks.c (scm_c_hook_add): Fixed bug in append mode.
1369
1370 The following changes introduce the use of resizable hash tables
1371 throughout Guile. It also renames the old *-hash-table* functions
1372 to *-alist-vector* and places them, together with the rest of the
1373 weak vector support, in the module (ice-9 weak-vector). We should
1374 probably introduce a new, better, API for weak references, for
1375 example "weak pairs" a la MIT-Scheme. (In Chez scheme, they even
1376 look like and are used like ordinary pairs.)
1377
1378 * environments.c (obarray_enter, obarray_retrieve, obarray_remove,
1379 leaf_environment_fold, obarray_remove_all): Use hashtable
1380 accessors.
1381
1382 * gc.c (scm_init_storage): Moved hook initialization to
1383 scm_storage_prehistory.
1384 (scm_storage_prehistory): New function.
1385 (scm_igc): Added commentary about placement of
1386 scm_after_sweep_c_hook.
1387
1388 * gc-mark.c (scm_mark_all): Use hashtable accessors.
1389 (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and
1390 SCM_WVECT_WEAK_VALUE_P.
1391
1392 * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New
1393 functions.
1394 (scm_vector_to_hash_table, scm_c_make_resizing_hash_table):
1395 Removed.
1396 (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table,
1397 scm_make_doubly_weak_hash_table): Moved here from weaks.c.
1398
1399 * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added
1400 calls to scm_storage_prehistory and scm_hashtab_prehistory.
1401
1402 * modules.c (module-reverse-lookup): Use hashtable accessors.
1403
1404 * symbols.c, symbols.h (scm_i_hash_symbol): New function.
1405
1406 * weaks.c, weaks.h (scm_make_weak_key_alist_vector,
1407 scm_make_weak_value_alist_vector,
1408 scm_make_doubly_weak_alist_vector): New functions.
1409
1410 * weaks.c (scm_init_weaks_builtins): New function.
1411
1412 * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE,
1413 SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P,
1414 SCM_WVECT_NOSCAN_P): New macros.
1415
1416 * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P
1417 and SCM_WVECT_WEAK_VALUE_P.
1418
1419 * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from
1420 allocate_weak_vector and exported.
1421
0a4c1355
MD
14222003-02-13 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1423
1424 * hashtab.c: Undid thread safety. (We decided that it's better to
1425 let the user explicitly protect the tables (or not) according what
1426 is suitable for the application.)
1427
87ca11ff
MD
14282003-02-12 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1429
1430 * hashtab.c (scm_hash_fn_remove_x, scm_internal_hash_fold): Made
1431 thread safe and handle resizing tables.
1432 (scm_ihashx, scm_sloppy_assx, scm_delx_x): Removed
1433 SCM_DEFER/ALLOW_INTS.
1434
f59a096e
MD
14352003-02-11 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1436
1437 * hashtab.c (scm_vector_to_hash_table,
1438 scm_c_make_resizing_hash_table, scm_make_hash_table): New
1439 functions.
1440 (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x): Made thread
1441 safe and handle resizing tables.
1442
1443 * weaks.c (scm_make_weak_key_hash_table,
1444 scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table):
1445 Size argument made optional. Return resizable table if not
1446 specified.
1447
4b612c5b
MD
14482003-02-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1449
1450 * eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
1451 Fixed formals tests for closures. (Thanks to Kevin Ryde.)
1452
b3d7f6df
MD
14532003-02-05 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1454
1455 * debug.c (scm_procedure_source): Handle all objects for which
1456 procedure? is #t. (Thanks to Bill Schottstaedt.)
1457
756414cf
MD
14582003-01-23 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1459
361d631f
MD
1460 * futures.c (mark_futures): Don't need to mark data of recycled
1461 futures.
1462 (scan_futures, cleanup_undead): Be smarter about marking
1463 futures---avoid unnecessary passes through future lists.
1464
756414cf
MD
1465 * futures.h, futures.c: New files; Introduced recycling of
1466 futures. For fine-grained threading this lifts performance to
1467 another level. We can now use parallelization in inner loops of
1468 Guile programs without impossible overhead.
1469
1470 * threads.h, threads.c: Moved futures to their own file.
1471
1472 * Makefile.am (libguile_la_SOURCES): Added futures.c.
1473 (DOT_X_FILES): Added futures.x.
1474 (DOT_DOC_FILES): Added futures.doc.
1475 (modinclude_HEADERS): Added futures.h.
1476
1477 * threads.c, threads.h (scm_i_create_thread): Renamed from
1478 create_thread and made global.
1479
1480 * futures.c (scm_make_future): New procedure.
1481
1482 * eval.c: #include "libguile/futures.h".
1483
1484 * init.c: #include "futures.h"
1485 (scm_init_guile_1): Call scm_init_futures.
1486
1487 * stime.c (SCM_TIME_UNITS_PER_SECOND): Renamed from CLKTCK.
1488
1489 * stime.h (SCM_TIME_UNITS_PER_SECOND): Definition moved here.
1490
1491 * eval.c, eval.h (scm_trampoline_0, scm_i_call_closure_0): New
1492 functions.
1493
1494 * eval.c (scm_trampoline_1): Fixed arguments test for closures.
1495
b4debead
MD
14962003-01-22 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1497
1498 * threads.c (create_thread): Don't unwind dynwind chain of parent
1499 thread before creation. Just start the new thread with an empty
1500 dynwind chain.
1501
93f26b7b
MD
15022003-01-20 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1503
1504 * evalext.c, evalext.h (scm_self_evaluating_p): New function.
1505
38d8927c
MD
15062003-01-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1507
41c96c32
MD
1508 * threads.c (scm_timed_wait_condition_variable): Support timed
1509 waiting also for simple condition variables.
1510
38d8927c
MD
1511 * goops.c (TEST_CHANGE_CLASS): Use scm_change_object_class instead
1512 of calling the procedure change-object-class.
1513
9cf5d9b7
MD
15142003-01-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1515
1516 * ramap.c (scm_ramapc): Typo in error message.
1517
bbf8d523
MD
15182003-01-08 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1519
b46fae00
MD
1520 * goops.c (scm_sys_prep_layout_x): Bugfix: Only create layout for
1521 slots with instance allocation.
1522
bbf8d523
MD
1523 * goops.c, goops.h (scm_class_extended_generic_with_setter): New
1524 class.
1525 (scm_compute_applicable_methods): Use scm_generic_function_methods.
1526
1527 * goops.c (scm_generic_function_methods): Support extended
1528 generic functions.
1529
ebf9b47c
MD
15302002-12-29 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1531
1532 * eval.c (unmemocopy): Bugfix: scm_sym_delay --> scm_sym_future.
2e37d6a2 1533 Thanks to Neil for pointing this out!
ebf9b47c 1534
14a9ba3f
NJ
15352002-12-29 Neil Jerram <neil@ossau.uklinux.net>
1536
1537 * lang.h: Remove declarations matching definitions removed from
1538 lang.c (just below).
1539
c6a040a8
NJ
15402002-12-28 Neil Jerram <neil@ossau.uklinux.net>
1541
6054d805
NJ
1542 * lang.c (scm_nil_cons, scm_nil_car, scm_nil_cdr, scm_null,
1543 scm_m_while, scm_nil_eq): Remove definitions that were superfluous
1544 and already commented out.
1545
c6a040a8
NJ
1546 * read.h (scm_lreadparen), read.c (scm_lreadr, scm_read_token,
1547 scm_lreadparen): Support reading vectors with Elisp syntax if
1548 SCM_ELISP_READ_EXTENSIONS is defined. (SCM_ELISP_READ_EXTENSIONS
1549 is not currently defined, and there isn't even a configure switch
1550 to enable it yet.)
1551
3742c12f
MV
15522002-12-26 Marius Vollmer <mvo@zagadka.ping.de>
1553
1554 * Makefile.am (c-tokenize.o): Refer to source via $< so that vpath
1555 builds work.
1556 (EXTRA_DIST): Added version.h.in.
1557
fb50ef08
MD
15582002-12-21 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1559
1560 This change makes it possible for one thread to do lazy sweeping
1561 while other threads are running. Now only the mark phase need to
1562 have all threads asleep. We should look further into this issue.
1563 Presently, I've put the locking of scm_i_sweep_mutex at
1564 "conservative" places due to my current lack of knowledge about
1565 the garbage collector. Please feel free to restrict these regions
1566 further to allow for maximal parallelism!
1567
1568 * gc.c, gc.h (scm_i_sweep_mutex): New mutex.
1569
1570 * gc.c (scm_gc_for_newcell), gc-malloc.c (scm_realloc,
1571 scm_gc_register_collectable_memory): Substitute locking of
1572 scm_i_sweep_mutex for calls to scm_i_thread_put_to_sleep.
1573 (scm_igc): Lock sweep mutex here instead of in callers; Calls to
1574 scm_i_thread_put_to_sleep/scm_i_thread_wake_up used to demarkate
1575 the single-thread section (which now only contains the mark
1576 phase).
1577 (scm_gc): Don't lock sweeo mutex here since scm_igc locks it;
1578 Removed SCM_DEFER/ALLOW_INTS. Simply call scm_igc directly.
1579
1580 * threads.c (gc_section_mutex): Removed.
1581
9ed24633
MD
15822002-12-19 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1583
0d48aca5
MD
1584 * threads.c (create_thread): Clear parent field in root state in
1585 order not to unnecessarily remember dead threads.
1586
9ed24633
MD
1587 * eval.c (call_subr2o_1, call_lsubr2_2): New functions.
1588 (scm_trampoline_1, scm_trampoline_2): Use them.
1589
29717c89
MD
15902002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1591
1592 Partial introduction of real plugin interface.
1593
1594 * Makefile.am (modinclude_HEADERS): Added threads-plugin.h.
1595 (EXTRA_DIST): Added threads-plugin.c.
1596
1597 * threads-plugin.h, threads-plugin.c: New files.
1598
1599 * threads.h: #include "libguile/threads-plugin.h".
1600
1601 * threads.c: #include "libguile/threads-plugin.c".
1602
1603 * pthread-threads.c: Temporarily remove debugging functions.
1604
1605 * threads.c, threads.h (scm_yield): Added back.
1606
e29e0b09
MD
16072002-12-18 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1608
1609 * threads.c (really_launch): Detach before unlocking
1610 thread_admin_mutex in order not to risk being joined.
1611 (scm_i_thread_put_to_sleep, scm_i_thread_wake_up): Keep
1612 thread_admin_mutex locked during GC.
1613
1614 * pthread-threads.c, pthread-threads.h: Improvements to debugging
1615 functions.
1616
0b6843b1 16172002-12-16 Mikael Djurfeldt <mdj@kvast.blakulla.net>
93cd4dcd 1618
6da2dfc4
MD
1619 * pthread-threads.c, pthread-threads.h (SCM_DEBUG_THREADS): Added
1620 support for debugging mutex operations.
1621
1b92fb6b
MD
1622 * threads.c (scm_thread): Removed filed joining_threads.
1623 (thread_print): Print thread number as well as address of thread
1624 structure.
0b6843b1
MD
1625 (scm_join_thread): Bugfix.
1626 (scm_lock_mutex, scm_try_mutex, scm_unlock_mutex,
1627 scm_timed_wait_condition_variable, scm_signal_condition_variable,
1628 scm_broadcast_condition_variable): Use the low-level API.
1629 (scm_all_threads): Return copy of thread list (to prevent
1630 unintended destruction).
1631 (scm_threads_prehistory): Initialize heap_mutex of fake thread.
1b92fb6b 1632
93cd4dcd
MD
1633 * pthread-threads.c, pthread-threads.h, threads.c: Fixes to
1634 pthread "native" recursive mutex support.
1635
2ff4f181
MD
16362002-12-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1637
28d52ebb
MD
1638 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): New definitions.
1639 Simply lock a thread C API recursive mutex.
1640 (SCM_NONREC_CRITICAL_SECTION_START,
1641 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
1642 SCM_REC_CRITICAL_SECTION_END): Removed.
1643
1644 * eval.c: Replaced SOURCE_SECTION_START / SOURCE_SECTION_END with
1645 direct calls to scm_rec_mutex_lock / unlock around the three calls
1646 to scm_m_expand_body.
1647
1648 * eval.c, eval.h (promise_free): New function.
1649 (scm_force): Rewritten; Now thread-safe; Removed
1650 SCM_DEFER/ALLOW_INTS.
1651
1652 * pthread-threads.h: Added partially implemented plugin interface
1653 for recursive mutexes. These are, for now, only intended to be
1654 used internally within the Guile implementation.
1655
1656 * pthread-threads.c: New file.
1657
1658 * threads.c: Conditionally #include "pthread-threads.c".
1659
1660 * eval.c, eval.h (scm_makprom, scm_force): Rewritten to be
1661 thread-safe;
1662
1663 * snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX,
1664 SCM_GLOBAL_REC_MUTEX): New macros.
1665
1666 * eval.c, threads.c, threads.h, snarf.h: Rewrote critical section
1667 macros---use mutexes instead.
1668
1669 * tags.h (SCM_IM_FUTURE): New tag.
1670
1671 * eval.c (scm_m_future): New primitive macro.
1672 (SCM_CEVAL): Support futures.
1673 (unmemocopy): Support unmemoization of futures.
1674
1675 * print.c (scm_isymnames): Name of future isym.
1676
2ff4f181
MD
1677 * version.c: Unmade some changes to my private copy that got
1678 committed by mistake.
1679
392d2833
MD
16802002-12-11 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1681
e200ddee
MD
1682 * gc-malloc.c, gc.h, init.c: Reverted gc-malloc change of
1683 2002-12-10.
1684
392d2833
MD
1685 * gc.c (scm_igc): Don't call scm_i_thread_invalidate_freelists.
1686
1687 * gc.c (scm_gc_sweep): Call it here instead, which is a more
1688 logical place.
1689
1690 * threads.c (create_thread): Remember root object until the handle
1691 of the new thread is on all_threads list.
1692
1693 * root.c (scm_make_root): Moved copying of fluids until after
1694 creation of root handle so that the fluids are GC protected. Also
1695 removed the critical section.
1696
c4c52ebe
MD
16972002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1698
960c408c
MD
1699 * gc-malloc.c, gc.h (scm_gc_malloc_prehistory): New function.
1700
3cdde9d6 1701 * gc-malloc.c (malloc_mutex): New mutex.
960c408c 1702 (scm_gc_malloc_prehistory): Initialize it.
3cdde9d6
MD
1703 (scm_realloc): Serialize call to realloc
1704 (scm_calloc): Same for calloc.
1705 Thanks to Wolfgang Jaehrling!
1706 (Now we have to make sure all calls to malloc/realloc are made
1707 through scm_malloc.)
1708
960c408c
MD
1709 * init.c (scm_init_guile_1): Call scm_gc_malloc_prehistory.
1710
c4c52ebe
MD
1711 * threads.c (really_launch): Release heap (to prevent deadlock).
1712 (create_thread): Release heap before locking thread admin mutex.
1713
b0dc3d71
MD
17142002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1715
1716 * threads.c (scm_i_thread_invalidate_freelists): New
1717 function.
1718
1719 * gc.c (scm_igc): Call scm_i_thread_invalidate_freelists.
1720
1721 * modules.c (scm_export): Inserted a return statement.
1722
06e80f59
HWN
17232002-12-10 Han-Wen Nienhuys <hanwen@cs.uu.nl>
1724
1725 * modules.c (scm_export): new function
1726
1727 * gc-card.c: add a note about malloc()/free() overhead.
1728
a12611c3
MD
17292002-12-10 Mikael Djurfeldt <mdj@kvast.blakulla.net>
1730
1731 * Makefile.am (c-tokenize.$(OBJEXT)): Don't look for c-tokenize.c
1732 in srcdir.
1733
c7fabadf
MD
17342002-12-10 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1735
1736 These changes remove scm_ints_disabled (which hasn't has any
1737 effect in Guile for quite some time).
1738
1739 * async.c, error.h (scm_ints_disabled): Removed.
1740
1741 * gc.c (scm_gc_for_newcell), init.c (scm_init_guile_1),
1742 root.c (scm_internal_cwdr), gdbint.c (SCM_BEGIN_FOREIGN_BLOCK,
1743 SCM_END_FOREIGN_BLOCK): Don't touch scm_ints_disabled.
1744 (old_ints): Removed.
1745
1746 * __scm.h (SCM_DEFER_INTS, SCM_ALLOW_INTS): Define as a recursive
1747 critical section.
1748 (SCM_REDEFER_INTS, SCM_ALLOW_INTS): Define as SCM_DEFER_INTS and
1749 SCM_ALLOW_INTS.
1750
9bc4701c
MD
17512002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1752
52340b65
MD
1753 * threads.c (scm_mutex_lock, scm_cond_wait, scm_cond_timedwait):
1754 Removed accidental #if 0 around these functions.
1755
9bc4701c
MD
1756 These changes are the start of support for preemptive
1757 multithreading. Marius and I have agreed that I commit this code
1758 into the repository although it isn't thoroughly tested and surely
1759 introduces many bugs. The bugs should only be exposed when using
1760 threads, though. Signalling and error handling for threads is
1761 very likely broken. Work on making the implementation cleaner and
1762 more efficient is needed.
1763
1764 * __scm.h (SCM_ALLOW_INTS_ONLY): Removed.
1765 (SCM_NONREC_CRITICAL_SECTION_START,
1766 SCM_NONREC_CRITICAL_SECTION_END, SCM_REC_CRITICAL_SECTION_START,
1767 SCM_REC_CRITICAL_SECTION_END): New macros.
1768 (SCM_CRITICAL_SECTION_START/END): Defined here.
1769
1770 * eval.c: Insert SOURCE_SECTION_START / SOURCE_SECTION_END around
1771 the three calls to scm_m_expand_body.
1772
1773 * gc.h: #include "libguile/pthread-threads.h";
1774 (SCM_FREELIST_CREATE, SCM_FREELIST_LOC): New macros.
1775
1776 * gc.c (scm_i_freelist, scm_i_freelist2): Defined to be of type
1777 scm_t_key;
1778
1779 * gc.c, gc-freelist.c, inline.h: Use SCM_FREELIST_LOC for freelist
1780 access.
1781
1782 * gc-freelist.c (scm_gc_init_freelist): Create freelist keys.
1783
1784 * gc-freelist.c, threads.c (really_launch): Use
1785 SCM_FREELIST_CREATE.
1786
1787 * gc-malloc.c (scm_realloc, scm_gc_register_collectable_memory):
1788
1789 * gc.c (scm_i_expensive_validation_check, scm_gc,
1790 scm_gc_for_newcell): Put threads to sleep before doing GC-related
1791 heap administration so that those pieces of code are executed
1792 single-threaded. We might consider rewriting these code sections
1793 in terms of a "call_gc_code_singly_threaded" construct instead of
1794 calling the pair of scm_i_thread_put_to_sleep () and
1795 scm_i_thread_wake_up (). Also, we would want to have as many of
1796 these sections eleminated.
1797
1798 * init.c (scm_init_guile_1): Call scm_threads_prehistory.
1799
1800 * inline.h: #include "libguile/threads.h"
1801
1802 * pthread-threads.h: Macros now conform more closely to the
1803 pthreads interface. Some of them now take a second argument.
1804
1805 * threads.c, threads.h: Many changes.
1806
18072002-12-09 Mikael Djurfeldt <djurfeldt@nada.kth.se>
1808
1809 * Makefile.am (version.h): Changed $^ --> $< in rule for
1810 version.h.
1811
b2cbe8d8
RB
18122002-12-08 Rob Browning <rlb@defaultvalue.org>
1813
1814 * version.h.in (SCM_MICRO_VERSION): use @--@ substitution now.
1815 (SCM_MINOR_VERSION): use @--@ substitution now.
1816 (SCM_MICRO_VERSION): use @--@ substitution now.
1817 (scm_effective_version): new function prototype.
1818
1819 * version.c (scm_effective_version): new function, also add
1820 effective-version.
1821
1822 * Makefile.am (schemelibdir): VERSION -> GUILE_EFFECTIVE_VERSION.
1823 (libpath.h): use GUILE_EFFECTIVE_VERSION to compute
1824 SCM_LIBRARY_DIR.
1825 (version.h): generate this here rather than configure.in. This
1826 approach tracks source edits better (i.e. more immediately).
1827 Might be worth considering for other .in files too.
1828
5441c65c
MV
18292002-12-02 Marius Vollmer <mvo@zagadka.ping.de>
1830
1831 Reorganized thread package selection. A thread package now only
1832 implements a small set of pthread like functions and Guile
1833 implements the rest on top of that. Guile's implementation is
1834 what the "coop-pthreads" package has been previously. Support for
1835 "coop" threads has been removed until I get time to add it again.
1836
1837 * Makefile.am (libguile_la_SOURCES): Removed iselect.c.
1838 (noinst_HEADERS): Removed coop-threads.c, coop-threads.h, coop.c,
1839 null-threads.c, coop-pthreads.c.
1840 (modinclude_HEADERS): Removed coop-defs.h, coop-pthreads.h. Added
1841 pthread-threads.h.
1842
1843 * validate.h (SCM_VALIDATE_THREAD): Moved to threads.h.
1844
1845 * threads.h: Do not include "libguile/coop-defs.h". Include
1846 "libguile/pthread-threads.h" for USE_COPT_THREADS. Removed
1847 (previously deprecated) C level thread API prototypes. They are
1848 now in the thread package specific headers, "null-threads.h" and
1849 "pthread-threads.h".
1850 (SCM_VALIDATE_THREAD, SCM_VALIDATE_MUTEX, SCM_VALIDATE_CONDVAR):
1851 New.
1852 (scm_threads_init): Removed.
1853 (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END,
1854 SCM_THREAD_SWITCHING_CODE, scm_i_switch_counter,
1855 SCM_I_THREAD_SWITCH_COUNT): Define here.
1856 (scm_single_thread_p): Removed.
1857 (scm_call_with_new_thread): Take two args directly instead of list
1858 of two args.
1859 (scm_i_thread_data, scm_i_set_thread_data, SCM_THREAD_LOCAL_DATA,
1860 SCM_SET_THREAD_LOCAL_DATA): Define here.
1861
1862 * threads.c: Merged with "coop-pthreads.c".
1863
1864 * null-threads.h: Implement pthread-like API as a set of macros.
1865
1866 * pthread-threads.h: New, implement pthread-like API by deferring
1867 to pthread itself.
1868
1869 * init.c (scm_init_guile_1): Do not call scm_init_iselect, which
1870 has been lost in the reorganization.
1871
504d99c5
MD
18722002-12-01 Mikael Djurfeldt <mdj@linnaeus>
1873
1874 The following change makes it possible to move procedure
1875 application dispatch outside inner loops. The motivation was
1876 clean implementation of efficient replacements of R5RS primitives
1877 in SRFI-1.
1878
1879 The semantics is clear: scm_trampoline_N returns an optimized
1880 version of scm_call_N (or NULL if the procedure isn't applicable
1881 on N args).
1882
1883 Applying the optimization to map and for-each increases efficiency
1884 noticeably. For example, (map abs ls) is 8 times faster than
1885 before.
1886
1887 * eval.h (scm_t_trampoline_1, scm_t_trampoline_2): New types.
1888
1889 * eval.c, eval.h (scm_trampoline_1, scm_trampoline_2): New functions.
1890
1891 * eval.c (call_subr2_2, call_lsubr_2, call_closure_2): New functions;
1892 (map, for-each): Handle also application on two args as a special
1893 case; Use trampolines.
1894
1895 Other changes:
1896
1897 * sort.c (scm_cmp_function): Choose subr2less for scm_tc7_subr_2o;
1898 (subr2oless): Removed.
1899 (scm_restricted_vector_sort_x): Use scm_return_first to keep the
1900 vector GC protected.
1901
1902 * eval.c (check_map_args): Use scm_out_of_range_pos instead of
1903 scm_out_of_range.
1904
63dd3413
DH
19052002-11-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
1906
1907 * evalext.[ch] (scm_m_undefine, undefine): Deprecated.
1908
4ba5f279
MD
19092002-11-17 Mikael Djurfeldt <mdj@linnaeus>
1910
1911 * debug.c (scm_make_iloc): Added missing "return".
1912
56ae231f
MV
19132002-11-17 Marius Vollmer <mvo@zagadka.ping.de>
1914
1915 * strports.c (scm_eval_string_in_module): Validate second arg to
1916 be a module. Thanks to Arno Peters!
1917
80b28865
DH
19182002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1919
1920 * .cvsignore: remove goops.c
1921
c88b1456
DH
19222002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1923
1924 * modules.c (scm_env_top_level, scm_lookup_closure_module,
1925 module_variable, scm_module_lookup_closure,
1926 scm_module_transformer, scm_sym2var, scm_module_reverse_lookup,
1927 scm_system_module_env_p): Don't compare SCM values with C
1928 operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP
1929 over SCM_NFALSEP.
1930
a8a19efc
DH
19312002-11-16 Dirk Herrmann <D.Herrmann@tu-bs.de>
1932
1933 * eval.h (SCM_MAKE_ILOC): New macro.
1934
1935 * debug.c (scm_make_iloc): Use SCM_MAKE_ILOC instead of computing
1936 the iloc bitpattern here.
1937
76734914
MD
19382002-11-14 Mikael Djurfeldt <mdj@linnaeus>
1939
1940 * coop-pthreads.c, coop-pthreads.h: scm_internal_select should be
1941 part of the API, otherwise it's difficult to write Guile
1942 extensions using non-blocking I/O => moved #include
1943 "libguile/iselect.h" from coop-pthreads.c --> coop-pthreads.h.
1944
1945 * coop-pthreads.c (scm_unlock_mutex): Changed s_lock_mutex -->
1946 s_unlock_mutex.
1947
8b5b4a75
MV
19482002-11-10 Marius Vollmer <mvo@zagadka.ping.de>
1949
1950 * __scm.h (USE_THREADS, GUILE_ISELECT): Do not define here. They
1951 are defined in configure.in.
1952
1953 * threads.c: Removed SCM_API from function definitions. SCM_API
1954 is only for declarations.
1955
e5a83084
MD
19562002-11-07 Mikael Djurfeldt <mdj@linnaeus>
1957
9be8bb45
MD
1958 * coop-pthreads.h: Added support for thread specific data to the
1959 generic C API for the coop-pthreads case.
1960
e5a83084
MD
1961 * threads.c, threads.h (scm_cond_init): Undo unintentional API
1962 change.
6c214b62 1963 (scm_cond_broadcast): Added missing function.
e5a83084 1964
7edf178e
MV
19652002-11-04 Marius Vollmer <marius.vollmer@uni-dortmund.de>
1966
1967 * coop.c (coop_next_runnable_thread): Removed, wich should have
1968 happened when GUILE_ISELECT was hard-wired.
1969
7f5b1b77
MV
19702002-11-03 Marius Vollmer <mvo@zagadka.ping.de>
1971
7caa1b07
MV
1972 * Makefile.am (libguile_la_SOURCES): Added threads.c
1973 (DOT_DOC_FILES): Added threads.doc.
1974 (DOT_X_FILES): Added threads.x.
1975 (EXTRA_libguile_la_SOURCES): Removed threads.c.
1976 (noinst_HEADERS): Added coop-pthreads.c.
1977 (modinclude_HEADERS): Added coop-pthreads.h.
1978
1979 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
1980 SCM_DEBUG_DEPRECATED. Removed their use thru-out Guile.
1981
bb11cbf4
MV
1982 * iselect.c: Include "_scm.h" before testing HAVE_UNISTD_H.
1983 Thanks to Bill Schottstaedt!
1984
1d4cbbed
MV
1985 * numbers.c (scm_integer_expt): Make 0^z == 0 for z != 0.
1986
7f5b1b77
MV
1987 * _scm.h (HAVE_RESTARTABLE_SYSCALLS): Do define even when
1988 SCM_COPT_THREADS is defined.
1989 (SCM_SYSCALL): Use EINTR-expection version when SCM_COPT_THREADS
1990 is defined.
1991
1992 * coop-pthreads.c: Some harmless renamings of internal stuff.
1993 (create_thread): New, generalized version of
1994 scm_call_with_new_thread.
1995 (scm_call_with_new_thread): Use it.
1996 (scm_spawn_thread): New, use create_thread.
1997
d52f53b1
MV
19982002-11-02 Marius Vollmer <mvo@zagadka.ping.de>
1999
2000 * coop-pthreads.c, coop-pthreads.h: Redone completely, you might
2001 start testing it now.
2002
2003 * _scm.h: Include <errno.h< so that SCM_SYSCALL is correctly
2004 defined when HAVE_RESTARTABLE_SYSCALLS is not defined.
2005 (HAVE_RESTARTABLE_SYSCALLS): Do not define when USE_COPT_THREADS
2006 is defined.
2007
30f920c3
MV
20082002-10-27 Marius Vollmer <mvo@zagadka.ping.de>
2009
2010 * scmsigs.c (signal_cell_handlers, install_handler_data,
2011 scm_delq_spine_x, really_install_handler, install_handler): New
2012 scheme for triggering signal handlers, to simplify take_signal.
2013 (take_signal): Simplified, to avoid race conditions.
2014 (scm_sigaction_for_thread): Use new Scheme. Validate that thread
2015 hasn't exited yet.
2016
2017 * async.c (scm_async_click): Reset pending_asyncs, handle
2018 signal_asyncs. Don't set cdr of a non-signal async to #f.
2019 (scm_i_queue_async_cell): Do not check cdr of cell for #f, queue
2020 always. Set pending_asyncs.
2021 (scm_system_async_mark_for_thread): Check that thread has not
2022 exited.
2023 (scm_unmask_signals, decrease_block): Call scm_async_click after
2024 block_asyncs becomes zero.
2025
2026 * __scm.h (SCM_ASYNC_CLICK): Check pending_asyncs instead of
2027 active_asyncs.
2028
2029 * root.h (scm_root_state): Added pending_asyncs and signal_asyncs
2030 fields.
2031 * root.c (root_mark): Mark them.
2032 (make_root): Initialize them.
2033
2034 * iselect.c, iselect.h: Replaced GUILE_ISELECT with
2035 USE_COOP_THREADS.
2036 (scm_internal_select): Define one version for USE_COOP_THREADS and
2037 one for USE_NULL_THREADS.
2038 (scm_init_iselect): Likewise.
2039
2040 * inline.h (scm_cell, scm_double_cell): Also allow
2041 USE_COPT_THREADS to not protect the slot initializers.
2042
2043 * init.c (scm_init_guile_1): Call scm_init_thread_procs. This is
2044 because threads need to be initialized before the stack, but
2045 gsubrs such as scm_timed_condition_variable_wait can only be
2046 created later.
2047
2048 * threads.h: Include "coop-pthreads.h" when requested.
2049 (scm_threads_make_mutex, scm_threads_lock_mutex,
2050 scm_threads_unlock_mutex, scm_threads_monitor): Removed, they were
2051 not implemented anyway.
2052 (scm_init_thread_procs, scm_try_mutex,
2053 scm_timed_condition_variable_wait,
2054 scm_broadcast_condition_variable, scm_c_thread_exited_p,
2055 scm_thread_exited_p): New prototypes.
2056 (struct timespec): Define if not already defined.
2057 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2058 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
2059 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2060 scm_cond_broadcast, scm_cond_destroy): Declarations moved here and
2061 deprecated.
2062
2063 * threads.c: Include <errno.h>. Include "coop-pthreads.c" when
2064 requested.
2065 (scm_thread_exited_p): New.
2066 (scm_try_mutex, scm_broadcast_condition_variable): Newly
2067 registered procedures.
2068 (scm_wait_condition_variable, scm_timed_wait_condition_variable):
2069 Use the latter as the procedure for "wait-condition-variable",
2070 thus offering a optional timeout parameter to Scheme.
2071 (scm_wait_condition_variable): Implement in terms of
2072 scm_timed_wait_condition_variable.
2073 (scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2074 scm_mutex_unlock, scm_mutex_destroy, scm_cond_init,
2075 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2076 scm_cond_broadcast, scm_cond_destroy): Implement in terms of
2077 scm_make_mutex, etc, and deprecate.
2078 (scm_init_threads): Do not create smobs, leave this to
2079 scm_threads_init. Do not include "threads.x" file.
2080 (scm_init_thread_procs): New, include "threads.x" here.
2081
2082 * null-threads.h (scm_null_mutex, scm_null_mutex_init,
2083 scm_null_mutex_lock, scm_null_mutex_unlock,
2084 scm_null_mutex_destroy, scm_null_condvar, scm_null_condvar_init,
2085 scm_null_condvar_wait, scm_null_condvar_signal,
2086 scm_null_condvar_destroy): Removed.
2087 (scm_mutex_init, scm_mutex_lock, scm_mutex_unlock, scm_cond_init,
2088 scm_cond_wait, scm_cond_signal, scm_cond_broadcast,
2089 scm_cond_destory): Do not define, they are now deprecated and
2090 handled by threads.{h,c}.
2091
2092 * null-threads.c (scm_null_mutex, scm_null_cond): Define here.
2093 (scm_threads_init): Create smobs here, using the appropriate
2094 sizes.
2095 (block): Removed, now unused.
2096 (scm_c_thread_exited_p): New.
2097 (scm_null_mutex_init, scm_null_mutex_lock, scm_null_mutex_unlock,
2098 scm_null_mutex_destroy, scm_null_condvar_init,
2099 scm_null_condvar_wait, scm_null_condvar_signal,
2100 scm_null_condvar_destroy): Removed and updated users to do their
2101 task directly.
2102 (scm_try_mutex, timeval_subtract,
2103 scm_timed_wait_condition_variable,
2104 scm_broadcast_condition_variable): New.
2105 (scm_wait_condition_variable): Removed.
2106
2107 * coop-defs.h (coop_m): Added 'level' field.
2108 (scm_t_mutex, scm_mutex_init, scm_mutex_lock, scm_mutex_trylock,
2109 scm_mutex_unlock, scm_mutex_destroy, scm_t_cond, scm_cond_init,
2110 scm_cond_wait, scm_cond_timedwait, scm_cond_signal,
2111 scm_cond_broadcast, scm_cond_destroy, struct timespec): Do not
2112 define.
2113 (coop_condition_variable_broadcast): New.
2114
2115 * coop-threads.c (scm_threads_init): Create smobs here, using the
2116 appropriate sizes.
2117 (scm_c_thread_exited_p, scm_try_mutex,
2118 scm_timed_wait_condition_variable,
2119 scm_broadcast_condition_variable): New.
2120 (scm_wait_condition_variable): Removed.
2121
2122 * coop.c (coop_new_mutex_init): Initialize level.
2123 (coop_mutex_trylock, coop_mutex_lock, coop_mutex_unlock): maintain
2124 level.
2125 (coop_condition_variable_signal): Renamed to
2126 coop_condition_variable_broadcast and reimplemented in terms of
2127 that. Thus...
2128 (coop_condition_variable_broadcast): New.
2129
2130 * goops.c (hell_mutex): Reimplemented using scm_make_mutex, etc.
2131
2132 * coop-pthreads.h, coop-pthreads.c: New, but unfinished.
2133
087ed40d
MV
21342002-10-21 Marius Vollmer <mvo@zagadka.ping.de>
2135
65a23095
MV
2136 * null-threads.c: Include <time.h>. Also, use <...> for inclusion
2137 of system headers.
2138
087ed40d
MV
2139 * async.c, goops.h, modules.h, validate.h (SCM_MAKE_VALIDATE_MSG):
2140 New. Use it instead of SCM_MAKE_VALIDATE in lots of places to
30f920c3 2141 give better error messages. Thanks to Bill Schottstaedt!
087ed40d 2142
5ec1d2c8
DH
21432002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
2144
2145 * evalext.h, evalext.c (scm_definedp, scm_defined_p): Renamed
2146 scm_definedp to scm_defined_p and deprecated scm_definedp.
2147
100ae50d
DH
21482002-10-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
2149
2150 * async.h, async.c (scm_system_async): Fixed deprecation to work
2151 correctly when deprecated features are excluded.
2152
2794cb50
MV
21532002-10-16 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2154
2155 * async.c (scm_system_async_mark_for_thread): Validate thread
2156 argument.
2157
2158 * coop-threads.c (scm_i_thread_root): Do not validate argument.
2159
2160 * feature.c (scm_init_feature): Don't add 'threads' for
2161 USE_NULL_THREADS.
2162
2163 * inline.h (scm_cell, scm_double_cell): Also allow
2164 USE_NULL_THREADS to not protect the slot initializers.
2165
2166 * scmsigs.c (scm_sigaction_for_thread): It's "USE_THREADS" not
2167 "USE_THREAD".
2168
2169 * Makefile.am (noinst_HEADERS): Added null-threads.c.
2170 (modinclude_HEADERS): Added null-threads.h.
2171
2172 * threads.h: Include null-threads.h when !USE_COOP_THREADS.
2173 * threads.c: Include null-threads.c when !USE_COOP_THREADS.
2174 (scm_init_threads): Use generic type names scm_t_mutex and
2175 scm_t_cond instead of coop_m and coop_c.
2176
2177 * null-threads.c, null-threads.h: New files.
2178
ff810d7a
MV
21792002-10-15 Marius Vollmer <mvo@zagadka.ping.de>
2180
2181 * Makefile.am: Replaced "$<" in non-pattern rules with its value.
2182 This is to support makes that know about "$<" only in pattern
2183 rules, like Sun's make.
2184
a90bdb73
MV
21852002-10-13 Marius Vollmer <mvo@zagadka.ping.de>
2186
2187 * Makefile.am (libpath.h): Fixed typo in top_srcdir_absolute
2188 substitution. Thanks to David Allouche!
2189
e71a8bf2
DH
21902002-10-13 Dirk Herrmann <D.Herrmann@tu-bs.de>
2191
2192 * evalext.h: Replaced SCM_DEBUG_DEPRECATED with
2193 !SCM_ENABLE_DEPRECATED.
2194
41f77ff5
MV
21952002-10-11 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2196
504d99c5 2197 * async.c (scm_system_async_mark_for_thread): Only call
41f77ff5
MV
2198 scm_i_thread_root when USE_THREADS is defined. Use scm_root
2199 otherwise.
2200
2201 * scmsigs.c (take_signal): Only call scm_i_thread_root when
2202 USE_THREADS is defined. Use scm_root otherwise.
2203 (scm_sigaction_for_thread): Ignore THREAD argument when
2204 USE_THREADS is not defined. Also, move THREAD argument defaulting
2205 out of HAVE_SIGACTION section, which was a bug.
2206
6d16b125
MV
22072002-10-10 Marius Vollmer <marius.vollmer@uni-dortmund.de>
2208
2209 * scmsigs.c (scm_sigaction_for_thread): Store original handler in
2210 signal_handlers, not the closure that is used as the async.
2211 The closure is stored in signal_handler_cells, as previously.
2212
acfa1f52
MV
22132002-10-10 Marius Vollmer <mvo@zagadka.ping.de>
2214
2215 * root.h (scm_root_state): Added 'block_async' slot.
2216 (scm_active_asyncs): Removed abbrev.
2217 * root.c (scm_make_root): Initialize 'block_asyncs' slot.
2218
2219 * __scm.h (SCM_ASYNC_TICK): Do without the scm_active_asyncs
2220 abbrev.
2221
2222 * async.h (scm_call_with_blocked_asyncs,
2223 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
2224 scm_c_call_with_unblocked_asyncs): New prototypes.
2225 (scm_mask_signals, scm_unmask_signals): Deprecated.
2226 (scm_mask_ints): Turned into a macro.
2227 * async.c (scm_mask_ints): Removed.
2228 (scm_run_asyncs): Do not set scm_mask_ints while running an async.
2229 this should not be necessary.
2230 (scm_async_click): Test block_asyncs instead of scm_mask_ints.
2231 (scm_mask_signals, scm_unmask_signals): Deprecated. Emit
2232 deprecation warning and check for errornous use. Set block_asyncs
2233 instead of scm_mask_ints.
2234 (increase_block, decrease_block, scm_call_with_blocked_asyncs,
2235 scm_call_with_unblocked_asyncs, scm_c_call_with_blocked_asyncs,
2236 scm_c_call_with_unblocked_asyncs): New.
2237
2238 * script.c (scm_compile_shell_switches): Do not set scm_mask_ints.
2239 Asyncs are enabled by default.
2240
34010f56
NJ
22412002-10-09 Neil Jerram <neil@ossau.uklinux.net>
2242
2243 * vports.c (scm_make_soft_port): Allow vector argument to carry a
2244 6th element: an input waiting thunk.
2245 (sf_input_waiting): New.
2246
9310d6f2
MV
22472002-10-05 Marius Vollmer <mvo@zagadka.ping.de>
2248
2249 * root.c (root_mark): Mark active_asyncs slot.
2250
2251 * async.c (scm_async_click): Set the cdr of a executed handler
2252 cell to SCM_BOOL_F, not SCM_EOL.
2253 (scm_i_queue_async_cell): Queue the cell at the end of the list,
2254 and only if the handler procedure is not already present.
2255 (scm_system_async_mark_for_thread): Initialize cdr of handler cell
2256 with SCM_BOOL_F.
2257 * scmsigs.c (scm_sigaction_for_thread): Likewise.
2258
ac48c719
RB
22592002-10-04 Rob Browning <rlb@defaultvalue.org>
2260
1360a142
RB
2261 * guile.c (main): switch to scm_lt_dlset_preloaded_symbols;
2262
2263 * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
2264 scm_lt_dlopenext, and scm_lt_dlerror.
2265 (sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
2266 and scm_lt_dlerror.
2267 (sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
2268 and scm_lt_dlerror.
2269 (sysdep_dynl_init): switch to scm_lt_dlinit();
2270
2271 * Makefile.am (libguile_la_LIBADD): switch to use
2272 libguile-ltdl.la.
2273
504d99c5 2274 * numbers.c (scm_integer_expt): (expt 0 1) should be 1.
ac48c719 2275
497092c9
MV
22762002-10-04 Marius Vollmer <mvo@zagadka.ping.de>
2277
2278 * scmsigs.h (scm_sigaction_for_thread): New prototype.
2279 * scmsigs.c (got_signal): Removed.
2280 (signal_handler_cells, signal_handler_threads): New.
2281 (take_signal): Queue the cell of the signal for the specified
2282 thread. Reset the signal handler on systems that don't have
2283 sigaction.
2284 (sys_deliver_signals): Removed.
2285 (close_1): New.
2286 (scm_sigaction_for_thread): Renamed from scm_sigaction and
2287 extended to also set the thread of a signal and allocate a cell
2288 for it. Keep the Scheme name "sigaction". Check that signum is
2289 within range. Also, use SCM_VECTOR_REF instead of SCM_VELTS.
2290 (scm_sigaction): Implement in terms of scm_sigaction_for_thread.
2291 (scm_init_scmsigs): Allocate signal_handler_cells and
2292 signal_handler_threads vectors.
2293
2294 * async.c: Removed GUILE_OLD_ASYNC_CLICK code. Reorganized so
2295 that system asnycs and user asyncs are separated. Reimplemented
2296 system asyncs to work per-thread.
2297
2298 * gc.c (scm_init_gc): Do not use scm_system_async.
2299
2300 * async.h (scm_asyncs_pending, scm_set_tick_rate,
2301 scm_set_switch_rate, scm_system_async_mark_from_signal_handler):
2302 Removed prototypes.
2303 (scm_i_queue_async_cell): New.
2304
2305 * __scm.h (scm_asyncs_pending_p): Removed.
2306 (SCM_ASYNC_CLICK): Check scm_active_asyncs instead of
2307 scm_asyncs_pending_p.
2308
2309 * async.h (scm_system_async_mark_for_thread): New prototype.
2310
2311 * __scm.h: Removed GUILE_OLD_ASYNC_CLICK code.
2312
2313 * root.h (scm_root_state): Added new "active_asyncs" slot.
2314 * root.c (scm_make_root): Initialize it to SCM_EOL.
2315
2316 * coop-defs.h (coop_t): Added new "handle" slot.
2317 * coop-threads.c (all_threads, scm_current_thread,
2318 scm_all_threads, scm_i_thread_root): New.
2319 (scm_threads_init): Add main thread to all_threads.
2320 (scheme_launch_thread): Remove thread from all_threads when it
2321 terminates.
2322 (scm_call_with_new_thread): Initialize handle slot of coop_t
2323 structure and add new thread to all_threads.
2324 (scm_spawn_thread): Likewise.
2325
2326 * threads.h (scm_current_thread, scm_all_threads): New prototypes.
2327 * threads.c (scm_current_thread, scm_all_threads): Register as
2328 primitives.
2329
2330 * dynl.c: Use scm_lt_ prefix for libltdl functions.
2331
480fa28d
NJ
23322002-09-29 Neil Jerram <neil@ossau.uklinux.net>
2333
2334 * script.c (scm_compile_shell_switches): Fix bad spelling of
2335 `explicitly' in comment.
2336
23372002-09-28 Neil Jerram <neil@ossau.uklinux.net>
2338
2339 * posix.c (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid):
2340 Refer to provided? in doc string rather than deprecated feature?.
2341
3553e1d1
GH
23422002-09-24 Gary Houston <ghouston@arglist.com>
2343
2344 * inline.h (scm_double_cell): prevent reordering of statements
2345 with any following code (for GCC 3 strict-aliasing).
2346 * numbers.c (scm_make_real), num2float.i.c (FLOAT2NUM): removed
2347 the earlier version of the reordering prevention.
2348
4ad0814a
HWN
23492002-09-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2350
2351 * inline.h (scm_double_cell): move SET_GCMARK set out of if body.
2352
e88e4f2e
HWN
23532002-09-09 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2354
2355 * gc-malloc.c (scm_gc_register_collectable_memory): more overflow
2356 protection.
2357
1e71eafb
HWN
23582002-09-08 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2359
2360 * inline.h: include stdio.h
2361
2362 * smob.c (free_print): abort if scm_debug_cell_accesses_p is set
2363
61ef9c1f
HWN
23642002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2365
dac04e9f
HWN
2366 * gc-segment.c (scm_i_make_initial_segment): check user settings
2367 for sanity.
2368
2369 * gc-malloc.c (scm_gc_init_malloc): check user settings for
2370 sanity.
dac04e9f
HWN
2371
2372 * gc-freelist.c (scm_init_freelist): check user settings for sanity.
2373
ffd72400
HWN
2374 * struct.h: change scm_structs_to_free to scm_i_structs_to_free
2375
2376 * gc-malloc.c (scm_gc_register_collectable_memory): use floats;
1e71eafb
HWN
2377 these won't ever wrap around with high memory usage. Thanks to
2378 Sven Hartrumpf for finding this.
ffd72400 2379
5bd4a949
HWN
2380 * gc-freelist.c: include <stdio.h>
2381
61ef9c1f
HWN
2382 * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
2383
ffd0ef3b
MV
23842002-09-01 Marius Vollmer <mvo@zagadka.ping.de>
2385
a27e3d14
MV
2386 * vectors.h (SCM_VECTOR_REF): New.
2387
ffd0ef3b
MV
2388 * snarf.h (SCM_DEFINE_PUBLIC): New.
2389
f8a1712b
MV
23902002-08-30 Marius Vollmer <mvo@zagadka.ping.de>
2391
2392 * socket.c (scm_addr_vector): Added size of address to arguments.
2393 Use it to avoid accessing a non-existent path in a sockaddr_un.
2394 Changed all callers.
2395
7200a36b
HWN
23962002-08-29 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2397
1383773b
HWN
2398 * gc.h: remove DOUBLECELL card flags.
2399
2400 * gc-malloc.c (scm_calloc): try to use calloc() before calling
2401 scm_realloc().
2402
2403 * gc-segment.c (scm_i_initialize_heap_segment_data): remove card
2404 init loop; handle this from scm_init_card_freelist()
2405
2406 * gc-card.c (scm_init_card_freelist): init bit vector here.
2407
7200a36b 2408 * numbers.c (scm_make_real): prevent reordering of statements
8fa5786d 2409 num2float.i.c (FLOAT2NUM): idem
7200a36b 2410
9981de3a
HWN
24112002-08-27 Han-Wen Nienhuys <hanwen@cs.uu.nl>
2412
2413 * eval.h: prepend libguile/ to include path
2414
19647556
MV
24152002-08-26 Marius Vollmer <mvo@zagadka.ping.de>
2416
2417 * script.c (scm_compile_shell_switches): Added "2002" to Copyright
2418