mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Rework test-smob-mark to use off-heap allocations
* test-suite/standalone/test-smob-mark.c (make_x): Use scm_malloc. (free_x): Use normal free.
This commit is contained in:
parent
befac2cf85
commit
68839e0789
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 2013-2014,2018
|
/* Copyright 2013-2014,2018,2025
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Guile.
|
This file is part of Guile.
|
||||||
|
@ -56,7 +56,7 @@ make_x ()
|
||||||
x_t *c_x;
|
x_t *c_x;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
c_x = (x_t *) scm_gc_malloc (sizeof (x_t), "x");
|
c_x = (x_t *) scm_malloc (sizeof (x_t));
|
||||||
c_x->scm_value = scm_from_int (i);
|
c_x->scm_value = scm_from_int (i);
|
||||||
c_x->c_value = i;
|
c_x->c_value = i;
|
||||||
SCM_NEWSMOB (s_x, x_tag, c_x);
|
SCM_NEWSMOB (s_x, x_tag, c_x);
|
||||||
|
@ -78,7 +78,7 @@ free_x (SCM x)
|
||||||
{
|
{
|
||||||
x_t *c_x;
|
x_t *c_x;
|
||||||
c_x = (x_t *) SCM_SMOB_DATA (x);
|
c_x = (x_t *) SCM_SMOB_DATA (x);
|
||||||
scm_gc_free (c_x, sizeof (x_t), "x");
|
free (c_x);
|
||||||
c_x = NULL;
|
c_x = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue