Staging
v0.5.1
https://github.com/python/cpython
Revision a3c2c5f15ba5b4ad6fb86b3320d0464f1c502fd2 authored by Miss Islington (bot) on 20 February 2020, 18:37:23 UTC, committed by GitHub on 20 February 2020, 18:37:23 UTC
(cherry picked from commit 1246d892038a693304549f8574e6c2784b91589a)

Co-authored-by: Stefan Krah <skrah@bytereef.org>

Co-authored-by: Stefan Krah <skrah@bytereef.org>
1 parent 2574910
Raw File
Tip revision: a3c2c5f15ba5b4ad6fb86b3320d0464f1c502fd2 authored by Miss Islington (bot) on 20 February 2020, 18:37:23 UTC
Use the new recommended number of repetitions in the refleak tests. (GH-18569) (#18575)
Tip revision: a3c2c5f
bitset.h

#ifndef Py_BITSET_H
#define Py_BITSET_H
#ifdef __cplusplus
extern "C" {
#endif

/* Bitset interface */

#define BYTE            char

typedef BYTE *bitset;

bitset newbitset(int nbits);
void delbitset(bitset bs);
#define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0)
int addbit(bitset bs, int ibit); /* Returns 0 if already set */
int samebitset(bitset bs1, bitset bs2, int nbits);
void mergebitset(bitset bs1, bitset bs2, int nbits);

#define BITSPERBYTE     (8*sizeof(BYTE))
#define NBYTES(nbits)   (((nbits) + BITSPERBYTE - 1) / BITSPERBYTE)

#define BIT2BYTE(ibit)  ((ibit) / BITSPERBYTE)
#define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE)
#define BIT2MASK(ibit)  (1 << BIT2SHIFT(ibit))
#define BYTE2BIT(ibyte) ((ibyte) * BITSPERBYTE)

#ifdef __cplusplus
}
#endif
#endif /* !Py_BITSET_H */
back to top