bitset: Add a bitset_free() function

This commit is contained in:
nick
2013-09-11 14:41:59 +01:00
parent 487bef1f40
commit 54a41aacdf
3 changed files with 8 additions and 2 deletions

View File

@@ -141,6 +141,12 @@ static inline struct bitset_mapping* bitset_alloc(
return bitset; return bitset;
} }
static inline void bitset_free( struct bitset_mapping * set )
{
/* TODO: free our mutex... */
free( set );
}
#define INT_FIRST_AND_LAST \ #define INT_FIRST_AND_LAST \
uint64_t first = from/set->resolution, \ uint64_t first = from/set->resolution, \
last = ((from+len)-1)/set->resolution, \ last = ((from+len)-1)/set->resolution, \

View File

@@ -206,7 +206,7 @@ void mirror_destroy( struct mirror *mirror )
self_pipe_destroy( mirror->abandon_signal ); self_pipe_destroy( mirror->abandon_signal );
free(mirror->connect_to); free(mirror->connect_to);
free(mirror->connect_from); free(mirror->connect_from);
free(mirror->dirty_map); bitset_free( mirror->dirty_map );
free(mirror); free(mirror);
} }

View File

@@ -830,7 +830,7 @@ void serve_cleanup(struct server* params,
pthread_cancel(params->allocation_map_builder_thread); pthread_cancel(params->allocation_map_builder_thread);
pthread_join(params->allocation_map_builder_thread, &status); pthread_join(params->allocation_map_builder_thread, &status);
if (params->allocation_map) { if (params->allocation_map) {
free(params->allocation_map); bitset_free( params->allocation_map );
} }
int need_mirror_lock; int need_mirror_lock;