476 |
static size_t |
static size_t |
477 |
environment_free (SCM env) |
environment_free (SCM env) |
478 |
{ |
{ |
479 |
return (*(SCM_ENVIRONMENT_FUNCS (env)->free)) (env); |
(*(SCM_ENVIRONMENT_FUNCS (env)->free)) (env); |
480 |
|
return 0; |
481 |
} |
} |
482 |
|
|
483 |
|
|
985 |
} |
} |
986 |
|
|
987 |
|
|
988 |
static size_t |
static void |
989 |
leaf_environment_free (SCM env) |
leaf_environment_free (SCM env) |
990 |
{ |
{ |
991 |
core_environments_finalize (env); |
core_environments_finalize (env); |
992 |
|
scm_gc_free (LEAF_ENVIRONMENT (env), sizeof (struct leaf_environment), |
993 |
free (LEAF_ENVIRONMENT (env)); |
"leaf environment"); |
|
return sizeof (struct leaf_environment); |
|
994 |
} |
} |
995 |
|
|
996 |
|
|
1034 |
#define FUNC_NAME s_scm_make_leaf_environment |
#define FUNC_NAME s_scm_make_leaf_environment |
1035 |
{ |
{ |
1036 |
size_t size = sizeof (struct leaf_environment); |
size_t size = sizeof (struct leaf_environment); |
1037 |
struct leaf_environment *body = scm_must_malloc (size, FUNC_NAME); |
struct leaf_environment *body = scm_gc_malloc (size, "leaf environment"); |
1038 |
SCM env; |
SCM env; |
1039 |
|
|
1040 |
core_environments_preinit (&body->base); |
core_environments_preinit (&body->base); |
1345 |
} |
} |
1346 |
|
|
1347 |
|
|
1348 |
static size_t |
static void |
1349 |
eval_environment_free (SCM env) |
eval_environment_free (SCM env) |
1350 |
{ |
{ |
1351 |
core_environments_finalize (env); |
core_environments_finalize (env); |
1352 |
|
scm_gc_free (EVAL_ENVIRONMENT (env), sizeof (struct eval_environment), |
1353 |
free (EVAL_ENVIRONMENT (env)); |
"eval environment"); |
|
return sizeof (struct eval_environment); |
|
1354 |
} |
} |
1355 |
|
|
1356 |
|
|
1427 |
SCM_ASSERT (SCM_ENVIRONMENT_P (local), local, SCM_ARG1, FUNC_NAME); |
SCM_ASSERT (SCM_ENVIRONMENT_P (local), local, SCM_ARG1, FUNC_NAME); |
1428 |
SCM_ASSERT (SCM_ENVIRONMENT_P (imported), imported, SCM_ARG2, FUNC_NAME); |
SCM_ASSERT (SCM_ENVIRONMENT_P (imported), imported, SCM_ARG2, FUNC_NAME); |
1429 |
|
|
1430 |
body = scm_must_malloc (sizeof (struct eval_environment), FUNC_NAME); |
body = scm_gc_malloc (sizeof (struct eval_environment), "eval environment"); |
1431 |
|
|
1432 |
core_environments_preinit (&body->base); |
core_environments_preinit (&body->base); |
1433 |
body->obarray = SCM_BOOL_F; |
body->obarray = SCM_BOOL_F; |
1763 |
} |
} |
1764 |
|
|
1765 |
|
|
1766 |
static size_t |
static void |
1767 |
import_environment_free (SCM env) |
import_environment_free (SCM env) |
1768 |
{ |
{ |
1769 |
core_environments_finalize (env); |
core_environments_finalize (env); |
1770 |
|
scm_gc_free (IMPORT_ENVIRONMENT (env), sizeof (struct import_environment), |
1771 |
free (IMPORT_ENVIRONMENT (env)); |
"import environment"); |
|
return sizeof (struct import_environment); |
|
1772 |
} |
} |
1773 |
|
|
1774 |
|
|
1842 |
#define FUNC_NAME s_scm_make_import_environment |
#define FUNC_NAME s_scm_make_import_environment |
1843 |
{ |
{ |
1844 |
size_t size = sizeof (struct import_environment); |
size_t size = sizeof (struct import_environment); |
1845 |
struct import_environment *body = scm_must_malloc (size, FUNC_NAME); |
struct import_environment *body = scm_gc_malloc (size, "import environment"); |
1846 |
SCM env; |
SCM env; |
1847 |
|
|
1848 |
core_environments_preinit (&body->base); |
core_environments_preinit (&body->base); |
2068 |
} |
} |
2069 |
|
|
2070 |
|
|
2071 |
static size_t |
static void |
2072 |
export_environment_free (SCM env) |
export_environment_free (SCM env) |
2073 |
{ |
{ |
2074 |
core_environments_finalize (env); |
core_environments_finalize (env); |
2075 |
|
scm_gc_free (EXPORT_ENVIRONMENT (env), sizeof (struct export_environment), |
2076 |
free (EXPORT_ENVIRONMENT (env)); |
"export environment"); |
|
return sizeof (struct export_environment); |
|
2077 |
} |
} |
2078 |
|
|
2079 |
|
|
2168 |
SCM_ASSERT (SCM_ENVIRONMENT_P (private), private, SCM_ARG1, FUNC_NAME); |
SCM_ASSERT (SCM_ENVIRONMENT_P (private), private, SCM_ARG1, FUNC_NAME); |
2169 |
|
|
2170 |
size = sizeof (struct export_environment); |
size = sizeof (struct export_environment); |
2171 |
body = scm_must_malloc (size, FUNC_NAME); |
body = scm_gc_malloc (size, "export environment"); |
2172 |
|
|
2173 |
core_environments_preinit (&body->base); |
core_environments_preinit (&body->base); |
2174 |
body->private = SCM_BOOL_F; |
body->private = SCM_BOOL_F; |