Ignore:
Timestamp:
04/10/14 01:24:05 (7 years ago)
Author:
Richard Sanger <rsangerarj@…>
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:
df668eb
Parents:
fb1fd42
Message:

Use size_t rather than int for the data structures. Export vector, deque and ring_buffer for testing and use in programs.
Remove some inlines for now since these result in lots of compile warnings when also exported, the compiler is probably smart enough anyway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/data-struct/deque.h

    rd6a56b6 read9478  
    11#include <pthread.h>
     2#include "../libtrace.h"
    23
    34#ifndef LIBTRACE_DEQUE_H
     
    910        list_node_t * tail;
    1011        pthread_mutex_t lock;
    11         int size;
    12         int element_size;
     12        size_t size;
     13        size_t element_size;
    1314} libtrace_queue_t;
    1415
    15 void libtrace_deque_init(libtrace_queue_t * q, int element_size);
    16 inline void libtrace_deque_push_back(libtrace_queue_t *q, void *d);
    17 inline void libtrace_deque_push_front(libtrace_queue_t *q, void *d);
    18 inline int libtrace_deque_get_size(libtrace_queue_t *q);
     16DLLEXPORT void libtrace_deque_init(libtrace_queue_t * q, size_t element_size);
     17DLLEXPORT void libtrace_deque_push_back(libtrace_queue_t *q, void *d);
     18DLLEXPORT void libtrace_deque_push_front(libtrace_queue_t *q, void *d);
     19DLLEXPORT size_t libtrace_deque_get_size(libtrace_queue_t *q);
    1920
    20 inline int libtrace_deque_peek_front(libtrace_queue_t *q, void *d);
    21 inline int libtrace_deque_peek_tail(libtrace_queue_t *q, void *d);
    22 inline int libtrace_deque_pop_front(libtrace_queue_t *q, void *d);
    23 inline int libtrace_deque_pop_tail(libtrace_queue_t *q, void *d);
    24 inline void libtrace_zero_deque(libtrace_queue_t *q);
     21DLLEXPORT int libtrace_deque_peek_front(libtrace_queue_t *q, void *d);
     22DLLEXPORT int libtrace_deque_peek_tail(libtrace_queue_t *q, void *d);
     23DLLEXPORT int libtrace_deque_pop_front(libtrace_queue_t *q, void *d);
     24DLLEXPORT int libtrace_deque_pop_tail(libtrace_queue_t *q, void *d);
     25DLLEXPORT void libtrace_zero_deque(libtrace_queue_t *q);
    2526
    2627#endif
Note: See TracChangeset for help on using the changeset viewer.