mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
config: define new macro for maximum sample length
This commit is contained in:
parent
3162895993
commit
9045957f0b
4 changed files with 8 additions and 7 deletions
|
@ -29,8 +29,9 @@
|
|||
#include <villas/config.h>
|
||||
|
||||
/** Default number of values in a sample */
|
||||
#define DEFAULT_SAMPLE_LENGTH 64
|
||||
#define DEFAULT_SAMPLE_LENGTH 64u
|
||||
#define DEFAULT_QUEUE_LENGTH 1024u
|
||||
#define MAX_SAMPLE_LENGTH 256u
|
||||
|
||||
/** Number of hugepages which are requested from the the kernel.
|
||||
* @see https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt */
|
||||
|
|
|
@ -95,8 +95,8 @@ struct path {
|
|||
#ifdef __cplusplus
|
||||
villas::Logger logger;
|
||||
|
||||
std::bitset<128> mask; /**< A mask of path_sources which are enabled for poll(). */
|
||||
std::bitset<128> received; /**< A mask of path_sources for which we already received samples. */
|
||||
std::bitset<MAX_SAMPLE_LENGTH> mask; /**< A mask of path_sources which are enabled for poll(). */
|
||||
std::bitset<MAX_SAMPLE_LENGTH> received; /**< A mask of path_sources for which we already received samples. */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class AverageHook : public Hook {
|
|||
protected:
|
||||
int offset;
|
||||
|
||||
std::bitset<128> mask;
|
||||
std::bitset<MAX_SAMPLE_LENGTH> mask;
|
||||
vlist signal_names;
|
||||
|
||||
public:
|
||||
|
|
|
@ -116,9 +116,9 @@ int path_init(struct path *p)
|
|||
assert(p->state == STATE_DESTROYED);
|
||||
|
||||
p->logger = logging.get("path");
|
||||
new (&p->received) std::bitset<MAX_SAMPLE_LENGTH>;
|
||||
new (&p->mask) std::bitset<MAX_SAMPLE_LENGTH>;
|
||||
|
||||
new (&p->received) std::bitset<128>;
|
||||
new (&p->mask) std::bitset<128>;
|
||||
|
||||
ret = vlist_init(&p->destinations);
|
||||
if (ret)
|
||||
|
@ -721,7 +721,7 @@ int path_destroy(struct path *p)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
using bs = std::bitset<128>;
|
||||
using bs = std::bitset<MAX_SAMPLE_LENGTH>;
|
||||
using lg = spdlog::logger;
|
||||
|
||||
p->received.~bs();
|
||||
|
|
Loading…
Add table
Reference in a new issue