Add data structure benchmarks
[c11concurrency-benchmarks.git] / cdschecker_modified_benchmarks / include / librace.h
1 #ifndef __LIBRACE_H__
2 #define __LIBRACE_H__
3
4 #include <stdint.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10         void store_8(void *addr, uint8_t val) { *((uint8_t *)addr) = val; }
11         void store_16(void *addr, uint16_t val) { *((uint16_t *)addr) = val; }
12         void store_32(void *addr, uint32_t val) { *((uint32_t *)addr) = val; }
13         void store_64(void *addr, uint64_t val) { *((uint64_t *)addr) = val; }
14
15         void store_8_(void *addr);
16         void store_16_(void *addr);
17         void store_32_(void *addr);
18         void store_64_(void *addr);
19
20         uint8_t load_8(const void *addr) { return *((uint8_t *)addr); }
21         uint16_t load_16(const void *addr) { return *((uint16_t *)addr); }
22         uint32_t load_32(const void *addr) { return *((uint32_t *)addr); }
23         uint64_t load_64(const void *addr) { return *((uint64_t *)addr); }
24
25 #ifdef __cplusplus
26 }
27 #endif
28
29 #endif  // __LIBRACE_H__