summaryrefslogtreecommitdiff
path: root/libguile/smob.c
Commit message (Collapse)AuthorAgeFilesLines
* Update license notices in all C filesAndy Wingo2018-06-201-17/+17
| | | | | Update to newest recommended license notices from the FSF. Everything stays LGPLv3+ except guile-readline which is GPLv3+.
* Remove (C) from copyright statementsAndy Wingo2018-06-201-1/+1
| | | | | | As the FSF advises, 'There is no legal significance to using the three-character sequence “(C)”, but it does no harm.' It does take up space though! For that reason, we remove it here from our C files.
* Rationalize include order in C filesAndy Wingo2018-06-201-6/+7
| | | | | Include config.h first, then system includes, then libguile includes, in alphabetical order, then the include for the file in question.
* Make libguile header inclusion consistent within libguile c filesAndy Wingo2018-06-201-12/+12
| | | | | Change from '#include "libguile/foo.h"' and '#include <libguile/foo.h>' to '#include "foo.h"'.
* Remove Emacs local variables comments in Guile sourceAndy Wingo2018-06-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .dir-locals.el file in the repository is sufficient for Emacs users. * libguile/__scm.h: * libguile/alist.c: * libguile/alist.h: * libguile/array-handle.c: * libguile/array-handle.h: * libguile/array-map.c: * libguile/array-map.h: * libguile/arrays.c: * libguile/arrays.h: * libguile/async.c: * libguile/async.h: * libguile/backtrace.c: * libguile/backtrace.h: * libguile/bitvectors.c: * libguile/bitvectors.h: * libguile/boolean.c: * libguile/boolean.h: * libguile/chars.c: * libguile/chars.h: * libguile/chooks.c: * libguile/chooks.h: * libguile/continuations.c: * libguile/continuations.h: * libguile/control.c: * libguile/conv-integer.i.c: * libguile/debug-malloc.h: * libguile/debug.c: * libguile/debug.h: * libguile/deprecation.c: * libguile/deprecation.h: * libguile/dynl.c: * libguile/dynl.h: * libguile/dynstack.c: * libguile/dynstack.h: * libguile/dynwind.c: * libguile/dynwind.h: * libguile/eq.c: * libguile/eq.h: * libguile/error.c: * libguile/error.h: * libguile/eval.c: * libguile/eval.h: * libguile/evalext.c: * libguile/evalext.h: * libguile/expand.c: * libguile/expand.h: * libguile/extensions.c: * libguile/extensions.h: * libguile/feature.c: * libguile/feature.h: * libguile/filesys.c: * libguile/filesys.h: * libguile/fluids.c: * libguile/fluids.h: * libguile/foreign.c: * libguile/fports.c: * libguile/fports.h: * libguile/frames.c: * libguile/frames.h: * libguile/gc-inline.h: * libguile/gc.c: * libguile/gc.h: * libguile/generalized-arrays.c: * libguile/generalized-arrays.h: * libguile/generalized-vectors.c: * libguile/generalized-vectors.h: * libguile/gettext.c: * libguile/gettext.h: * libguile/goops.c: * libguile/goops.h: * libguile/gsubr.c: * libguile/gsubr.h: * libguile/guardians.c: * libguile/guardians.h: * libguile/guile.c: * libguile/hash.c: * libguile/hash.h: * libguile/hashtab.c: * libguile/hashtab.h: * libguile/hooks.c: * libguile/hooks.h: * libguile/i18n.c: * libguile/i18n.h: * libguile/init.c: * libguile/init.h: * libguile/instructions.c: * libguile/instructions.h: * libguile/intrinsics.c: * libguile/intrinsics.h: * libguile/ioext.c: * libguile/ioext.h: * libguile/iselect.h: * libguile/keywords.c: * libguile/keywords.h: * libguile/list.c: * libguile/list.h: * libguile/load.c: * libguile/load.h: * libguile/loader.c: * libguile/loader.h: * libguile/macros.c: * libguile/macros.h: * libguile/mallocs.c: * libguile/mallocs.h: * libguile/memmove.c: * libguile/memoize.c: * libguile/memoize.h: * libguile/modules.c: * libguile/modules.h: * libguile/net_db.c: * libguile/net_db.h: * libguile/null-threads.c: * libguile/null-threads.h: * libguile/numbers.c: * libguile/numbers.h: * libguile/objprop.c: * libguile/objprop.h: * libguile/options.c: * libguile/options.h: * libguile/pairs.c: * libguile/pairs.h: * libguile/poll.c: * libguile/poll.h: * libguile/ports.c: * libguile/ports.h: * libguile/posix.c: * libguile/posix.h: * libguile/print.c: * libguile/print.h: * libguile/procprop.c: * libguile/procprop.h: * libguile/procs.c: * libguile/procs.h: * libguile/programs.c: * libguile/programs.h: * libguile/promises.c: * libguile/promises.h: * libguile/pthread-threads.h: * libguile/random.c: * libguile/random.h: * libguile/rdelim.c: * libguile/rdelim.h: * libguile/read.c: * libguile/read.h: * libguile/regex-posix.c: * libguile/regex-posix.h: * libguile/rw.c: * libguile/rw.h: * libguile/scmsigs.c: * libguile/scmsigs.h: * libguile/script.c: * libguile/script.h: * libguile/simpos.c: * libguile/simpos.h: * libguile/smob.c: * libguile/smob.h: * libguile/snarf.h: * libguile/socket.c: * libguile/socket.h: * libguile/sort.c: * libguile/sort.h: * libguile/srcprop.c: * libguile/srcprop.h: * libguile/stackchk.c: * libguile/stackchk.h: * libguile/stacks.c: * libguile/stacks.h: * libguile/stime.c: * libguile/stime.h: * libguile/strerror.c: * libguile/strings.c: * libguile/strings.h: * libguile/strorder.c: * libguile/strorder.h: * libguile/strports.c: * libguile/strports.h: * libguile/struct.c: * libguile/struct.h: * libguile/symbols.c: * libguile/symbols.h: * libguile/syntax.c: * libguile/syscalls.h: * libguile/tags.h: * libguile/threads.c: * libguile/threads.h: * libguile/throw.c: * libguile/throw.h: * libguile/trees.h: * libguile/unicode.c: * libguile/unicode.h: * libguile/uniform.c: * libguile/uniform.h: * libguile/values.c: * libguile/values.h: * libguile/variable.c: * libguile/variable.h: * libguile/vectors.c: * libguile/vectors.h: * libguile/version.c: * libguile/vm-engine.c: * libguile/vm-expand.h: * libguile/vm.c: * libguile/vm.h: * libguile/vports.c: * libguile/vports.h: * libguile/weak-list.h: * libguile/weak-set.c: * libguile/weak-set.h: * libguile/weak-table.c: * libguile/weak-table.h: * libguile/weak-vector.c: * libguile/weak-vector.h: Remove needless trailing comments.
* Remove _scm.hAndy Wingo2018-06-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/_scm.h: Remove. An internal header, never installed. * libguile/__scm.h: Remove horrible documentation. * libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): Remove _scm.h. * libguile/alist.c: * libguile/array-handle.c: * libguile/array-map.c: * libguile/arrays.c: * libguile/async.c: * libguile/atomic.c: * libguile/backtrace.c: * libguile/bitvectors.c: * libguile/boolean.c: * libguile/bytevectors.c: * libguile/chars.c: * libguile/continuations.c: * libguile/control.c: * libguile/debug-malloc.c: * libguile/debug.c: * libguile/deprecated.c: * libguile/deprecation.c: * libguile/dynl.c: * libguile/dynstack.c: * libguile/dynwind.c: * libguile/eq.c: * libguile/error.c: * libguile/eval.c: * libguile/evalext.c: * libguile/expand.c: * libguile/extensions.c: * libguile/fdes-finalizers.c: * libguile/feature.c: * libguile/filesys.c: * libguile/finalizers.c: * libguile/fluids.c: * libguile/foreign-object.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/gen-scmconfig.c: * libguile/generalized-arrays.c: * libguile/generalized-vectors.c: * libguile/gettext.c: * libguile/goops.c: * libguile/gsubr.c: * libguile/guardians.c: * libguile/hash.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/i18n.c: * libguile/init.c: * libguile/instructions.c: * libguile/intrinsics.c: * libguile/ioext.c: * libguile/keywords.c: * libguile/list.c: * libguile/load.c: * libguile/loader.c: * libguile/macros.c: * libguile/mallocs.c: * libguile/memoize.c: * libguile/modules.c: * libguile/net_db.c: * libguile/null-threads.c: * libguile/numbers.c: * libguile/objprop.c: * libguile/options.c: * libguile/pairs.c: * libguile/poll.c: * libguile/ports-internal.h: * libguile/ports.c: * libguile/posix.c: * libguile/print.c: * libguile/procprop.c: * libguile/procs.c: * libguile/programs.c: * libguile/promises.c: * libguile/r6rs-ports.c: * libguile/random.c: * libguile/rdelim.c: * libguile/read.c: * libguile/regex-posix.c: * libguile/rw.c: * libguile/scmsigs.c: * libguile/script.c: * libguile/simpos.c: * libguile/smob.c: * libguile/socket.c: * libguile/sort.c: * libguile/srcprop.c: * libguile/srfi-1.c: * libguile/srfi-13.c: * libguile/srfi-14.c: * libguile/srfi-4.c: * libguile/srfi-60.c: * libguile/stackchk.c: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/strorder.c: * libguile/strports.c: * libguile/struct.c: * libguile/symbols.c: * libguile/syntax.c: * libguile/threads.c: * libguile/throw.c: * libguile/trees.c: * libguile/unicode.c: * libguile/uniform.c: * libguile/values.c: * libguile/variable.c: * libguile/vectors.c: * libguile/version.c: * libguile/vm.c: * libguile/vports.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Remove _scm.h includes.
* Move subr snarfing macros to gsubr.h.Andy Wingo2018-06-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/snarf.h: Remove gsubr include and subr snarfers. * libguile/gsubr.h (SCM_DEFINE_GSUBR, SCM_DEFINE, SCM_PRIMITIVE_GENERIC): (SCM_DEFINE_PUBLIC, SCM_PROC, SCM_REGISTER_PROC, SCM_GPROC): Move here. * libguile/alist.c: * libguile/array-map.c: * libguile/arrays.c: * libguile/async.c: * libguile/atomic.c: * libguile/backtrace.c: * libguile/bitvectors.c: * libguile/boolean.c: * libguile/bytevectors.c: * libguile/chars.c: * libguile/continuations.c: * libguile/control.c: * libguile/debug-malloc.c: * libguile/debug.c: * libguile/deprecation.c: * libguile/dynl.c: * libguile/eq.c: * libguile/error.c: * libguile/error.h: * libguile/eval.c: * libguile/evalext.c: * libguile/expand.c: * libguile/extensions.c: * libguile/fdes-finalizers.c: * libguile/feature.c: * libguile/filesys.c: * libguile/finalizers.c: * libguile/fluids.c: * libguile/foreign-object.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/gc.c: * libguile/generalized-arrays.c: * libguile/generalized-vectors.c: * libguile/gettext.c: * libguile/guardians.c: * libguile/hash.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/i18n.c: * libguile/instructions.c: * libguile/intrinsics.c: * libguile/ioext.c: * libguile/keywords.c: * libguile/list.c: * libguile/load.c: * libguile/loader.c: * libguile/macros.c: * libguile/memoize.c: * libguile/modules.c: * libguile/net_db.c: * libguile/numbers.c: * libguile/objprop.c: * libguile/pairs.c: * libguile/poll.c: * libguile/ports.c: * libguile/posix.c: * libguile/print.c: * libguile/procs.c: * libguile/programs.c: * libguile/promises.c: * libguile/r6rs-ports.c: * libguile/random.c: * libguile/rdelim.c: * libguile/read.c: * libguile/regex-posix.c: * libguile/rw.c: * libguile/scmsigs.c: * libguile/simpos.c: * libguile/smob.c: * libguile/socket.c: * libguile/sort.c: * libguile/srcprop.c: * libguile/srfi-1.c: * libguile/srfi-13.c: * libguile/srfi-14.c: * libguile/srfi-4.c: * libguile/srfi-60.c: * libguile/stackchk.c: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/strorder.c: * libguile/strports.c: * libguile/struct.c: * libguile/symbols.c: * libguile/syntax.c: * libguile/threads.c: * libguile/throw.c: * libguile/trees.c: * libguile/unicode.c: * libguile/values.c: * libguile/variable.c: * libguile/vectors.c: * libguile/version.c: * libguile/vm.c: * libguile/vports.c: * libguile/weak-table.c: * libguile/weak-vector.c: Add gsubr includes.
* Devolve numbers.h from _scm.h.Andy Wingo2018-06-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/_scm.h: Remove numbers.h. * libguile/array-handle.c: * libguile/array-map.c: * libguile/arrays.c: * libguile/backtrace.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/chars.c: * libguile/continuations.c: * libguile/debug-malloc.c: * libguile/error.c: * libguile/eval.c: * libguile/filesys.c: * libguile/foreign-object.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/gc.c: * libguile/generalized-arrays.c: * libguile/gettext.c: * libguile/goops.c: * libguile/gsubr.c: * libguile/guardians.c: * libguile/hash.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/i18n.c: * libguile/instructions.c: * libguile/intrinsics.c: * libguile/ioext.c: * libguile/list.c: * libguile/memoize.c: * libguile/net_db.c: * libguile/options.c: * libguile/ports.c: * libguile/posix-w32.c: * libguile/posix.c: * libguile/procprop.c: * libguile/programs.c: * libguile/r6rs-ports.c: * libguile/random.c: * libguile/rdelim.c: * libguile/read.c: * libguile/regex-posix.c: * libguile/rw.c: * libguile/scmsigs.c: * libguile/simpos.c: * libguile/smob.c: * libguile/socket.c: * libguile/srcprop.c: * libguile/srfi-13.c: * libguile/srfi-14.c: * libguile/srfi-4.c: * libguile/stackchk.c: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/struct.c: * libguile/symbols.c: * libguile/threads.c: * libguile/throw.c: * libguile/vectors.c: * libguile/version.c: * libguile/vm.c: * libguile/vports.c: * libguile/weak-table.c: Add numbers.h.
* Remove ports.h from inline.hAndy Wingo2018-06-191-0/+1
| | | | | | | | | | | | | * libguile/inline.h: Remove ports.h. * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/foreign.c: * libguile/frames.c: * libguile/goops.h: * libguile/programs.c: * libguile/smob.c: * libguile/srfi-14.c: * libguile/vm.c: Add ports.h.
* Fix libguile subcomponent headers not to include <libguile.h>Andy Wingo2018-06-141-1/+2
| | | | | | | | | | | | | | | | | | | * libguile/bytevectors.h: Include uniform.h, for use in the macros. * libguile/extensions.h: Include libpath.h, for the SCM_EFFECTIVE_VERSION, which is almost always used with these routines. * libguile/frames.h: * libguile/instructions.h: * libguile/intrinsics.h: * libguile/loader.h: * libguile/programs.h: * libguile/vm.h: Include <libguile/__scm.h> instead of <libguile.h>. Cuts a circular include, but also precipitates a lot of maintenance in the .c files. * libguile/*.c: Update C files to add needed all needed includes that before were getting automatically pulled in by the indirect inclusion of libguile.h.
* Fix race between SMOB marking and finalizationAndy Wingo2016-06-231-3/+30
| | | | | | | | | | | * libguile/smob.c (clear_smobnum): New helper. (finalize_smob): Re-set the smobnum to the "finalized smob" type before finalizing. Fixes #19883. (scm_smob_prehistory): Pre-register a "finalized smob" type, which has no mark procedure. * test-suite/standalone/test-smob-mark-race.c: New file. * test-suite/standalone/Makefile.am: Arrange to build and run the new test.
* Remove scm_puts_unlocked.Andy Wingo2016-04-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/ports.h (scm_puts_unlocked): Remove. * libguile/ports.c (scm_puts): Replace implementation with scm_puts_unlocked's implementation. * libguile/arbiters.c: * libguile/backtrace.c: * libguile/bitvectors.c: * libguile/continuations.c: * libguile/deprecation.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/guardians.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/load.c: * libguile/macros.c: * libguile/mallocs.c: * libguile/print.c: * libguile/programs.c: * libguile/promises.c: * libguile/smob.c: * libguile/srcprop.c: * libguile/srfi-14.c: * libguile/stackchk.c: * libguile/struct.c: * libguile/threads.c: * libguile/throw.c: * libguile/values.c: * libguile/variable.c: * libguile/vm.c: * libguile/weak-set.c: * libguile/weak-table.c: Use scm_puts instead of scm_puts_unlocked.
* Remove scm_putc_unlocked.Andy Wingo2016-04-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/ports.h (scm_putc_unlocked): Remove. * libguile/ports.c (scm_putc): Replace implementation with scm_putc_unlocked's implementation. (scm_port_print): Use scm_putc. * libguile/arbiters.c: * libguile/arrays.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/continuations.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/macros.c: * libguile/mallocs.c: * libguile/print.c: * libguile/programs.c: * libguile/promises.c: * libguile/r6rs-ports.c: * libguile/smob.c: * libguile/srcprop.c: * libguile/struct.c: * libguile/variable.c: * libguile/weak-set.c: * libguile/weak-table.c: Use scm_putc instead of scm_putc_unlocked.
* Add `scm_smob_type_class()'.Andy Wingo2015-02-101-0/+12
| | | | | | * libguile/smob.h: * libguile/smob.c (scm_smob_type_class): New function, to access the GOOPS class for a SMOB type.
* Deprecate C exports of GOOPS classes.Andy Wingo2015-01-231-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/deprecated.h: (scm_class_boolean, scm_class_char, scm_class_pair) (scm_class_procedure, scm_class_string, scm_class_symbol) (scm_class_primitive_generic, scm_class_vector, scm_class_null) (scm_class_real, scm_class_complex, scm_class_integer) (scm_class_fraction, scm_class_unknown, scm_class_top) (scm_class_object, scm_class_class, scm_class_applicable) (scm_class_applicable_struct, scm_class_applicable_struct_with_setter) (scm_class_generic, scm_class_generic_with_setter, scm_class_accessor) (scm_class_extended_generic, scm_class_extended_generic_with_setter) (scm_class_extended_accessor, scm_class_method) (scm_class_accessor_method, scm_class_procedure_class) (scm_class_applicable_struct_class, scm_class_number, scm_class_list) (scm_class_keyword, scm_class_port, scm_class_input_output_port) (scm_class_input_port, scm_class_output_port, scm_class_foreign_slot) (scm_class_self, scm_class_protected, scm_class_hidden) (scm_class_opaque, scm_class_read_only, scm_class_protected_hidden) (scm_class_protected_opaque, scm_class_protected_read_only) (scm_class_scm, scm_class_int, scm_class_float) (scm_class_double, scm_port_class, scm_smob_class): Deprecate. * libguile/deprecated.c: * libguile/goops.c: * libguile/goops.h: Adapt to deprecation. * libguile/goops.h * libguile/goops.c (scm_is_generic, scm_is_method): New interfaces. (SCM_GENERICP, SCM_METHODP): Change to use new interfaces. * libguile/ports.c (scm_make_port_type): * libguile/smob.c (scm_make_smob_type, scm_set_smob_apply): Use internal names for the port and smob class arrays.
* Remove use of SCM_CRITICAL_SECTION in smob.cAndy Wingo2013-11-151-2/+2
| | | | | | * libguile/smob.c (scm_make_smob_type): Use a mutex instead of a critical section, which does an async tick. Not important, just a thing I saw.
* Remove stack programs, objcode, and the old VM.Andy Wingo2013-11-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/Makefile.am: * libguile/vm-i-loader.c: * libguile/vm-i-scheme.c: * libguile/vm-i-system.c: Remove the old VM files, and the rules to build the .i files. * libguile/vm-engine.c: * libguile/vm.c: Remove the old VM. Woot! * libguile/_scm.h (SCM_OBJCODE_COOKIE, SCM_OBJCODE_ENDIANNESS_OFFSET) (SCM_OBJCODE_WORD_SIZE_OFFSET): Remove. * libguile/evalext.c (scm_self_evaluating_p): Remove objcode and program cases. * libguile/frames.c (scm_frame_num_locals, scm_frame_previous): Remove program cases. * libguile/gc.c (scm_i_tag_name): Remove objcode case. * libguile/goops.c (scm_class_of, create_standard_classes): Remove objcode and program cases. * libguile/instructions.h: * libguile/instructions.c (scm_instruction_list, scm_instruction_p) (scm_instruction_length, scm_instruction_pops, scm_instruction_pushes) (scm_instruction_to_opcode, scm_opcode_to_instruction): Remove old VM code. * libguile/objcodes.h: * libguile/objcodes.c: Remove the objcode data type, and handling for objcode files. * libguile/print.c: Remove objcode and program printers. * libguile/procprop.c: Remove program cases. * libguile/procs.c: * libguile/programs.h: * libguile/programs.c: Remove old program code. * libguile/smob.c: Remove objcodes include. * libguile/snarf.h: Remove static program defines. * libguile/stacks.c: Remove program case. * libguile/tags.h: Remove program and objcode tc7s. * module/ice-9/session.scm (procedure-arguments) * module/language/tree-il/analyze.scm (validate-arity) * module/statprof.scm (get-call-data, procedure=?) * module/system/vm/frame.scm (frame-bindings) (frame-call-representation): Remove old program cases. * module/system/repl/debug.scm (frame->module): Add a FIXME. * module/system/vm/instruction.scm: Remove old exports. * module/system/vm/program.scm: Remove old program code.
* Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver2013-03-281-24/+25
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.ac libguile/deprecated.c libguile/deprecated.h libguile/filesys.h libguile/fluids.c libguile/fports.c libguile/gc.c libguile/guile.c libguile/numbers.c libguile/objcodes.c libguile/r6rs-ports.c libguile/smob.c libguile/socket.c libguile/threads.h module/language/scheme/decompile-tree-il.scm module/language/tree-il/peval.scm test-suite/tests/syncase.test
| * Allow the SMOB mark procedures to be called when libgc uses parallel markers.Ludovic Courtès2013-03-011-24/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <http://bugs.gnu.org/13611>. Reported by Mike Gran <spk121@yahoo.com>. * libguile/smob.c (current_mark_stack_pointer, current_mark_stack_limit): New variables. (smob_mark): Use CURRENT_MARK_STACK_POINTER and CURRENT_MARK_STACK_LIMIT instead of the same-named fields of `SCM_I_CURRENT_THREAD'. (scm_gc_mark): Likewise. (scm_smob_prehistory): Initialize CURRENT_MARK_STACK_LIMIT and CURRENT_MARK_STACK_POINTER. * libguile/threads.h (scm_i_thread): Add comment that `current_mark_stack_ptr' and `current_mark_stack_limit' are no longer used.
* | Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo2012-07-061-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: libguile/expand.c libguile/hashtab.c libguile/ports.c libguile/vectors.c libguile/weaks.c module/language/ecmascript/compile-tree-il.scm module/language/tree-il/effects.scm module/language/tree-il/fix-letrec.scm module/language/tree-il/peval.scm test-suite/tests/peval.test
| * Use `void *' instead of `GC_PTR' internally.Ludovic Courtès2012-07-021-1/+1
| | | | | | | | | | | | | | * libguile/finalizers.c, libguile/foreign.c, libguile/guardians.c, libguile/hashtab.c, libguile/numbers.c, libguile/ports.c, libguile/smob.c, libguile/struct.c, libguile/vectors.c, libguile/weaks.c: Use `void *' instead of `GC_PTR'.
| * Avoid use of `GC_PTR' in "smob.h".Ludovic Courtès2012-04-121-1/+1
| | | | | | | | | | | | | | | | Commit c46fee438cf9f4a3449e8d04e7a54805517fd092 removed the "bdw-gc.h" include from "smob.h", so better avoid `GC_PTR'. * libguile/smob.c (scm_i_finalize_smob): Use `void *' instead of `GC_PTR'. * libguile/smob.h (scm_i_finalize_smob): Update declaration accordingly.
| * make applicable smob calls cheaper, and fix a memory leakAndy Wingo2012-03-181-259/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/vm.c (prepare_smob_call): New helper. Now, instead of making a per-smob trampoline, we will shuffle the smob into the args and use a gsubr. This prevents a memory leak in which the trampolines, which were values in a weak-key table, were preventing the smobs from being collected. * libguile/vm-i-system.c (call, tail-call, mv-call): Adapt to new smob application mechanism. (smob-call): Remove this instruction. * libguile/smob.h (scm_smob_descriptor): Rename apply_trampoline_objcode to apply_trampoline. * libguile/smob.c: Remove our own objcode trampolines in favor of using scm_c_make_gsubr. (scm_smob_prehistory): No more trampoline weak map. * libguile/procprop.c (scm_i_procedure_arity): Adapt to applicable smob representation change.
| * use the new finalizer helpersAndy Wingo2012-03-081-16/+2
| | | | | | | | | | | | | | | | * libguile/foreign.c (scm_set_pointer_finalizer_x) * libguile/ports.c (finalize_port) * libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob) * libguile/struct.c (scm_i_alloc_struct) * libguile/numbers.c (make_bignum): Use the new API.
| * scm_new_smob, scm_new_double_smob inline functionsAndy Wingo2012-03-081-23/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/smob.h (scm_new_smob, scm_new_double_smob): New constructors, which do what SCM_NEWSMOB / SCM_NEWSMOB3 had done, but with inline functions instead of macros. They also bail to scm_i_new_smob / scm_i_new_double_smob in either the mark or the free case, so that the inline definition doesn't reference other internal details like libgc stuff. (SCM_SMOB_TYPE_MASK et al): Move definitions up so the new_smob see them as already being declared. (SCM_NEWSMOB, SCM_RETURN_NEWSMOB, SCM_NEWSMOB2, SCM_RETURN_NEWSMOB2): (SCM_NEWSMOB3, SCM_RETURN_NEWSMOB3): Reimplement in terms of the new inline functions. Remove now-unneeded bdw-gc include. * libguile/smob.c (finalize_smob): Rename from scm_i_finalize_smob, and make static. (scm_i_new_smob, scm_i_new_double_smob): Slow-path allocators. (scm_i_finalize_smob, scm_i_new_smob_with_mark_proc): Add back-compatibility shims to preserve ABI. * libguile/inline.c: Include smob.h, so as to reify scm_new_smob and scm_new_double_smob.
* | make applicable smob calls cheaper, and fix a memory leakAndy Wingo2012-03-181-255/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/vm.c (prepare_smob_call): New helper. Now, instead of making a per-smob trampoline, we will shuffle the smob into the args and use a gsubr. This prevents a memory leak in which the trampolines, which were values in a weak-key table, were preventing the smobs from being collected. * libguile/vm-i-system.c (call, tail-call, mv-call): Adapt to new smob application mechanism. (smob-call): Remove this instruction. * libguile/smob.h (scm_smob_descriptor): Rename apply_trampoline_objcode to apply_trampoline. * libguile/smob.c: Remove our own objcode trampolines in favor of using scm_c_make_gsubr. (scm_smob_prehistory): No more trampoline weak map. * libguile/procprop.c (scm_i_procedure_arity): Adapt to applicable smob representation change.
* | use the new finalizer helpersAndy Wingo2012-02-191-17/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/foreign.c (scm_set_pointer_finalizer_x) * libguile/ports.c (finalize_port, scm_c_make_port_with_encoding) (open_iconv_descriptors) * libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob) * libguile/struct.c (scm_i_alloc_struct) * libguile/weak-set.c (weak_gc_finalizer) (scm_c_register_weak_gc_callback) * libguile/weak-table.c (scm_c_register_weak_gc_callback) (weak_gc_finalizer) * libguile/numbers.c (make_bignum): Use the new API.
* | Revert "add SCM_HEAP_OBJECT_BASE"Andy Wingo2012-01-311-2/+2
| | | | | | | | | | | | | | | | This reverts commit 47ed8656db8800f3ad20a40eb2c4e9ef3dc891e3. Conflicts: libguile/foreign.c
* | Merge commit 'f78a1ccede02ccad89d6c91a6b297f1f14a30907'Andy Wingo2012-01-101-4/+1
|\ \ | |/
| * stdlib.h, not malloc.hAndy Wingo2011-12-221-4/+1
| | | | | | | | | | | | | | | | | | * configure.ac: Remove check for malloc.h. * libguile/gc-malloc.c: * libguile/gc.c: * libguile/mallocs.c: * libguile/smob.c: Use stdlib instead of malloc.h.
* | locking for putc, putsAndy Wingo2011-11-081-4/+4
| | | | | | | | | | | | | | * libguile/ports.c (scm_putc, scm_puts): * libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into _unlocked and locked variants. Change all callers to use the _unlocked versions.
* | most uses of scm_from_locale_symbol become scm_from_utf8_symbolAndy Wingo2011-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/array-handle.c: * libguile/chars.c: * libguile/expand.c: * libguile/feature.c: * libguile/goops.c: * libguile/gsubr.c: * libguile/instructions.c: * libguile/load.c: * libguile/macros.c: * libguile/memoize.c: * libguile/modules.c: * libguile/options.c: * libguile/print.c: * libguile/smob.c: * libguile/snarf.h: Change most uses of scm_from_locale_symbol to scm_from_utf8_symbol, as the symbols really are not locale-dependent.
* | add SCM_HEAP_OBJECT_BASEAndy Wingo2011-10-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/tags.h (SCM_HEAP_OBJECT_BASE): New macro. Given a SCM, returns a pointer to the start of its memory area on the heap. * libguile/bytevectors.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/gc.h: * libguile/guardians.c: * libguile/numbers.h: * libguile/ports.c: * libguile/smob.c: * libguile/struct.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Use it.
* | add SCM_HEAP_OBJECT_PAndy Wingo2011-10-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/tags.h (SCM_HEAP_OBJECT_P): New macro, an alias for SCM_NIMP. * libguile/arrays.c: * libguile/debug.c: * libguile/foreign.c: * libguile/gdbint.c: * libguile/guardians.c: * libguile/list.c: * libguile/modules.c: * libguile/options.c: * libguile/smob.c: * libguile/validate.h: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Use it instead of SCM_NIMP or !SCM_IMP.
* | add SCM_{PACK,UNPACK}_POINTERAndy Wingo2011-10-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/tags.h (SCM_UNPACK_POINTER, SCM_PACK_POINTER): New macros. The old SCM2PTR and PTR2SCM were defined in such a way that round-tripping through a pointer could lose precision, even in the case in which you weren't interested in actually dereferencing the pointer, it was simply that you needed to plumb a SCM through APIs that take pointers. These new macros are more like SCM_PACK and SCM_UNPACK, but for pointer types. The bit representation of the pointer should be the same as the scm_t_bits representation. * libguile/gc.h (PTR2SCM, SCM2PTR): Remove support for (old) UNICOS pointers. We are going to try tagging the SCM object itself in the future, and I don't think that keeping this support is worth its cost. It probably doesn't work anyway. * libguile/backtrace.c: * libguile/bytevectors.c: * libguile/continuations.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/gc.h: * libguile/guardians.c: * libguile/hashtab.c: * libguile/load.c: * libguile/numbers.c: * libguile/ports.c: * libguile/smob.c: * libguile/strings.c: * libguile/symbols.c: * libguile/vm.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Update many sites to use the new macros.
* | convert internal weak hash table users to use the weak table apiAndy Wingo2011-10-241-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The weak table API isn't public yet. It could be after some review. But we can go ahead and use it now internally. * libguile/foreign.c: * libguile/goops.c: * libguile/objprop.c: * libguile/procprop.c: * libguile/smob.c: * libguile/srcprop.c: Update weak table users to new API. No locking needed!
* | scm_new_smob, scm_new_double_smob inline functionsAndy Wingo2011-05-261-22/+71
|/ | | | | | | | | | | | | | | | | | | | | | | | * libguile/smob.h (scm_new_smob, scm_new_double_smob): New constructors, which do what SCM_NEWSMOB / SCM_NEWSMOB3 had done, but with inline functions instead of macros. They also bail to scm_i_new_smob / scm_i_new_double_smob in either the mark or the free case, so that the inline definition doesn't reference other internal details like libgc stuff. (SCM_SMOB_TYPE_MASK et al): Move definitions up so the new_smob see them as already being declared. (SCM_NEWSMOB, SCM_RETURN_NEWSMOB, SCM_NEWSMOB2, SCM_RETURN_NEWSMOB2): (SCM_NEWSMOB3, SCM_RETURN_NEWSMOB3): Reimplement in terms of the new inline functions. (scm_i_finalize_smob): Remove declaration, as it's no longer needed or used. Remove now-unneeded bdw-gc include. * libguile/smob.c (finalize_smob): Rename from scm_i_finalize_smob, and make static. (scm_i_new_smob, scm_i_new_double_smob): Slow-path allocators. * libguile/inline.c: Include smob.h, so as to reify scm_new_smob and scm_new_double_smob.
* safely access the trampoline weak mapAndy Wingo2011-05-241-3/+12
| | | | | * libguile/smob.c (scm_i_smob_apply_trampoline): Protect the trampoline weak map with a mutex.
* objcode type is an enumeration, not flagsAndy Wingo2011-01-271-2/+2
| | | | | | | | | | | | | | | | | | * libguile/objcodes.h (SCM_OBJCODE_TYPE_MMAP) (SCM_OBJCODE_TYPE_BYTEVECTOR, SCM_OBJCODE_TYPE_SLICE) (SCM_OBJCODE_TYPE_STATIC): Enumerate objcode types instead of expressing them as flags. (SCM_OBJCODE_TYPE): Type is held in bits 8-15. (SCM_OBJCODE_FLAGS): Flags are now shifted by 16 bits, not 8. (SCM_MAKE_OBJCODE_TAG): New helper. * libguile/continuations.c (STATIC_OBJCODE_TAG): * libguile/control.c (STATIC_OBJCODE_TAG): * libguile/foreign.c (STATIC_OBJCODE_TAG): * libguile/gsubr.c (STATIC_OBJCODE_TAG): * libguile/smob.c (STATIC_OBJCODE_TAG): * libguile/objcodes.c (make_objcode_by_mmap, scm_c_make_objcode_slice) (scm_bytecode_to_objcode): : Use SCM_MAKE_OBJCODE_TAG.
* smobs are applied with vm trampoline proceduresAndy Wingo2010-01-091-275/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/smob.c: Instead of having special evaluator support for applying smobs, we use the same strategy that gsubr uses, that smob application should happen via a trampoline VM procedure, which uses a special opcode (smob-apply). So statically allocate all of the desired trampoline procedures here. (scm_i_smob_apply_trampoline): Unfortunately there's no real place to put the trampoline, so instead use a weak-key hash. It's nasty, but I think the benefits of speeding up procedure calls in the general case are worth it. * libguile/smob.h (scm_smob_descriptor): Remove fields apply_0, apply_1, apply_2, and apply_3; these were never public. Also remove the gsubr_type field. Instead cache the trampoline objcode here. (SCM_SMOB_APPLY_0, SCM_SMOB_APPLY_1, SCM_SMOB_APPLY_2, SCM_SMOB_APPLY_3): Just go through scm_call_0, etc here. * libguile/vm-i-system.c (call, tail-call, mv-call): Simplify. All procedure calls are VM calls now. (smob-call): New instruction, used in smob trampoline procedures. * libguile/vm.c (apply_foreign): Remove. Yay! * libguile/procprop.c (scm_i_procedure_arity): Refactor a bit for the smob changes.
* re-add SCM_GSUBR_MAXAndy Wingo2010-01-091-1/+0
| | | | | | | * libguile/gsubr.h (SCM_GSUBR_MAX): Restore this define, which specifies the max number of args to a gsubr. * libguile/smob.c: Remove local SCM_GSUBR_MAX define.
* remove scm_tc7_gsubrAndy Wingo2010-01-071-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/tags.h (scm_tc7_gsubr): Return to the pool of unused tc7s, as there are no more gsubrs. Yay :) * libguile/programs.h (SCM_F_PROGRAM_IS_PRIMITIVE): (SCM_PROGRAM_IS_PRIMITIVE): New flag and accessor. * libguile/gsubr.c (create_gsubr): * libguile/snarf.h (SCM_STATIC_PROGRAM): Give subrs a PRIMITIVE flag. * libguile/smob.h: * libguile/smob.c (scm_i_smob_arity): New internal procedure. Uses the old GSUBR type macros, local to the file. * libguile/procprop.c (scm_i_procedure_arity): Call out to scm_i_smob_arity, and remove a gsubr case. * libguile/gc.c (scm_i_tag_name): * libguile/evalext.c (scm_self_evaluating_p): * libguile/goops.c (scm_class_of): * libguile/vm.c (apply_foreign): * libguile/hash.c (scm_hasher): * libguile/debug.c (scm_procedure_name): * libguile/print.c (iprin1): Remove gsubr cases. * libguile/gsubr.h (SCM_PRIMITIVE_P): Fix to work with the new VM program regimen. (SCM_GSUBR_TYPE, SCM_GSUBR_MAKTYPE, SCM_GSUBR_MAX, SCM_GSUBR_REQ) (SCM_GSUBR_OPT, SCM_GSUBR_REST): Remove these macros, that are no longer useful. * libguile/gsubr.c (scm_i_gsubr_apply, scm_i_gsubr_apply_list) (scm_i_gsubr_apply_array): Remove internal gsubr application functions.
* clean up smob macro implementationAndy Wingo2009-12-081-8/+0
| | | | | | | * libguile/smob.h: Regularize the SCM_SMOB macros, and make them all go through some generic SMOB accessor macros. * libguile/smob.c (scm_i_set_smob_flags): Remove, as it is unused.
* fold objects.[ch] into goops.[ch]Andy Wingo2009-11-151-1/+0
| | | | Remove objects.h #includes as appropriate.
* Remove default port/SMOB finalizers.Ludovic Courtès2009-09-281-15/+3
| | | | | | | | | | | | | | * libguile/ports.c (scm_port_free0): Remove. (scm_make_port_type): Set `free' to NULL. * libguile/smob.c (scm_make_smob_type): Leave `free' to NULL. (scm_smob_free): Remove. * libguile/smob.h (scm_smob_free): Remove. * libguile/deprecated.c (scm_smob_free): New. * libguile/deprecated.h (scm_smob_free): New declaration.
* Rename "boehm-gc.h" to "bdw-gc.h"; add to the distribution.Ludovic Courtès2009-09-141-1/+1
| | | | | | | * libguile/Makefile.am (modinclude_HEADERS): Add `bdw-gc.h'. * libguile/bdw-gc.h: Rename from "boehm-gc.h"; users updated. Update to LGPLv3+.
* Remove the `scm_tc_free_cell' SMOB type.Ludovic Courtès2009-08-251-25/+0
| | | | | | | | | | | | | | | | | | * libguile/deprecated.h (SCM_FREEP, SCM_NFREEP): Changed to constants. * libguile/gc.c (scm_i_tag_name): Remove reference to `scm_tc_free_cell'. * libguile/gc.h (SCM_FREE_CELL_CDR, SCM_SET_FREE_CELL_CDR): Remove. * libguile/smob.c (free_print): Remove. (scm_smob_prehistory): Don't create the "free" SMOB type. * libguile/struct.c (struct_finalizer_trampoline): Use a bare `scm_tc3_struct' tag for finalized structs instead of `scm_tc_free_cell'. * libguile/tags.h (scm_tc_free_cell): Remove.
* Simplify the creation of the SMOB GC "kind".Ludovic Courtès2009-08-201-6/+3
| | | | | * libguile/smob.c (smob_freelist): Remove. (scm_smob_prehistory): Adjust accordingly.
* Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès2009-08-181-6/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: lib/Makefile.am libguile/Makefile.am libguile/frames.c libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc_os_dep.c libguile/load.c libguile/macros.c libguile/objcodes.c libguile/programs.c libguile/strings.c libguile/vm.c m4/gnulib-cache.m4 m4/gnulib-comp.m4 m4/inline.m4
| * Change Guile license to LGPLv3+Neil Jerram2009-06-171-6/+7
| | | | | | | | | | | | | | | | | | | | (Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )