Commit 7c57012
committed
Rewrite smart pointers that encapsulate Python references.
First, Rewrite non-null pointer types to use asserts rather than
an absolute assumption that the pointer type is not null.
Second, add move assignment operators to avoid unneeded incref/decrefs
when assigning between these smart pointer classes.
Third, allow implicit conversions to happen between all four of
these classes. Conversions from pointers that may be null to pointers
that count null as an uninitialized state now raise an exception if a
null value is encountered, and all other constructors are marked
as noexcept.
Fourth, add a method to release an owned reference from a given pointer.
This replaces the old release method and eliminates various segfaults that
were due to over-agressive calls to decref.1 parent ec82518 commit 7c57012
6 files changed
Lines changed: 190 additions & 109 deletions
File tree
- dynd
- include
- callables
- kernels
- nd
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
499 | | - | |
| 499 | + | |
500 | 500 | | |
501 | 501 | | |
502 | 502 | | |
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
527 | | - | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
0 commit comments