mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
* numbers.c (scm_make_complex), gc-card.c (scm_i_sweep_card): Use
sizeof (scm_t_complex) to determine the memory size of the malloc'd area for complex numbers.
This commit is contained in:
parent
47ae1f0eca
commit
29c4382afd
3 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2003-09-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* numbers.c (scm_make_complex), gc-card.c (scm_i_sweep_card): Use
|
||||
sizeof (scm_t_complex) to determine the memory size of the
|
||||
malloc'd area for complex numbers.
|
||||
|
||||
2003-09-17 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* numbers.c (scm_bigequal): Fixed.
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "libguile/_scm.h"
|
||||
#include "libguile/eval.h"
|
||||
#include "libguile/numbers.h"
|
||||
#include "libguile/stime.h"
|
||||
#include "libguile/stackchk.h"
|
||||
#include "libguile/struct.h"
|
||||
|
@ -238,7 +239,7 @@ scm_i_sweep_card (scm_t_cell * p, SCM *free_list, scm_t_heap_segment*seg)
|
|||
/* nothing else to do here since the mpz is in a double cell */
|
||||
break;
|
||||
case scm_tc16_complex:
|
||||
scm_gc_free (SCM_COMPLEX_MEM (scmptr), 2*sizeof (double),
|
||||
scm_gc_free (SCM_COMPLEX_MEM (scmptr), sizeof (scm_t_complex),
|
||||
"complex");
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -2510,7 +2510,7 @@ scm_make_complex (double x, double y)
|
|||
else
|
||||
{
|
||||
SCM z;
|
||||
SCM_NEWSMOB (z, scm_tc16_complex, scm_gc_malloc (2*sizeof (double),
|
||||
SCM_NEWSMOB (z, scm_tc16_complex, scm_gc_malloc (sizeof (scm_t_complex),
|
||||
"complex"));
|
||||
SCM_COMPLEX_REAL (z) = x;
|
||||
SCM_COMPLEX_IMAG (z) = y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue