/[ascend]/trunk/base/generic/compiler/logrelation.c
ViewVC logotype

Diff of /trunk/base/generic/compiler/logrelation.c

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

revision 708 by johnpye, Wed Jun 21 07:00:45 2006 UTC revision 709 by johnpye, Wed Jun 28 16:28:57 2006 UTC
# Line 155  void InitLogRelInstantiator(void) { Line 155  void InitLogRelInstantiator(void) {
155                "ERROR: InitLogRelInstantiator unable to allocate pool.\n");                "ERROR: InitLogRelInstantiator unable to allocate pool.\n");
156    }    }
157    g_logterm_ptrs.buf = (struct logrel_term **)    g_logterm_ptrs.buf = (struct logrel_term **)
158      asccalloc(TPBUF_LOGINITSIZE,sizeof(union LogRelTermUnion *));      ASC_NEW_ARRAY_CLEAR(union LogRelTermUnion *,TPBUF_LOGINITSIZE);
159    if (g_logterm_ptrs.buf == NULL) {    if (g_logterm_ptrs.buf == NULL) {
160      Asc_Panic(2, "InitLogRelInstantiator",      Asc_Panic(2, "InitLogRelInstantiator",
161                "ERROR: InitLogRelInstantiator unable to allocate memory.\n");                "ERROR: InitLogRelInstantiator unable to allocate memory.\n");
# Line 163  void InitLogRelInstantiator(void) { Line 163  void InitLogRelInstantiator(void) {
163    g_logterm_ptrs.len = 0;    g_logterm_ptrs.len = 0;
164    g_logterm_ptrs.cap = TPBUF_LOGINITSIZE;    g_logterm_ptrs.cap = TPBUF_LOGINITSIZE;
165    g_logterm_ptrs.termstackcap = 200;    g_logterm_ptrs.termstackcap = 200;
166    g_logterm_ptrs.termstack =    g_logterm_ptrs.termstack = ASC_NEW_ARRAY(unsigned long,200);
     (unsigned long *)ascmalloc((sizeof(unsigned long)*200));  
167    if (g_logterm_ptrs.termstack == NULL) {    if (g_logterm_ptrs.termstack == NULL) {
168      Asc_Panic(2, "InitLogRelInstantiator",      Asc_Panic(2, "InitLogRelInstantiator",
169                "ERROR: InitLogRelInstantiator unable to allocate memory.\n");                "ERROR: InitLogRelInstantiator unable to allocate memory.\n");
# Line 277  static int ConvertLogTermBuf(struct logr Line 276  static int ConvertLogTermBuf(struct logr
276    realloc_term_stack(0);    realloc_term_stack(0);
277    len = g_logterm_ptrs.len;    len = g_logterm_ptrs.len;
278    if (len < 1) return 0;    if (len < 1) return 0;
279    arr = (union LogRelTermUnion *)    arr = ASC_NEW(union LogRelTermUnion);
     ascmalloc(len*sizeof(union LogRelTermUnion));  
280    if (arr==NULL) {    if (arr==NULL) {
281      FPRINTF(ASCERR,"Create Logical Relation: Insufficient memory :-(.\n");      FPRINTF(ASCERR,"Create Logical Relation: Insufficient memory :-(.\n");
282      return 0;      return 0;
# Line 400  static struct logrel_term *CreateSatisfi Line 398  static struct logrel_term *CreateSatisfi
398  struct logrelation *CreateLogRelStructure(enum Expr_enum t)  struct logrelation *CreateLogRelStructure(enum Expr_enum t)
399  {  {
400    struct logrelation *result;    struct logrelation *result;
401    result = (struct logrelation *)ascmalloc(sizeof(struct logrelation));    result = ASC_NEW(struct logrelation);
402    assert(result!=NULL);    assert(result!=NULL);
403    memset((char *)&(result->token),0,sizeof(struct TokenLogRel));    memset((char *)&(result->token),0,sizeof(struct TokenLogRel));
404    result->logresidual = 0;    result->logresidual = 0;
# Line 1428  static union LogRelTermUnion Line 1426  static union LogRelTermUnion
1426    long int delta;    long int delta;
1427    
1428    if (!old || !len) return NULL;    if (!old || !len) return NULL;
1429    arr = (union LogRelTermUnion *)    arr = ASC_NEW_ARRAY(union LogRelTermUnion,len);
     ascmalloc(len*sizeof(union LogRelTermUnion));  
1430    if (arr==NULL) {    if (arr==NULL) {
1431      FPRINTF(ASCERR,"Copy Logical Relation: Insufficient memory :-(.\n");      FPRINTF(ASCERR,"Copy Logical Relation: Insufficient memory :-(.\n");
1432      return NULL;      return NULL;

Legend:
Removed from v.708  
changed lines
  Added in v.709

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22