summaryrefslogtreecommitdiff
path: root/libguile/struct.h
AgeCommit message (Collapse)AuthorFilesLines
2009-06-17Change Guile license to LGPLv3+Neil Jerram1-6/+7
(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
2008-09-10Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-3/+3
Conflicts: libguile/Makefile.am libguile/coop-defs.h libguile/gc-card.c libguile/gc-freelist.c libguile/gc-malloc.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/hashtab.c libguile/hashtab.h libguile/inline.h libguile/private-gc.h libguile/struct.c libguile/struct.h libguile/threads.c libguile/threads.h libguile/vectors.h libguile/weaks.h test-suite/tests/gc.test
2008-09-10Merge commit '7337d56d5714227865aeca2b40b6bd97cce296d2' into ↵Ludovic Courtès1-1/+2
boehm-demers-weiser-gc Conflicts: libguile/struct.c
2008-09-10Removed the now-useless `scm_struct_free_*' functions.Ludovic Courtes1-4/+0
* libguile/struct.c (scm_alloc_struct): Set the `scm_struct_i_free' element to 0 instead of `scm_struct_free_standard'. (scm_struct_free_0): Removed. (scm_struct_free_light): Removed. (scm_struct_free_standard): Removed. (scm_struct_free_entity): Removed. * libguile/struct.h (scm_struct_free_0): Removed. (scm_struct_free_light): Removed. (scm_struct_free_standard): Removed. (scm_struct_free_entity): Removed. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-35
2008-09-05Added support for the free function of structures.Ludovic Courtes1-1/+0
* libguile/struct.c (struct_finalizer_trampoline): New. (scm_struct_gc_init): Removed. (scm_i_structs_to_free): Removed. (scm_free_structs): Removed. (scm_make_struct): Register a finalizer for the new struct if need be. (scm_struct_prehistory): Cleared. * libguile/struct.h (scm_i_structs_to_free): Removed. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-33
2008-08-16Use word_2 to store mark bits for freeing structs and vtables in theHan-Wen Nienhuys1-0/+9
correct order. This ensures that we only use GC Marks during the actual GC Mark.
2008-05-31Add `SCM_INTERNAL' macro, use it.Ludovic Courtès1-4/+4
2007-03-07merge from 1.8 branchKevin Ryde1-1/+2
2006-06-13Changes from arch/CVS synchronizationLudovic Courtès1-0/+1
2006-04-17merge from 1.8 branchKevin Ryde1-1/+1
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-35/+11
2002-09-05* struct.h: change scm_structs_to_free to scm_i_structs_to_freeHan-Wen Nienhuys1-1/+1
* gc-malloc.c (scm_gc_register_collectable_memory): use floats; these won't ever wrap around with high memory usage. * gc-malloc.c: add DEBUGINFO for mtrigger GCs.
2002-02-11* gc.h, gc.c (scm_gc_sweep): Issue deprecation warning whenMarius Vollmer1-6/+7
non-zero is returned from a port or smob free function. (scm_malloc, scm_realloc, scm_strndup, scm_strdup, scm_gc_register_collectable_memory, scm_gc_unregister_collectable_memory, scm_gc_malloc, scm_gc_realloc, scm_gc_free, scm_gc_strndup, scm_gc_strdup): New. * backtrace.c, continuations.c, convert.i.c, coop-threads.c, debug-malloc.c, dynl.c, environments.c, environments.h, extensions.c, filesys.c, fports.c, gc.c, gc.h, gh_data.c, goops.c, guardians.c, hooks.c, init.c, keywords.c, load.c, numbers.c, ports.c, posix.c, procs.c, rdelim.c, regex-posix.c, root.c, smob.c, stime.c, strings.c, struct.c, struct.h, symbols.c, unif.c, vectors.c, weaks.c: Use scm_gc_malloc/scm_malloc and scm_gc_free/free instead of scm_must_malloc and scm_must_free, as appropriate. Return zero from smob and port free functions. * debug-malloc.c (scm_malloc_reregister): Handle "old == NULL". * fports.c (scm_setvbuf): Reset read buffer to saved values when it is pointing to the putback buffer.
2001-11-02Prefixed each each exported symbol with SCM_API.Marius Vollmer1-23/+23
2001-08-31* Remove deprecated macros and typenames.Dirk Herrmann1-4/+5
* Rename header macros to SCM_<filename>_H. * Prefer !SCM_<foo> over SCM_N<foo>.
2001-07-29(scm_vtable_index_vcell): Removed. Renumbered subsequent indices.Marius Vollmer1-4/+6
2001-07-26* tags.h: Update tag system docs.Marius Vollmer1-4/+3
(scm_tc3_cons_gloc): Renamed to scm_tc3_struct. Changed all uses. (scm_tcs_cons_gloc): Renamed to scm_tcs_struct. Changed all uses. (SCM_ECONSP, SCM_NECONSP): Removed. Changed all uses to SCM_CONSP or SCM_NCONSP, respectively. * struct.c, struct.h, srcprop.c, procs.c, procprop.c, print.c, objects.c. modules.c, goops.c, eval.c, debug.c: Changed all uses of scm_tc3_cond_gloc and scm_tcs_cons_gloc. See above. * print.c (scm_iprin1): Remove printing of glocs. Do not try to tell glocs from structs. * gc.c (scm_gc_mark, scm_gc_sweep): Remove handling of glocs. * eval.c (scm_m_atbind): Make a list of variables, not glocs. (scm_ceval, scm_deval): For SCM_IM_BIND, fiddle with variables instead of with glocs. (EVALCAR): Do not test for glocs. (scm_lookupcar, scm_lookupcar1): Do not handle glocs in race condition. (scm_unmemocar): Do not handle glocs. (scm_m_atfop): Memoize as a variable, not as a gloc. (scm_eval_args, scm_deval_args): Do not handle glocs. (scm_ceval, scm_deval): Likewise. * eval.h (SCM_XEVALCAR): Do not test for glocs. (SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL, SCM_GLOC_VAL_LOC): Removed. * debug.h, debug.c (scm_make_gloc, scm_gloc_p): Removed. * dynwind.c (scm_swap_bindings): Likewise. (scm_dowinds): Updated to recognize lists of variables instead of lists of glocs. * __scm.h (SCM_CAUTIOS, SCM_RECKLESS): Update comments.
2001-07-09Remove "face-lift" comment.Thien-Thi Nguyen1-2/+0
2001-06-14replace "scm_*_t" with "scm_t_*".Marius Vollmer1-9/+9
2001-06-11* Simplified the goops macro system a bit and fixed a bug.Dirk Herrmann1-0/+2
2001-05-27* Changed the default definition of SCM.Dirk Herrmann1-5/+5
* Fixed some typing problems detected by the above change. * Fixed some problems that were detected by compiling guile with -W.
2001-05-26revert the ill-considered part of the 2001-05-24 changesMichael Livshin1-1/+1
2001-05-24* validate.hMichael Livshin1-6/+6
(SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,BITS,UBITS,INT,UINT}[_DEF]): new macros. * unif.h: type renaming: scm_array -> scm_array_t scm_array_dim -> scm_array_dim_t the old names are deprecated, all in-Guile uses changed. * tags.h (scm_ubits_t): new typedef, representing unsigned scm_bits_t. * stacks.h: type renaming: scm_info_frame -> scm_info_frame_t scm_stack -> scm_stack_t the old names are deprecated, all in-Guile uses changed. * srcprop.h: type renaming: scm_srcprops -> scm_srcprops_t scm_srcprops_chunk -> scm_srcprops_chunk_t the old names are deprecated, all in-Guile uses changed. * gsubr.c, procs.c, print.c, ports.c, read.c, rdelim.c, ramap.c, rw.c, smob.c, sort.c, srcprop.c, stacks.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, unif.c, values.c, vectors.c, vports.c, weaks.c: various int/size_t -> size_t/scm_bits_t changes. * random.h: type renaming: scm_rstate -> scm_rstate_t scm_rng -> scm_rng_t scm_i_rstate -> scm_i_rstate_t the old names are deprecated, all in-Guile uses changed. * procs.h: type renaming: scm_subr_entry -> scm_subr_entry_t the old name is deprecated, all in-Guile uses changed. * options.h (scm_option_t.val): unsigned long -> scm_bits_t. type renaming: scm_option -> scm_option_t the old name is deprecated, all in-Guile uses changed. * objects.c: various long -> scm_bits_t changes. (scm_i_make_class_object): flags: unsigned long -> scm_ubits_t * numbers.h (SCM_FIXNUM_BIT): deprecated, renamed to SCM_I_FIXNUM_BIT. * num2integral.i.c: new file, multiply included by numbers.c, used to "templatize" the various integral <-> num conversion routines. * numbers.c (scm_mkbig, scm_big2num, scm_adjbig, scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl): deprecated. (scm_i_mkbig, scm_i_big2inum, scm_i_adjbig, scm_i_normbig, scm_i_copybig, scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big, scm_i_long2big, scm_i_ulong2big, scm_i_bits2big, scm_i_ubits2big, scm_i_size2big, scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big, scm_i_dbl2big, scm_i_big2dbl, scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num, scm_bits2num, scm_ubits2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2bits, scm_num2ubits, scm_num2ptrdiff, scm_num2size): new functions. * modules.c (scm_module_reverse_lookup): i, n: int -> scm_bits_t.x * load.c: change int -> size_t in various places (where the variable is used to store a string length). (search-path): call scm_done_free, not scm_done_malloc. * list.c (scm_ilength): return a scm_bits_t, not long. some other {int,long} -> scm_bits_t changes. * hashtab.c: various [u]int -> scm_bits_t changes. scm_ihashx_closure -> scm_ihashx_closure_t (and made a typedef). (scm_ihashx): n: uint -> scm_bits_t use scm_bits2num instead of scm_ulong2num. * gsubr.c: various int -> scm_bits_t changes. * gh_data.c (gh_scm2double): no loss of precision any more. * gh.h (gh_str2scm): len: int -> size_t (gh_{get,set}_substr): start: int -> scm_bits_t, len: int -> size_t (gh_<num>2scm): n: int -> scm_bits_t (gh_*vector_length): return scm_[u]size_t, not unsigned long. (gh_length): return scm_bits_t, not unsigned long. * fports.h: type renaming: scm_fport -> scm_fport_t the old name is deprecated, all in-Guile uses changed. * fports.c (fport_fill_input): count: int -> scm_bits_t (fport_flush): init_size, remaining, count: int -> scm_bits_t * debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): removed those prototypes, as the functions they prototype don't exist. * fports.c (default_buffer_size): int -> size_t (scm_fport_buffer_add): read_size, write_size: int -> scm_bits_t default_size: int -> size_t (scm_setvbuf): csize: int -> scm_bits_t * fluids.c (n_fluids): int -> scm_bits_t (grow_fluids): old_length, i: int -> scm_bits_t (next_fluid_num, scm_fluid_ref, scm_fluid_set_x): n: int -> scm_bits_t (scm_c_with_fluids): flen, vlen: int -> scm_bits_t * filesys.c (s_scm_open_fdes): changed calls to SCM_NUM2LONG to the new and shiny SCM_NUM2INT. * extensions.c: extension -> extension_t (and made a typedef). * eval.h (SCM_IFRAME): cast to scm_bits_t, not int. just so there are no nasty surprises if/when the various deeply magic tag bits move somewhere else. * eval.c: changed the locals used to store results of SCM_IFRAME, scm_ilength and such to be of type scm_bits_t (and not int/long). (iqq): depth, edepth: int -> scm_bits_t (scm_eval_stack): int -> scm_bits_t (SCM_CEVAL): various vars are not scm_bits_t instead of int. (check_map_args, scm_map, scm_for_each): len: long -> scm_bits_t i: int -> scm_bits_t * environments.c: changed the many calls to scm_ulong2num to scm_ubits2num. (import_environment_fold): proc_as_ul: ulong -> scm_ubits_t * dynwind.c (scm_dowinds): delta: long -> scm_bits_t * debug.h: type renaming: scm_debug_info -> scm_debug_info_t scm_debug_frame -> scm_debug_frame_t the old names are deprecated, all in-Guile uses changed. (scm_debug_eframe_size): int -> scm_bits_t * debug.c (scm_init_debug): use scm_c_define instead of the deprecated scm_define. * continuations.h: type renaming: scm_contregs -> scm_contregs_t the old name is deprecated, all in-Guile uses changed. (scm_contregs_t.num_stack_items): size_t -> scm_bits_t (scm_contregs_t.num_stack_items): ulong -> scm_ubits_t * continuations.c (scm_make_continuation): change the type of stack_size form long to scm_bits_t. * ports.h: type renaming: scm_port_rw_active -> scm_port_rw_active_t (and made a typedef) scm_port -> scm_port_t scm_ptob_descriptor -> scm_ptob_descriptor_t the old names are deprecated, all in-Guile uses changed. (scm_port_t.entry): int -> scm_bits_t. (scm_port_t.line_number): int -> long. (scm_port_t.putback_buf_size): int -> size_t. * __scm.h (long_long, ulong_long): deprecated (they pollute the global namespace and have little value besides that). (SCM_BITS_LENGTH): new, is the bit size of scm_bits_t (i.e. of an SCM handle). (ifdef spaghetti): include sys/types.h and sys/stdtypes.h, if they exist (for size_t & ptrdiff_t) (scm_sizet): deprecated. * Makefile.am (noinst_HEADERS): add num2integral.i.c
2000-11-26 * reimplementation of values, call-with-values as primitives:Gary Houston1-0/+2
* values.c, values.h: new files. use a struct to contain multiple values, similar to the previous Scheme-level implementation. * Makefile.am: add values.c, values.h, values.x. * continuations.c (continuation_apply): support R5RS multiple value continuations. * init.c: call scm_init_values. * struct.h: define SCM_SET_STRUCT_PRINTER.
2000-08-09* struct.h (SCM_STRUCT_GC_CHAIN, SCM_SET_STRUCT_GC_CHAIN): NewMikael Djurfeldt1-0/+5
macros. (scm_structs_to_free, scm_struct_prehistory): Declare.
2000-07-26* Fixed struct initialization.Dirk Herrmann1-1/+0
2000-04-18Fixed some SCM/scm_bits_t mixups.Dirk Herrmann1-1/+1
2000-04-17* struct.c, struct.h: Struct data regions (and thus also vtable data regions)Dirk Herrmann1-9/+8
are now C arrays of scm_bits_t elements. * gc.c: Made the mixup of glocs and structs explicit.
2000-04-12The struct data is now an array of scm_bits_t variables.Dirk Herrmann1-1/+1
2000-04-11The struct vtable data is now an array of scm_bits_t variables.Dirk Herrmann1-4/+7
2000-03-22Don't use SCM2PTR for non scheme values.Dirk Herrmann1-1/+1
2000-03-21Don't cast SCM values to pointers.Dirk Herrmann1-2/+2
2000-03-19 * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin1-0/+6
indentation style.
2000-03-12*** empty log message ***Mikael Djurfeldt1-1/+1
2000-03-12* async.c, boolean.h, debug.c, dynl.c, dynwind.c, eval.c, eval.h,Mikael Djurfeldt1-1/+1
feature.h, filesys.h, fluids.h, fports.c, fports.h, gc.c, gc.h, hash.c, keywords.h, macros.c, numbers.c, numbers.h, objects.c, objects.h, options.c, pairs.h, ports.c, ports.h, print.c, procs.h, ramap.c, read.c, smob.c, smob.h, srcprop.h, stacks.c, stacks.h, strports.c, struct.c, struct.h, tag.c, tags.h, throw.c, unif.c, unif.h, variable.h, vectors.h, weaks.c, weaks.h (SCM_SCM, SCM_BITS, SCM_CARBITS): Renamed from SCM_ASSCM, SCM_ASWORD, SCM_CARW).
2000-03-11* objects.h (SCM_CLASS_FLAGS, SCM_OBJ_CLASS_FLAGS,Mikael Djurfeldt1-2/+2
SCM_SET_CLASS_INSTANCE_SIZE), struct.h (SCM_STRUCT_VTABLE_DATA), proc.h (SCM_CLOSCAR): SCM_ASSCM/WORD fixes.
2000-03-02* list.c: Moved append docs to append! Thanks Dirk Hermann. Also,Greg J. Badros1-16/+16
added append docs from R4RS. * strings.c: Docstring typo fix, + eliminate unneeded IMP tests. Thanks Dirk Hermann! * chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR. Thanks Dirk Hermann! * *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout. Drop use of SCM_P for function prototypes... assume an ANSI C compiler. Thanks Dirk Hermann!
1999-12-16* *.h: Use SCM_NIMP(X) && in all the FOOP macros.Greg J. Badros1-1/+4
* *.[ch]: Use do { ... } while (0) idiom in macros that expanded to a bare block.
1999-09-12* __scm.h, backtrace.c, backtrace.h, debug.c, debug.h, dynl-dld.c,Mikael Djurfeldt1-1/+1
dynwind.c, dynwind.h, eval.h, evalext.c, evalext.h, feature.c, feature.h, hashtab.c, hashtab.h, objects.c, objects.h, print.c, procs.c, procs.h, smob.c, smob.h, srcprop.c, strorder.c, struct.c, struct.h: Updated copyrigth notices.
1999-08-30* struct.c, struct.h (scm_struct_free_0, scm_struct_free_light,Mikael Djurfeldt1-5/+5
scm_struct_free_standard, scm_struct_free_entity): Declared to return scm_sizet instead of size_t.
1999-08-29* struct.c, struct.h: Replace 4 procedure slots with one.Mikael Djurfeldt1-3/+3
(scm_struct_i_procedure): Replaces scm_struct_i_procedure.
1999-06-23* struct.c, struct.h:Mikael Djurfeldt1-9/+19
(scm_struct_i_free): New hidden struct slot. Holds destructor for instances to this vtable. (scm_struct_free_0): New destructor: Doesn't deallocate data. (scm_struct_free_light): New destructor: Deallocates a light struct (i.e. a struct without hidden slots). (scm_struct_free_standard): New destructor: Deallocates standard structs. (scm_struct_free_entity): New destructor: Deallocates entity structs. (SCM_SET_VTABLE_DESTRUCTOR): New macro. Changes to hidden slots: (scm_struct_i_size): scm_struct_i_flags now shares space with scm_struct_i_size which holds the size of light structs. (scm_struct_i_n_words): This slot has changed meaning. Previously it included hidden slots. Now it indicates visible slots. (scm_alloc_struct): Clear flags. (SCM_STRUCTF_MASK): 4 new flag positions added => 12 bits. (struct_num, scm_struct_i_tag): Removed. (scm_struct_vtable_tag): Base tag on the pointer to mallocated memory. (scm_struct_ihashq): Base hash value on pointer to struct handle.
1999-03-14* struct.h (SCM_STRUCT_TABLE_NAME, SCM_SET_STRUCT_TABLE_NAME,Mikael Djurfeldt1-0/+11
SCM_STRUCT_TABLE_CLASS, SCM_SET_STRUCT_TABLE_CLASS): New macros. Used for access of struct table entries.
1999-03-11* struct.h (scm_struct_i_setter): New constant.Mikael Djurfeldt1-0/+3
1999-01-05Correction of mistake (should have committed onto a branch...)Mikael Djurfeldt1-2/+0
1999-01-05*** empty log message ***Mikael Djurfeldt1-0/+2
1998-12-16Move the procedure slots of entities to invisible slots (so thatMikael Djurfeldt1-0/+5
we can have operator class objects which themselves are entities). * struct.h (scm_struct_i_proc, scm_struct_i_flags, SCM_STRUCTF_ENTITY): New constants. * struct.c, struct.h (scm_alloc_struct): Renamed from alloc_struct and made global. (scm_struct_init): Renamed from init_struct and made global.
1998-10-19* __scm.h, alist.c, async.c, async.h, backtrace.h, chars.c,Jim Blandy1-1/+1
continuations.c, debug.c, debug.h, dynl-dl.c, dynl.c, dynl.h, dynwind.c, dynwind.h, eq.c, error.c, error.h, eval.c, eval.h, feature.c, filesys.c, filesys.h, fports.c, fports.h, gc.c, gc.h, genio.c, genio.h, gh.h, gh_data.c, gsubr.c, gsubr.h, hash.c, hashtab.c, init.c, init.h, ioext.c, ioext.h, kw.c, libguile.h, list.c, list.h, load.c, load.h, mallocs.c, markers.c, mit-pthreads.c, net_db.c, numbers.c, numbers.h, options.c, ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c, procprop.h, procs.c, procs.h, ramap.c, ramap.h, regex-posix.c, regex-posix.h, root.c, root.h, scmsigs.c, scmsigs.h, script.c, script.h, simpos.c, simpos.h, smob.c, smob.h, snarf.h, socket.c, srcprop.c, stackchk.c, stackchk.h, stacks.c, stime.c, stime.h, strings.c, strings.h, strports.c, struct.c, struct.h, symbols.c, symbols.h, tags.h, threads.c, throw.h, unif.c, variable.c, vectors.c, vectors.h, version.h, vports.c, weaks.c: Update copyright years.
1997-10-031997-10-03 Mikael Djurfeldt <mdj@nada.kth.se>Mikael Djurfeldt1-9/+11
* print.h (SCM_PRINT_STATE_P): Removed SCM_NIMP test. (NIMP macros should by convention not test for NIMPness.) (SCM_COERCE_OPORT): Adjust indentation. * print.c (scm_valid_oport_value_p): Adjusted indentation; Added SCM_NIMP test before SCM_PRINT_STATE_P. * struct.c, struct.h, gc.c: Renamed: scm_struct_i_layout --> scm_vtable_index_layout scm_struct_i_vcell --> scm_vtable_index_vcell scm_struct_i_vtable --> scm_vtable_index_vtable scm_struct_i_printer --> scm_vtable_index_printer scm_struct_i_vtable_offset --> scm_vtable_offset_user * struct.c (scm_print_struct): Use new printer slot; Default printing: Also output hex code of vtable so that type identity will be indicated as well. (scm_init_struct): Updated required_vtable_fields to "pruosrpw"; Removed struct_printer_var; Removed struct-vtable-offset; (vtable-index-layout, vtable-index-vtable, vtable-index-printer, vtable-offset-user): New constants. * struct.h (scm_struct_i_vtable_offset): Bumped from 3 to 4. (scm_struct_i_printer, SCM_STRUCT_PRINTER): New slot in vtables. If this slot contains a procedure, use that to print structures of the type represented by this vtable. * print.c (scm_iprin1): Don't print arguments of macro transformers. (They are always: exp env.); Bugfix: Unmemoize transformer source with correct environment.