Home | History | Annotate | Download | only in libxml2

Lines Matching defs:cache

938     void *cache;
1134 comp->steps[comp->nbStep].cache = NULL;
1183 * XPath object cache structures *
1189 #define XP_HAS_CACHE(c) ((c != NULL) && ((c)->cache != NULL))
1727 if (ctxt->cache != NULL) {
1728 xmlXPathContextCachePtr cache =
1729 (xmlXPathContextCachePtr) ctxt->cache;
1731 cache->dbgCachedAll = 0;
1732 cache->dbgCachedNodeset = 0;
1733 cache->dbgCachedString = 0;
1734 cache->dbgCachedBool = 0;
1735 cache->dbgCachedNumber = 0;
1736 cache->dbgCachedPoint = 0;
1737 cache->dbgCachedRange = 0;
1738 cache->dbgCachedLocset = 0;
1739 cache->dbgCachedUsers = 0;
1740 cache->dbgCachedXSLTTree = 0;
1741 cache->dbgCachedUndefined = 0;
1743 cache->dbgReusedAll = 0;
1744 cache->dbgReusedNodeset = 0;
1745 cache->dbgReusedString = 0;
1746 cache->dbgReusedBool = 0;
1747 cache->dbgReusedNumber = 0;
1748 cache->dbgReusedPoint = 0;
1749 cache->dbgReusedRange = 0;
1750 cache->dbgReusedLocset = 0;
1751 cache->dbgReusedUsers = 0;
1752 cache->dbgReusedXSLTTree = 0;
1753 cache->dbgReusedUndefined = 0;
1802 if (ctxt->cache != NULL) {
1803 xmlXPathContextCachePtr cache =
1804 (xmlXPathContextCachePtr) ctxt->cache;
1808 cache->dbgReusedAll++;
1811 cache->dbgReusedUndefined++;
1814 cache->dbgReusedNodeset++;
1817 cache->dbgReusedBool++;
1820 cache->dbgReusedNumber++;
1823 cache->dbgReusedString++;
1826 cache->dbgReusedPoint++;
1829 cache->dbgReusedRange++;
1832 cache->dbgReusedLocset++;
1835 cache->dbgReusedUsers++;
1838 cache->dbgReusedXSLTTree++;
1956 if (ctxt->cache != NULL) {
1957 xmlXPathContextCachePtr cache =
1958 (xmlXPathContextCachePtr) ctxt->cache;
1962 cache->dbgCachedAll++;
1965 cache->dbgCachedUndefined++;
1968 cache->dbgCachedNodeset++;
1971 cache->dbgCachedBool++;
1974 cache->dbgCachedNumber++;
1977 cache->dbgCachedString++;
1980 cache->dbgCachedPoint++;
1983 cache->dbgCachedRange++;
1986 cache->dbgCachedLocset++;
1989 cache->dbgCachedUsers++;
1992 cache->dbgCachedXSLTTree++;
2060 if (ctxt->cache != NULL) {
2061 xmlXPathContextCachePtr cache =
2062 (xmlXPathContextCachePtr) ctxt->cache;
2064 reAll = cache->dbgReusedAll;
2066 reNodeset = cache->dbgReusedNodeset;
2068 reString = cache->dbgReusedString;
2070 reBool = cache->dbgReusedBool;
2072 reNumber = cache->dbgReusedNumber;
2074 reXSLTTree = cache->dbgReusedXSLTTree;
2076 reUndefined = cache->dbgReusedUndefined;
2079 caAll = cache->dbgCachedAll;
2080 caBool = cache->dbgCachedBool;
2081 caNodeset = cache->dbgCachedNodeset;
2082 caString = cache->dbgCachedString;
2083 caNumber = cache->dbgCachedNumber;
2084 caXSLTTree = cache->dbgCachedXSLTTree;
2085 caUndefined = cache->dbgCachedUndefined;
2087 if (cache->nodesetObjs)
2088 leftObjs -= cache->nodesetObjs->number;
2089 if (cache->stringObjs)
2090 leftObjs -= cache->stringObjs->number;
2091 if (cache->booleanObjs)
2092 leftObjs -= cache->booleanObjs->number;
2093 if (cache->numberObjs)
2094 leftObjs -= cache->numberObjs->number;
2095 if (cache->miscObjs)
2096 leftObjs -= cache->miscObjs->number;
2158 * Create a new object cache
2169 xmlXPathErrMemory(NULL, "creating object cache\n");
2210 xmlXPathFreeCache(xmlXPathContextCachePtr cache)
2212 if (cache == NULL)
2214 if (cache->nodesetObjs)
2215 xmlXPathCacheFreeObjectList(cache->nodesetObjs);
2216 if (cache->stringObjs)
2217 xmlXPathCacheFreeObjectList(cache->stringObjs);
2218 if (cache->booleanObjs)
2219 xmlXPathCacheFreeObjectList(cache->booleanObjs);
2220 if (cache->numberObjs)
2221 xmlXPathCacheFreeObjectList(cache->numberObjs);
2222 if (cache->miscObjs)
2223 xmlXPathCacheFreeObjectList(cache->miscObjs);
2224 xmlFree(cache);
2231 * @active: enables/disables (creates/frees) the cache
2235 * Creates/frees an object cache on the XPath context.
2258 xmlXPathContextCachePtr cache;
2260 if (ctxt->cache == NULL) {
2261 ctxt->cache = xmlXPathNewCache();
2262 if (ctxt->cache == NULL)
2265 cache = (xmlXPathContextCachePtr) ctxt->cache;
2269 cache->maxNodeset = value;
2270 cache->maxString = value;
2271 cache->maxNumber = value;
2272 cache->maxBoolean = value;
2273 cache->maxMisc = value;
2275 } else if (ctxt->cache != NULL) {
2276 xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
2277 ctxt->cache = NULL;
2295 if ((ctxt != NULL) && (ctxt->cache != NULL)) {
2296 xmlXPathContextCachePtr cache =
2297 (xmlXPathContextCachePtr) ctxt->cache;
2299 if ((cache->miscObjs != NULL) &&
2300 (cache->miscObjs->number != 0))
2305 cache->miscObjs->items[--cache->miscObjs->number];
2332 if ((ctxt != NULL) && (ctxt->cache != NULL)) {
2333 xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
2335 if ((cache->stringObjs != NULL) &&
2336 (cache->stringObjs->number != 0))
2342 cache->stringObjs->items[--cache->stringObjs->number];
2349 } else if ((cache->miscObjs != NULL) &&
2350 (cache->miscObjs->number != 0))
2354 * Fallback to misc-cache.
2357 cache->miscObjs->items[--cache->miscObjs->number];
2384 if ((ctxt != NULL) && (ctxt->cache)) {
2385 xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
2387 if ((cache->nodesetObjs != NULL) &&
2388 (cache->nodesetObjs->number != 0))
2392 * Use the nodset-cache.
2395 cache->nodesetObjs->items[--cache->nodesetObjs->number];
2412 } else if ((cache->miscObjs != NULL) &&
2413 (cache->miscObjs->number != 0))
2417 * Fallback to misc-cache.
2421 cache->miscObjs->items[--cache->miscObjs->number];
2453 if ((ctxt != NULL) && (ctxt->cache)) {
2454 xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
2456 if ((cache->stringObjs != NULL) &&
2457 (cache->stringObjs->number != 0))
2462 cache->stringObjs->items[--cache->stringObjs->number];
2470 } else if ((cache->miscObjs != NULL) &&
2471 (cache->miscObjs->number != 0))
2476 cache->miscObjs->items[--cache->miscObjs->number];
2502 if ((ctxt != NULL) && (ctxt->cache)) {
2503 xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
2505 if ((cache->stringObjs != NULL) &&
2506 (cache->stringObjs->number != 0))
2511 cache->stringObjs->items[--cache->stringObjs->number];
2521 } else if ((cache->miscObjs != NULL) &&
2522 (cache->miscObjs->number != 0))
2527 cache->miscObjs->items[--cache->miscObjs->number];
2556 if ((ctxt != NULL) && (ctxt->cache)) {
2557 xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
2559 if ((cache->booleanObjs != NULL) &&
2560 (cache->booleanObjs->number != 0))
2565 cache->booleanObjs->items[--cache->booleanObjs->number];
2572 } else if ((cache->miscObjs != NULL) &&
2573 (cache->miscObjs->number != 0))
2578 cache->miscObjs->items[--cache->miscObjs->number];
2604 if ((ctxt != NULL) && (ctxt->cache)) {
2605 xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
2607 if ((cache->numberObjs != NULL) &&
2608 (cache->numberObjs->number != 0))
2613 cache->numberObjs->items[--cache->numberObjs->number];
2620 } else if ((cache->miscObjs != NULL) &&
2621 (cache->miscObjs->number != 0))
2626 cache->miscObjs->items[--cache->miscObjs->number];
5516 * @obj: the xmlXPathObjectPtr to free or to cache
5518 * Depending on the state of the cache this frees the given
5519 * XPath object or stores it in the cache.
5532 if ((ctxt == NULL) || (ctxt->cache == NULL)) {
5535 xmlXPathContextCachePtr cache =
5536 (xmlXPathContextCachePtr) ctxt->cache;
5552 (XP_CACHE_WANTS(cache->nodesetObjs,
5553 cache->maxNodeset)))
5555 XP_CACHE_ADD(cache->nodesetObjs, obj);
5567 if (XP_CACHE_WANTS(cache->stringObjs, cache->maxString)) {
5568 XP_CACHE_ADD(cache->stringObjs, obj);
5573 if (XP_CACHE_WANTS(cache->booleanObjs, cache->maxBoolean)) {
5574 XP_CACHE_ADD(cache->booleanObjs, obj);
5579 if (XP_CACHE_WANTS(cache->numberObjs, cache->maxNumber)) {
5580 XP_CACHE_ADD(cache->numberObjs, obj);
5598 if (XP_CACHE_WANTS(cache->miscObjs, cache->maxMisc)) {
5599 XP_CACHE_ADD(cache->miscObjs, obj);
5645 * Cache is full; free the object.
6163 if (ctxt->cache != NULL)
6164 xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
13562 if (op->cache != NULL)
13563 XML_CAST_FPTR(func) = op->cache;
13590 op->cache = XML_CAST_FPTR(func);