-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Bump meson #57895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump meson #57895
Changes from all commits
d402d08 668f74c ea08a12 bd4b57c a279e4a 5cb0305 97e3f50 e7dbf18 8cfbd7f 184ecca f2a13b6 8ef0ee2 a7ae1be 5487fd0 7def60a bc61810 f3a4d71 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -43,7 +43,13 @@ cdef value_count_{{dtype}}(const {{dtype}}_t[:] values, bint dropna, const uint8 | |
| # Don't use Py_ssize_t, since table.n_buckets is unsigned | ||
| khiter_t k | ||
| | ||
| {{c_type}} val | ||
| # without explicit initialization the compiler detects that val could | ||
| Member Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is extremely wonky, but the compiler is right that | ||
| # be uninitialized towards the end of this function | ||
| {{if dtype == 'object'}} | ||
| {{c_type}} val = None | ||
| {{else}} | ||
| {{c_type}} val = {{to_c_type}}(0) | ||
| {{endif}} | ||
| | ||
| int ret = 0 | ||
| bint uses_mask = mask is not None | ||
| | @@ -105,7 +111,7 @@ cdef value_count_{{dtype}}(const {{dtype}}_t[:] values, bint dropna, const uint8 | |
| cdef: | ||
| int64_t[::1] result_counts = np.empty(table.size + na_add, dtype=np.int64) | ||
| | ||
| for i in range(table.size): | ||
| for i in range(<Py_ssize_t>table.size): # cast required for 32 bit builds | ||
| Member Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We alternately could change | ||
| {{if dtype == 'object'}} | ||
| k = kh_get_{{ttype}}(table, result_keys.data[i]) | ||
| {{else}} | ||
| | @@ -114,6 +120,8 @@ cdef value_count_{{dtype}}(const {{dtype}}_t[:] values, bint dropna, const uint8 | |
| result_counts[i] = table.vals[k] | ||
| | ||
| if na_counter > 0: | ||
| if n <= 0: # in this case val would be uninitialized | ||
| raise ValueError("Expected n > 0") | ||
| result_counts[table.size] = na_counter | ||
| result_keys.append(val) | ||
| | ||
| | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -33,11 +33,9 @@ static void *traced_calloc(size_t num, size_t size) { | |
| } | ||
| | ||
| static void *traced_realloc(void *old_ptr, size_t size) { | ||
| PyTraceMalloc_Untrack(KHASH_TRACE_DOMAIN, (uintptr_t)old_ptr); | ||
| void *ptr = realloc(old_ptr, size); | ||
| if (ptr != NULL) { | ||
| if (old_ptr != ptr) { | ||
| Member Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gcc was complaing about a use-after-free with | ||
| PyTraceMalloc_Untrack(KHASH_TRACE_DOMAIN, (uintptr_t)old_ptr); | ||
| } | ||
| PyTraceMalloc_Track(KHASH_TRACE_DOMAIN, (uintptr_t)ptr, size); | ||
| } | ||
| return ptr; | ||
| | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -137,7 +137,7 @@ except ImportError: | |
| | ||
| @cython.wraparound(False) | ||
| @cython.boundscheck(False) | ||
| def memory_usage_of_objects(arr: object[:]) -> int64_t: | ||
| def memory_usage_of_objects(arr: ndarray[object]) -> int64_t: | ||
| Member Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This produces: although I am not sure why it wouldn't let me specify the | ||
| """ | ||
| Return the memory usage of an object array in bytes. | ||
| | ||
| | @@ -3058,7 +3058,9 @@ def to_object_array_tuples(rows: object) -> np.ndarray: | |
| | ||
| @cython.wraparound(False) | ||
| @cython.boundscheck(False) | ||
| def fast_multiget(dict mapping, object[:] keys, default=np.nan) -> "ArrayLike": | ||
| def fast_multiget(dict mapping, | ||
| ndarray[object, ndim=1] keys, | ||
| default=np.nan) -> "ArrayLike": | ||
| cdef: | ||
| Py_ssize_t i, n = len(keys) | ||
| object val | ||
| | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning about comparison of operands with different signs (size_t is unsigned, Py_ssize_t is signed)