Changeset 2f4743883d7decd0dabcb5da1a3a772bc4ffab23

Show
Ignore:
Timestamp:
08/01/08 14:27:49 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1217600869 +0000
git-parent:

[4f3e42da250fa12d7d2bf35c891e45787d39452a]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1217600869 +0000
Message:

Okay, so remove_all never worked correctly, replace with destroy

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/utils/noit_skiplist.c

    r3d709f8 r2f47438  
    352352} 
    353353void noit_skiplist_remove_all(noit_skiplist *sl, noit_freefunc_t myfree) { 
    354   /* This must remove even the place holder nodes (bottom though top) 
    355      because we specify in the API that one can free the noit_skiplist after 
    356      making this call without memory leaks */ 
    357354  noit_skiplist_node *m, *p, *u; 
    358355  m=sl->bottom; 
     
    371368  sl->size = 0; 
    372369} 
    373  
     370static void noit_skiplisti_destroy(void *vsl) { 
     371  noit_skiplist_destroy((noit_skiplist *)vsl, NULL); 
     372  free(vsl); 
     373
     374void noit_skiplist_destroy(noit_skiplist *sl, noit_freefunc_t myfree) { 
     375  while(noit_skiplist_pop(sl->index, noit_skiplisti_destroy) != NULL); 
     376  noit_skiplist_remove_all(sl, myfree); 
     377  free(sl); 
     378
    374379void *noit_skiplist_pop(noit_skiplist * a, noit_freefunc_t myfree) 
    375380{ 
  • src/utils/noit_skiplist.h

    ref59bc7 r2f47438  
    8989int noit_skiplisti_remove(noit_skiplist *sl, noit_skiplist_node *m, 
    9090                          noit_freefunc_t myfree); 
    91 void noit_skiplist_remove_all(noit_skiplist *sl, noit_freefunc_t myfree); 
     91void noit_skiplist_destroy(noit_skiplist *sl, noit_freefunc_t myfree); 
    9292 
    9393void *noit_skiplist_pop(noit_skiplist * a, noit_freefunc_t myfree);