summaryrefslogtreecommitdiffstats
path: root/record.c
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:25 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:25 -0800
commitdb04688faa20f3576257c0fe41752ec435beab9a (patch)
tree6d638c2e1f65afd5f49d20b2d22ce35bd74705ff /record.c
parent1edcb9b62a1a520eddae8403c19d841c9b18737f (diff)
downloadscm-db04688faa20f3576257c0fe41752ec435beab9a.tar.gz
scm-db04688faa20f3576257c0fe41752ec435beab9a.zip
Import Upstream version 5c3upstream/5c3
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);