VirtualBox

Changeset 1865 in kBuild for trunk/src


Ignore:
Timestamp:
Oct 15, 2008 1:08:24 AM (17 years ago)
Author:
bird
Message:

kmk/incdep: don't allocate nameseq records, there will be a whole lot of them.

File:
1 edited

Legend:

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

    r1863 r1865  
    126126
    127127    /* the parameters */
    128     struct nameseq *filenames;      /* One only, its name is a strcache entry. */
     128    struct incdep_strcache_entry *filename_entry; /* Converted to a nameseq record. */
    129129    const char *pattern;            /* NULL */
    130130    const char *pattern_percent;    /* NULL */
     
    800800        void *free_me = rec_f;
    801801        struct dep *dep;
     802        struct nameseq *filenames;
    802803
    803804        for (dep = rec_f->deps; dep; dep = dep->next)
    804805          dep->name = incdep_flush_strcache_entry (dep->name);
    805         rec_f->filenames->name = incdep_flush_strcache_entry (rec_f->filenames->name);
    806 
    807         record_files (rec_f->filenames,
     806
     807        filenames = (struct nameseq *) alloccache_alloc (&nameseq_cache);
     808        filenames->next = 0;
     809        filenames->name = incdep_flush_strcache_entry (rec_f->filename_entry);
     810
     811        record_files (filenames,
    808812                      rec_f->pattern,
    809813                      rec_f->pattern_percent,
     
    951955static void
    952956incdep_record_files (struct incdep *cur,
    953                      struct nameseq *filenames, const char *pattern,
     957                     const char *filename, const char *pattern,
    954958                     const char *pattern_percent, struct dep *deps,
    955959                     unsigned int cmds_started, char *commands,
     
    958962{
    959963  if (cur->worker_tid == -1)
    960     record_files (filenames, pattern, pattern_percent, deps, cmds_started,
    961                   commands, commands_idx, two_colon, flocp);
     964    {
     965      struct nameseq *filenames = (struct nameseq *) alloccache_alloc (&nameseq_cache);
     966      filenames->next = 0;
     967      filenames->name = filename;
     968      record_files (filenames, pattern, pattern_percent, deps, cmds_started,
     969                    commands, commands_idx, two_colon, flocp);
     970    }
    962971#ifdef PARSE_IN_WORKER
    963972  else
     
    965974      struct incdep_recorded_files *rec = incdep_xmalloc (cur, sizeof (*rec));
    966975
    967       rec->filenames = filenames;
     976      rec->filename_entry = (struct incdep_strcache_entry *)filename;
    968977      rec->pattern = pattern;
    969978      rec->pattern_percent = pattern_percent;
     
    13311340              /* file: dependencies */
    13321341
    1333               struct nameseq *filenames = 0;
     1342              const char *filename;
    13341343              struct dep *deps = 0;
    13351344              struct dep **nextdep = &deps;
     
    13521361                  break;
    13531362                }
    1354               filenames = incdep_alloc_nameseq (curdep);
    1355               memset (filenames, 0, sizeof (*filenames));
    1356               filenames->name = incdep_record_strcache (curdep, cur, endp - cur);
     1363              filename = incdep_record_strcache (curdep, cur, endp - cur);
    13571364
    13581365              /* parse any dependencies. */
     
    14021409              /* enter the file with its dependencies. */
    14031410              incdep_record_files (curdep,
    1404                                    filenames, NULL, NULL, deps, 0, NULL, 0, 0, f);
     1411                                   filename, NULL, NULL, deps, 0, NULL, 0, 0, f);
    14051412            }
    14061413        }
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