Skip to content

Commit d7f146d

Browse files
committed
Added custom deleter in comparison spreadsheet
1 parent eff2c71 commit d7f146d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ Labels:
9696
| Owning | no | no | no | yes | yes | yes | yes |
9797
| Releasable | N/A | N/A | N/A | yes | no | yes | no |
9898
| Observable deletion | no | yes | yes | yes | yes | yes | yes |
99-
| Thread safe deletion | no | yes | no(1) | yes(2) | yes | yes(2) | yes(2) |
99+
| Thread-safe deletion | no | yes | no(1) | yes(2) | yes | yes(2) | yes(2) |
100100
| Atomic | yes | no(3) | no | no | no(3) | no | no |
101101
| Support arrays | yes | yes | no | yes | yes | no | no |
102-
| Support custom allocator | yes | yes | no | yes | yes | no | no |
103-
| Number of heap alloc. | 0 | 0 | 0 | 1 | 1 or 2 | 2 | 1 |
102+
| Support custom allocator | N/A | yes | no | yes | yes | no | no |
103+
| Support custom deleter | N/A | N/A | N/A | yes | yes(4) | yes | no |
104+
| Number of heap alloc. | 0 | 0 | 0 | 1 | 1/2(5) | 2 | 1 |
104105
| Size in bytes (64 bit) | | | | | | | |
105106
| - Stack (per instance) | 8 | 16 | 16 | 8 | 16 | 16 | 16 |
106107
| - Heap (shared) | 0 | 0 | 0 | 0 | 24 | 8 | 8 |
@@ -112,9 +113,11 @@ Labels:
112113

113114
Notes:
114115

115-
- (1) If `expired()` returns true, the pointer is guaranteed to remain `nullptr` forever, with no ace condition. If `expired()` returns false, the pointer could still expire on the next instant, which can lead to race conditions.
116+
- (1) If `expired()` returns true, the pointer is guaranteed to remain `nullptr` forever, with no race condition. If `expired()` returns false, the pointer could still expire on the next instant, which can lead to race conditions.
116117
- (2) By construction, only one thread can own the pointer, therefore deletion is thread-safe.
117118
- (3) Yes if using `std::atomic<std::shared_ptr<T>>` and `std::atomic<std::weak_ptr<T>>`.
119+
- (4) Not if using `std::make_shared()`.
120+
- (5) 2 by default, or 1 if using `std::make_shared()`.
118121

119122

120123
## Notes

0 commit comments

Comments
 (0)