Skip to content

Commit

Permalink
Applying clang format throughout.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Aug 5, 2016
1 parent 9269927 commit e972914
Show file tree
Hide file tree
Showing 39 changed files with 1,379 additions and 1,133 deletions.
8 changes: 3 additions & 5 deletions benchmarks/array_container_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ void array_cache_flush(array_container_t* B) {
}
}
#else
// no cache flush on other architectures?
void array_cache_flush(array_container_t* B) {
(void) B;
}
// no cache flush on other architectures?
void array_cache_flush(array_container_t* B) { (void)B; }
#endif

// tries to put the array in cache
void array_cache_prefetch(array_container_t* B) {
#ifdef IS_X64
const int32_t CACHELINESIZE =
computecacheline(); // 64 bytes per cache line
#else
#else
const int32_t CACHELINESIZE = 64;
#endif
for (int32_t k = 0; k < B->cardinality;
Expand Down
17 changes: 8 additions & 9 deletions benchmarks/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,15 @@
*/
#include <time.h>

#define RDTSC_START(cycles) \
do { \
cycles = clock(); \
} while(0)

#define RDTSC_FINAL(cycles) \
do { \
cycles = clock(); \
} while(0)
#define RDTSC_START(cycles) \
do { \
cycles = clock(); \
} while (0)

#define RDTSC_FINAL(cycles) \
do { \
cycles = clock(); \
} while (0)

#endif

Expand Down
7 changes: 2 additions & 5 deletions benchmarks/bitset_container_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ void bitset_cache_flush(bitset_container_t* B) {
}
}
#else
void bitset_cache_flush(bitset_container_t* B) {
(void) B;
}
void bitset_cache_flush(bitset_container_t* B) { (void)B; }

#endif

Expand Down Expand Up @@ -112,8 +110,7 @@ int main() {
printf("\n number of values in container = %d\n",
bitset_container_cardinality(Bt));
int card = bitset_container_cardinality(Bt);
uint32_t* out =
malloc(sizeof(uint32_t) * (unsigned)card + 32);
uint32_t* out = malloc(sizeof(uint32_t) * (unsigned)card + 32);
BEST_TIME(bitset_container_to_uint32_array(out, Bt, 1234), card, repeat,
card);
free(out);
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/real_bitmaps_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
* Once you have collected all the integers, build the bitmaps.
*/
static roaring_bitmap_t **create_all_bitmaps(size_t *howmany,
uint32_t **numbers, size_t count, bool copy_on_write) {
uint32_t **numbers, size_t count,
bool copy_on_write) {
if (numbers == NULL) return NULL;
printf("Constructing %d bitmaps.\n", (int)count);
roaring_bitmap_t **answer = malloc(sizeof(roaring_bitmap_t *) * count);
Expand Down Expand Up @@ -73,7 +74,8 @@ int main(int argc, char **argv) {
uint64_t cycles_start = 0, cycles_final = 0;

RDTSC_START(cycles_start);
roaring_bitmap_t **bitmaps = create_all_bitmaps(howmany, numbers, count, copy_on_write);
roaring_bitmap_t **bitmaps =
create_all_bitmaps(howmany, numbers, count, copy_on_write);
RDTSC_FINAL(cycles_final);
if (bitmaps == NULL) return -1;
printf("Loaded %d bitmaps from directory %s \n", (int)count, dirname);
Expand Down
6 changes: 2 additions & 4 deletions benchmarks/run_container_benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ void run_cache_flush(run_container_t* B) {
}
}
#else
void run_cache_flush(run_container_t* B) {
(void) B;
}
void run_cache_flush(run_container_t* B) { (void)B; }
#endif

// tries to put array in cache
void run_cache_prefetch(run_container_t* B) {
#ifdef IS_X64
const int32_t CACHELINESIZE =
computecacheline(); // 64 bytes per cache line
#else
#else
const int32_t CACHELINESIZE = 64;
#endif
for (int32_t k = 0; k < B->n_runs * 2;
Expand Down
Loading

0 comments on commit e972914

Please sign in to comment.