Changeset 2498008 for lib/data-struct
- Timestamp:
- 09/16/14 02:35:10 (8 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- d994324
- Parents:
- 50b1bee
- Location:
- lib/data-struct
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/data-struct/vector.c
ra49a9eb r2498008 59 59 } 60 60 v->size--; 61 // Of co arse this is mega slow61 // Of course this is mega slow 62 62 for (i = 0; i < v->size * v->element_size; i++) 63 63 v->elements[i] = v->elements[i+v->element_size]; … … 132 132 ASSERT_RET(pthread_mutex_unlock(&v->lock), == 0); 133 133 } 134 135 DLLEXPORT void libtrace_vector_qsort(libtrace_vector_t *v, int (*compar)(const void *, const void*)) { 136 ASSERT_RET(pthread_mutex_lock(&v->lock), == 0); 137 qsort(v->elements, v->element_size, v->element_size, compar); 138 ASSERT_RET(pthread_mutex_unlock(&v->lock), == 0); 139 } -
lib/data-struct/vector.h
r8c42377 r2498008 30 30 DLLEXPORT void libtrace_vector_apply_function(libtrace_vector_t *v, vector_data_fn fn); 31 31 32 // Sort the vector using qsort 33 DLLEXPORT void libtrace_vector_qsort(libtrace_vector_t *v, int (*compar)(const void *, const void*)); 32 34 #endif
Note: See TracChangeset
for help on using the changeset viewer.