Ignore:
Timestamp:
Oct 24, 2008, 10:22:22 PM (17 years ago)
Author:
bird
Message:

kmk: Made struct variable capable of holding read only variables to speed up set_file_variables.

File:
1 edited

Legend:

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

    r1924 r1932  
    572572        unsigned int value_len;
    573573        char *pszExpanded = allocated_variable_expand_2(pVar->value, pVar->value_length, &value_len);
    574         free(pVar->value);
     574#ifdef CONFIG_WITH_RDONLY_VARIABLE_VALUE
     575        if (pVar->rdonly_val)
     576            pVar->rdonly_val = 0;
     577        else
     578#endif
     579            free(pVar->value);
     580        assert (pVar->origin != o_automatic);
    575581        pVar->value = pszExpanded;
    576582        pVar->value_length = value_len;
     
    643649    struct variable *pVar = kbuild_lookup_variable_n(pszName, cchName);
    644650    if (pVar && pDefPath)
     651    {
     652        assert(pVar->origin != o_automatic);
     653#ifdef CONFIG_WITH_RDONLY_VARIABLE_VALUE
     654        assert(!pVar->rdonly_val);
     655#endif
    645656        kbuild_apply_defpath(pDefPath, &pVar->value, (unsigned int *)&pVar->value_length, &pVar->value_alloc_len, 1);
     657    }
    646658    return pVar;
    647659}
     
    661673    struct variable *pVar = kbuild_lookup_variable(pszName);
    662674    if (pVar && pDefPath)
     675    {
     676        assert(pVar->origin != o_automatic);
     677#ifdef CONFIG_WITH_RDONLY_VARIABLE_VALUE
     678        assert(!pVar->rdonly_val);
     679#endif
    663680        kbuild_apply_defpath(pDefPath, &pVar->value, (unsigned int *)&pVar->value_length, &pVar->value_alloc_len, 1);
     681    }
    664682    return pVar;
    665683}
     
    20442062     */
    20452063    if (pDefPath)
     2064    {
     2065        /** @todo assert(pSource->origin != o_automatic);  We're changing 'source'
     2066         *        from the foreach loop!  */
     2067#ifdef CONFIG_WITH_RDONLY_VARIABLE_VALUE
     2068        assert(!pSource->rdonly_val);
     2069#endif
    20462070        kbuild_apply_defpath(pDefPath, &pSource->value, (unsigned int *)&pSource->value_length, &pSource->value_alloc_len, 1 /* can free */);
     2071    }
    20472072
    20482073    /*
Note: See TracChangeset for help on using the changeset viewer.