mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
* libguile/deprecated.c (scm_mtrigger, scm_mallocated, scm_max_segment_size): New global variables, from gc.c. (scm_map_free_list, scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New stubs. * libguile/deprecated.h (scm_mallocated, scm_mtrigger, scm_max_segment_size): New declarations. (scm_map_free_list, scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New declarations. * libguile/gc-malloc.c (scm_i_minyield_malloc): Remove. (scm_gc_init_malloc): Remove references to `scm_i_minyield_malloc' and `scm_mtrigger'. * libguile/gc.c (scm_mtrigger, scm_mallocated): Remove. (scm_init_storage): Remove reference to `SCM_HEAP_SEG_SIZE'. * libguile/gc.h (scm_max_segment_size, SCM_SET_FREELIST_LOC, SCM_FREELIST_LOC, scm_i_master_freelist, scm_i_master_freelist2, scm_mallocated, scm_mtrigger): Remove. (scm_map_free_list, scm_gc_set_debug_check_freelist_x)[SCM_ENABLE_DEPRECATED && GUILE_DEBUG_FREELIST]: Remove. * libguile/private-gc.h (SCM_DEFAULT_INIT_HEAP_SIZE_1, SCM_DEFAULT_MIN_YIELD_1, SCM_DEFAULT_MIN_YIELD_2, DEFAULT_SWEEP_AMOUNT, SCM_DEFAULT_MAX_SEGMENT_SIZE, SCM_MIN_HEAP_SEG_SIZE, SCM_HEAP_SEG_SIZE, SCM_GC_CARD_BVEC_SIZE_IN_LONGS, SCM_GC_IN_CARD_HEADERP): Remove. (scm_getenv_int): Made internal. (scm_i_marking, scm_mark_all, scm_i_deprecated_memory_return, scm_i_find_heap_calls, scm_gc_init_malloc, scm_gc_init_freelist, scm_gc_init_segments, scm_gc_init_mark): Remove declarations. * libguile/gc-segment-table.c: Remove, finally.
66 lines
2.3 KiB
C
66 lines
2.3 KiB
C
/*
|
|
* private-gc.h - private declarations for garbage collection.
|
|
*
|
|
* Copyright (C) 2002, 03, 04, 05, 06, 07, 08, 09 Free Software Foundation, Inc.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
* as published by the Free Software Foundation; either version 3 of
|
|
* the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
* 02110-1301 USA
|
|
*/
|
|
|
|
#ifndef SCM_PRIVATE_GC
|
|
#define SCM_PRIVATE_GC
|
|
|
|
#include "_scm.h"
|
|
|
|
/* {heap tuning parameters}
|
|
*
|
|
* These are parameters for controlling memory allocation. The heap
|
|
* is the area out of which scm_cons, and object headers are allocated.
|
|
*
|
|
* Each heap cell is 8 bytes on a 32 bit machine and 16 bytes on a
|
|
* 64 bit machine. The units of the _SIZE parameters are bytes.
|
|
* Cons pairs and object headers occupy one heap cell.
|
|
*/
|
|
|
|
|
|
#define SCM_DEFAULT_INIT_HEAP_SIZE_2 32*1024
|
|
|
|
#define SCM_DOUBLECELL_ALIGNED_P(x) (((2 * sizeof (scm_t_cell) - 1) & SCM_UNPACK (x)) == 0)
|
|
|
|
|
|
SCM_INTERNAL int scm_getenv_int (const char *var, int def);
|
|
|
|
|
|
typedef enum { return_on_error, abort_on_error } policy_on_error;
|
|
|
|
|
|
#define SCM_MAX(A, B) ((A) > (B) ? (A) : (B))
|
|
#define SCM_MIN(A, B) ((A) < (B) ? (A) : (B))
|
|
|
|
/* CELL_P checks a random word whether it has the right form for a
|
|
pointer to a cell. Use scm_i_find_heap_segment_containing_object
|
|
to find out whether it actually points to a real cell.
|
|
|
|
The right form for a cell pointer is this: the low three bits must
|
|
be scm_tc3_cons, and when the scm_tc3_cons tag is stripped, the
|
|
resulting pointer must be correctly aligned.
|
|
scm_i_initialize_heap_segment_data guarantees that the test below
|
|
works.
|
|
*/
|
|
#define CELL_P(x) ((SCM_UNPACK(x) & (sizeof(scm_t_cell)-1)) == scm_tc3_cons)
|
|
|
|
SCM_INTERNAL char const *scm_i_tag_name (scm_t_bits tag); /* MOVEME */
|
|
|
|
#endif
|