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


Ignore:
Timestamp:
Oct 10, 2008, 4:27:38 AM (17 years ago)
Author:
bird
Message:

kmk: More length and alloc optimizations. Made all the length optimizations from yesterday CONFIG_WITH_VALUE_LENGTH instead of KMK.

File:
1 edited

Legend:

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

    r1807 r1809  
    418418    if (!fstat (fileno (ebuf.fp), &st))
    419419      {
    420         unsigned int stream_buf_size = 256*1024;
     420        int stream_buf_size = 256*1024;
    421421        if (st.st_size < stream_buf_size)
    422           stream_buf_size = (st.st_size + 0xfff) & ~0xfffU;
     422          stream_buf_size = (st.st_size + 0xfff) & ~0xfff;
    423423        stream_buf = xmalloc (stream_buf_size);
    424424        setvbuf (ebuf.fp, stream_buf, _IOFBF, stream_buf_size);
     
    28032803{
    28042804  char *eol;
    2805 #ifdef KMK
     2805#ifdef CONFIG_WITH_VALUE_LENGTH
    28062806  char *end;
    28072807#endif
     
    28152815
    28162816  eol = ebuf->buffer = ebuf->bufnext;
    2817 #ifdef KMK
     2817#ifdef CONFIG_WITH_VALUE_LENGTH
    28182818  end = ebuf->bufstart + ebuf->size;
    28192819#endif
     
    28262826
    28272827      /* Find the next newline.  At EOS, stop.  */
    2828 #ifndef KMK
     2828#ifndef CONFIG_WITH_VALUE_LENGTH
    28292829      eol = p = strchr (eol , '\n');
    28302830#else
Note: See TracChangeset for help on using the changeset viewer.