Skip to content

Commit c11568c

Browse files
committed
make NPY_MAX_STRING_SIZE publicly visible
1 parent 9eaaf0c commit c11568c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

stringdtype/stringdtype/src/static_string.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ typedef union _npy_static_string_u {
4848
#define NPY_SHORT_STRING_MAX_SIZE \
4949
(sizeof(npy_static_string) - 1) // 15 or 7 depending on arch
5050

51-
// one byte in size is reserved for flags and small string optimization
52-
#define NPY_MAX_STRING_SIZE (1 << (sizeof(size_t) - 1)) - 1
53-
5451
// Since this has no flags set, technically this is a heap-allocated string
5552
// with size zero. Practically, that doesn't matter because we always do size
5653
// checks before accessing heap data, but that may be confusing. The nice part

stringdtype/stringdtype/src/static_string.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ extern const npy_packed_static_string *NPY_EMPTY_STRING;
2121
// working with it.
2222
extern const npy_packed_static_string *NPY_NULL_STRING;
2323

24+
// one byte in size is reserved for flags and small string optimization
25+
#define NPY_MAX_STRING_SIZE (1 << (sizeof(size_t) - 1)) - 1
26+
2427
// Allocates a new buffer for *to_init*, which must be set to NULL before
2528
// calling this function, filling the newly allocated buffer with the copied
2629
// contents of the first *size* entries in *init*, which must be valid and

0 commit comments

Comments
 (0)