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