diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:25 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:25 -0800 |
commit | db04688faa20f3576257c0fe41752ec435beab9a (patch) | |
tree | 6d638c2e1f65afd5f49d20b2d22ce35bd74705ff /record.c | |
parent | 1edcb9b62a1a520eddae8403c19d841c9b18737f (diff) | |
download | scm-db04688faa20f3576257c0fe41752ec435beab9a.tar.gz scm-db04688faa20f3576257c0fe41752ec435beab9a.zip |
Import Upstream version 5c3upstream/5c3
Diffstat (limited to 'record.c')
-rw-r--r-- | record.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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); |