Skip to content

Commit

Permalink
core: added documentation to cib.h
Browse files Browse the repository at this point in the history
size can be equal 0 or 2^n only. Because else mask won't consist of consecutive '1' only (e.g., 0b00111111) and functions cib_get() and cib_put() will return wrong values.
  • Loading branch information
IldarValiev authored and OlegHahm committed Mar 9, 2016
1 parent 0047fc9 commit a8391e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/include/cib.h
Expand Up @@ -21,6 +21,8 @@
#ifndef CIB_H
#define CIB_H

#include "assert.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -45,6 +47,7 @@ typedef struct {
* @param[out] cib Buffer to initialize.
* Must not be NULL.
* @param[in] size Size of the buffer, must not exceed MAXINT/2.
* Should be equal to 0 or power of 2.
*/
static inline void cib_init(cib_t *__restrict cib, unsigned int size)
{
Expand Down

0 comments on commit a8391e3

Please sign in to comment.