4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since 04bf7c5 was
04bf7c5,
checked in by Richard Sanger <rsangerarj@…>, 7 years ago
|
Remove unused sliding window code.
Refactored pstart and added some proper error handling.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | #ifndef LIBTRACE_OBJECT_CACHE_H |
---|
2 | #define LIBTRACE_OBJECT_CACHE_H |
---|
3 | |
---|
4 | #include "ring_buffer.h" |
---|
5 | #include "vector.h" |
---|
6 | |
---|
7 | |
---|
8 | struct local_cache; |
---|
9 | typedef struct libtrace_ocache { |
---|
10 | libtrace_ringbuffer_t rb; |
---|
11 | void *(*alloc)(void); |
---|
12 | void (*free)(void *); |
---|
13 | size_t thread_cache_size; |
---|
14 | size_t max_allocations; |
---|
15 | size_t current_allocations; |
---|
16 | pthread_spinlock_t spin; |
---|
17 | size_t nb_thread_list; |
---|
18 | size_t max_nb_thread_list; |
---|
19 | struct local_cache **thread_list; |
---|
20 | } libtrace_ocache_t; |
---|
21 | |
---|
22 | DLLEXPORT int libtrace_ocache_init(libtrace_ocache_t *oc, void *(*alloc)(void), void (*free)(void*), |
---|
23 | size_t thread_cache_size, size_t buffer_size, bool limit_size); |
---|
24 | DLLEXPORT int libtrace_ocache_destroy(libtrace_ocache_t *oc); |
---|
25 | DLLEXPORT size_t libtrace_ocache_alloc(libtrace_ocache_t *oc, void *values[], size_t nb_buffers, size_t min_nb_buffers); |
---|
26 | DLLEXPORT size_t libtrace_ocache_free(libtrace_ocache_t *oc, void *values[], size_t nb_buffers, size_t min_nb_buffers); |
---|
27 | DLLEXPORT void libtrace_zero_ocache(libtrace_ocache_t *oc); |
---|
28 | DLLEXPORT void libtrace_ocache_unregister_thread(libtrace_ocache_t *oc); |
---|
29 | #endif // LIBTRACE_OBJECT_CACHE_H |
---|
Note: See
TracBrowser
for help on using the repository browser.