source:
trunk/essentials/dev-lang/python/Parser/bitset.c@
3392
| Last change on this file since 3392 was 3225, checked in by , 19 years ago | |
|---|---|
| File size: 977 bytes | |
| Line | |
|---|---|
| 1 | |
| 2 | /* Bitset primitives used by the parser generator */ |
| 3 | |
| 4 | #include "pgenheaders.h" |
| 5 | #include "bitset.h" |
| 6 | |
| 7 | bitset |
| 8 | newbitset(int nbits) |
| 9 | { |
| 10 | int nbytes = NBYTES(nbits); |
| 11 | bitset ss = (char *)PyObject_MALLOC(sizeof(BYTE) * nbytes); |
| 12 | |
| 13 | if (ss == NULL) |
| 14 | Py_FatalError("no mem for bitset"); |
| 15 | |
| 16 | ss += nbytes; |
