summaryrefslogtreecommitdiffstats
path: root/record.c
diff options
context:
space:
mode:
Diffstat (limited to 'record.c')
-rw-r--r--record.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/record.c b/record.c
index 126a1fc..7724889 100644
--- a/record.c
+++ b/record.c
@@ -174,9 +174,8 @@ SCM rec_constr1(args)
SCM rec, inds = (((rec_cclo *)CDR(cclo))->constr.indices);
sizet i = INUM(((rec_cclo *)CDR(cclo))->constr.recsize);
args = CDR(args);
- NEWCELL(rec);
DEFER_INTS;
- SETCHARS(rec, must_malloc((i+1L)*sizeof(SCM), s_record));
+ rec = must_malloc_cell((i+1L)*sizeof(SCM), s_record);
SETNUMDIGS(rec, i+1L, tc16_record);
ALLOW_INTS;
while (i--)
@@ -272,7 +271,7 @@ static SCM markrec(ptr)
static sizet freerec(ptr)
CELLPTR ptr;
{
- must_free(CHARS(ptr));
+ must_free(CHARS(ptr), sizeof(SCM)*NUMDIGS(ptr));
return sizeof(SCM)*NUMDIGS(ptr);
}
static int recprin1(exp, port, writing)
@@ -332,9 +331,10 @@ void init_record()
SCM i_name = CAR(intern(s_name, (sizeof s_name)-1));
SCM i_fields = CAR(intern(s_fields, (sizeof s_fields)-1));
tc16_record = newsmob(&recsmob);
- NEWCELL(the_rtd_rtd);
- SETCHARS(the_rtd_rtd, must_malloc((long)sizeof(rtd_type), s_record));
+ DEFER_INTS;
+ the_rtd_rtd = must_malloc_cell((long)sizeof(rtd_type), s_record);
SETNUMDIGS(the_rtd_rtd, (long)sizeof(rtd_type)/sizeof(SCM), tc16_record);
+ ALLOW_INTS;
REC_RTD(the_rtd_rtd) = the_rtd_rtd;
RTD_NAME(the_rtd_rtd) = makfromstr(s_record, (sizeof s_record)-1);
RTD_FIELDS(the_rtd_rtd) = cons2(i_name, i_fields, EOL);