Changeset 1931 for trunk/src/kmk/read.c


Ignore:
Timestamp:
Oct 24, 2008, 9:02:48 PM (17 years ago)
Author:
bird
Message:

kmk: recycle more allocate_variable_expand_* results.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/read.c

    r1930 r1931  
    905905                  cp = ap = allocated_variable_expand (p2);
    906906#else
    907                   cp = ap = allocated_variable_expand_2 (p2, eol - p2, NULL);
     907                  unsigned int buf_len;
     908                  cp = ap = allocated_variable_expand_3 (p2, eol - p2, NULL, &buf_len);
    908909#endif
    909910
     
    917918                    }
    918919
     920#ifndef CONFIG_WITH_VALUE_LENGTH
    919921                  free (ap);
     922#else
     923                  recycle_variable_buffer (ap, buf_len);
     924#endif
    920925                }
    921926            }
     
    939944              cp = ap = allocated_variable_expand (p2);
    940945#else
    941               cp = ap = allocated_variable_expand_2 (p2, eol - p2, NULL);
     946              unsigned int buf_len;
     947              cp = ap = allocated_variable_expand_3 (p2, eol - p2, NULL, &buf_len);
    942948#endif
    943949
     
    952958                }
    953959
     960#ifndef CONFIG_WITH_VALUE_LENGTH
    954961              free (ap);
     962#else
     963              recycle_variable_buffer (ap, buf_len);
     964#endif
    955965            }
    956966          goto rule_complete;
     
    9951005                            ? incdep_queue : incdep_flush;
    9961006          char *free_me = NULL;
     1007          unsigned int buf_len;
    9971008          char *name = p2;
    9981009
     
    10001011            {
    10011012              unsigned int name_len;
    1002               free_me = name = allocated_variable_expand_2 (name, eol - name, &name_len);
     1013              free_me = name = allocated_variable_expand_3 (name, eol - name, &name_len, &buf_len);
    10031014              eol = name + name_len;
    10041015              while (isspace ((unsigned char)*name))
     
    10131024
    10141025          if (free_me)
    1015             free (free_me);
     1026            recycle_variable_buffer (free_me, buf_len);
    10161027          goto rule_complete;
    10171028        }
     
    10321043          p = allocated_variable_expand (p2);
    10331044#else
    1034           p = allocated_variable_expand_2 (p2, eol - p2, NULL);
     1045          unsigned int buf_len;
     1046          p = allocated_variable_expand_3 (p2, eol - p2, NULL, &buf_len);
    10351047#endif
    10361048
     
    10381050          if (*p == '\0')
    10391051            {
     1052#ifndef CONFIG_WITH_VALUE_LENGTH
    10401053              free (p);
     1054#else
     1055              recycle_variable_buffer (p, buf_len);
     1056#endif
    10411057              continue;
    10421058            }
     
    10531069                              &nameseq_cache);
    10541070#endif
     1071#ifndef CONFIG_WITH_VALUE_LENGTH
    10551072          free (p);
     1073#else
     1074          recycle_variable_buffer (p, buf_len);
     1075#endif
    10561076
    10571077          /* Save the state of conditionals and start
Note: See TracChangeset for help on using the changeset viewer.