MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlHashFree

Function xmlHashFree

ThirdParty/libxml2/vtklibxml2/hash.c:228–259  ·  view source on GitHub ↗

* xmlHashFree: * @hash: hash table * @dealloc: deallocator function or NULL * * Free the hash and its contents. The payload is deallocated with * @dealloc if provided. */

Source from the content-addressed store, hash-verified

226 * @dealloc if provided.
227 */
228void
229xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc) {
230 if (hash == NULL)
231 return;
232
233 if (hash->table) {
234 const xmlHashEntry *end = &hash->table[hash->size];
235 const xmlHashEntry *entry;
236
237 for (entry = hash->table; entry < end; entry++) {
238 if (entry->hashValue == 0)
239 continue;
240 if ((dealloc != NULL) && (entry->payload != NULL))
241 dealloc(entry->payload, entry->key);
242 if (hash->dict == NULL) {
243 if (entry->key)
244 xmlFree(entry->key);
245 if (entry->key2)
246 xmlFree(entry->key2);
247 if (entry->key3)
248 xmlFree(entry->key3);
249 }
250 }
251
252 xmlFree(hash->table);
253 }
254
255 if (hash->dict)
256 xmlDictFree(hash->dict);
257
258 xmlFree(hash);
259}
260
261/**
262 * xmlFastStrEqual:

Callers 15

xmlFreeCatalogFunction · 0.85
xmlCatalogCleanupFunction · 0.85
xmlFreeElementTableFunction · 0.85
xmlFreeAttributeTableFunction · 0.85
xmlFreeNotationTableFunction · 0.85
xmlFreeIDTableFunction · 0.85
xmlFreeRefTableFunction · 0.85
xmlXPathDistinctSortedFunction · 0.85
htmlCtxtResetFunction · 0.85

Calls 1

xmlDictFreeFunction · 0.85

Tested by 1

saxParseTestFunction · 0.68