Changeset 2f4743883d7decd0dabcb5da1a3a772bc4ffab23
- Timestamp:
- 08/01/08 14:27:49
(5 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
| r3d709f8 |
r2f47438 |
|
| 352 | 352 | } |
|---|
| 353 | 353 | void 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 */ |
|---|
| 357 | 354 | noit_skiplist_node *m, *p, *u; |
|---|
| 358 | 355 | m=sl->bottom; |
|---|
| … | … | |
| 371 | 368 | sl->size = 0; |
|---|
| 372 | 369 | } |
|---|
| 373 | | |
|---|
| | 370 | static void noit_skiplisti_destroy(void *vsl) { |
|---|
| | 371 | noit_skiplist_destroy((noit_skiplist *)vsl, NULL); |
|---|
| | 372 | free(vsl); |
|---|
| | 373 | } |
|---|
| | 374 | void 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 | } |
|---|
| 374 | 379 | void *noit_skiplist_pop(noit_skiplist * a, noit_freefunc_t myfree) |
|---|
| 375 | 380 | { |
|---|
| ref59bc7 |
r2f47438 |
|
| 89 | 89 | int noit_skiplisti_remove(noit_skiplist *sl, noit_skiplist_node *m, |
|---|
| 90 | 90 | noit_freefunc_t myfree); |
|---|
| 91 | | void noit_skiplist_remove_all(noit_skiplist *sl, noit_freefunc_t myfree); |
|---|
| | 91 | void noit_skiplist_destroy(noit_skiplist *sl, noit_freefunc_t myfree); |
|---|
| 92 | 92 | |
|---|
| 93 | 93 | void *noit_skiplist_pop(noit_skiplist * a, noit_freefunc_t myfree); |
|---|