Ignore:
Timestamp:
Oct 11, 2008, 12:56:20 PM (17 years ago)
Author:
bird
Message:

kmk: more insane optimizations.

File:
1 edited

Legend:

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

    r1827 r1830  
    4545#define VARIABLE_BUFFER_ZONE    5
    4646
     47#ifndef KMK
    4748static unsigned int variable_buffer_length;
     49#else
     50unsigned int variable_buffer_length;
     51#endif
    4852char *variable_buffer;
    4953
     54#ifndef KMK
    5055/* Subroutine of variable_expand and friends:
    5156   The text to add is LENGTH chars starting at STRING to the variable_buffer.
     
    6368    {
    6469      unsigned int offset = ptr - variable_buffer;
    65 #ifdef KMK
    66       variable_buffer_length = variable_buffer_length <= 1024
    67                              ? 2048 : variable_buffer_length * 4;
    68       if (variable_buffer_length < newlen + 100)
    69           variable_buffer_length = (newlen + 100 + 1023) & ~1023U;
    70 #else
    7170      variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
    7271                               ? newlen + 100
    7372                               : 2 * variable_buffer_length);
    74 #endif
    7573      variable_buffer = xrealloc (variable_buffer, variable_buffer_length);
    7674      ptr = variable_buffer + offset;
     
    8078  return ptr + length;
    8179}
     80#endif
    8281
    8382/* Return a pointer to the beginning of the variable buffer.  */
Note: See TracChangeset for help on using the changeset viewer.