VirtualBox

Changeset 1499 in kBuild


Ignore:
Timestamp:
Apr 7, 2008 11:02:57 PM (17 years ago)
Author:
bird
Message:

buffer the entire makefile / 256KB. saves a little bit of time on the mac at least...

File:
1 edited

Legend:

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

    r1477 r1499  
    419419                          f_append, 0);
    420420
     421#ifdef KMK
     422  /* Buffer the entire file or at least 256KB (footer.kmk) of it. */
     423  {
     424    void *stream_buf = NULL;
     425    struct stat st;
     426    if (!fstat (fileno (ebuf.fp), &st))
     427      {
     428        unsigned int stream_buf_size = 256*1024;
     429        if (st.st_size < stream_buf_size)
     430          stream_buf_size = (st.st_size + 0xfff) & ~0xfffU;
     431        stream_buf = xmalloc (stream_buf_size);
     432        setvbuf (ebuf.fp, stream_buf, _IOFBF, stream_buf_size);
     433      }
     434#endif
     435
    421436  /* Evaluate the makefile */
    422437
     
    433448  fclose (ebuf.fp);
    434449
     450#ifdef KMK
     451   if (stream_buf)
     452     free (stream_buf);
     453  }
     454#endif
    435455  free (ebuf.bufstart);
    436456  alloca (0);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette