Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/runtime/c-libs/smlnj-ccalls/c-calls.c
ViewVC logotype

Diff of /sml/trunk/src/runtime/c-libs/smlnj-ccalls/c-calls.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3, Sat Oct 4 23:33:46 1997 UTC revision 8, Sun Jan 18 01:01:29 1998 UTC
# Line 121  Line 121 
121  {  {
122      char *p;      char *p;
123    
124      if ((p = (char *) malloc(strlen(s)+1)) == NULL)      if ((p = (char *) MALLOC(strlen(s)+1)) == NULL)
125          Die("couldn't make string copy during C call\n");          Die("couldn't make string copy during C call\n");
126      return strcpy(p,s);      return strcpy(p,s);
127  }  }
# Line 132  Line 132 
132    
133      if (align < sizeof(Word_t))      if (align < sizeof(Word_t))
134          align = sizeof(Word_t);          align = sizeof(Word_t);
135      if ((p = (Word_t *)malloc(n)) == NULL)      if ((p = (Word_t *)MALLOC(n)) == NULL)
136          Die("couldn't alloc memory for C call\n");          Die("couldn't alloc memory for C call\n");
137    
138      ASSERT(((Word_t)p & (Word_t)(align-1)) != 0);      ASSERT(((Word_t)p & (Word_t)(align-1)) != 0);
# Line 224  Line 224 
224      p = ptrlist;      p = ptrlist;
225      while (p != NULL) {      while (p != NULL) {
226          ptrlist = ptrlist->next;          ptrlist = ptrlist->next;
227          free(p->ptr);               /* the block */          FREE(p->ptr);               /* the block */
228          free(p);                    /* the block's descriptor */          FREE(p);                    /* the block's descriptor */
229          p = ptrlist;          p = ptrlist;
230      }      }
231  }  }
# Line 248  Line 248 
248          ptrlist = p->next;          ptrlist = p->next;
249          v = MK_CADDR(msp,p->ptr);          v = MK_CADDR(msp,p->ptr);
250          LIST_cons(msp, lp, v, lp);          LIST_cons(msp, lp, v, lp);
251          free(p);          FREE(p);
252          p = ptrlist;          p = ptrlist;
253      }      }
254  #ifdef DEBUG_C_CALLS  #ifdef DEBUG_C_CALLS
# Line 533  Line 533 
533  PVT ml_val_t RaiseError(ml_state_t *msp,int err)  PVT ml_val_t RaiseError(ml_state_t *msp,int err)
534  {  {
535      sprintf(errbuf,"SML/NJ-C-Interface: %s",errtbl[err]);      sprintf(errbuf,"SML/NJ-C-Interface: %s",errtbl[err]);
536      return RaiseSysError(msp,errbuf);      return RAISE_ERROR(msp, errbuf);
537  }  }
538    
539    
# Line 1067  Line 1067 
1067      ml_val_t ret;      ml_val_t ret;
1068    
1069      ret = datumCtoML(msp,type,(Word_t) caddr,&arg);      ret = datumCtoML(msp,type,(Word_t) caddr,&arg);
1070      free(type);      FREE(type);
1071      return ret;      return ret;
1072  }  }
1073    

Legend:
Removed from v.3  
changed lines
  Added in v.8

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0