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