Skip to content

Adding support for NULL pointers for several shared pointer methods#158

Open
P-p-H-d wants to merge 11 commits into
masterfrom
feature/null-ptr
Open

Adding support for NULL pointers for several shared pointer methods#158
P-p-H-d wants to merge 11 commits into
masterfrom
feature/null-ptr

Conversation

@P-p-H-d

@P-p-H-d P-p-H-d commented Jun 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

@P-p-H-d

P-p-H-d commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

Question: about the I/O methods. Support could be added but it has to handle it in a way that doesn't interfere with the printing of the internal object, which may be hard.

@BrianSipos

Copy link
Copy Markdown
Contributor

That support is not important (to me). Documenting preconditions and behaviors with null pointers on the main interfaces is the important thing to me. Allowing null pointer items in container "shared ptr within array/deque/stack/buffer" is helpful to have.

@P-p-H-d P-p-H-d force-pushed the feature/null-ptr branch from 580a9f4 to b49716f Compare June 13, 2026 19:32
@P-p-H-d

P-p-H-d commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

ThreadSanitizer has detected a lock-order-inversion (potential deadlock) when using _apply or _for_each if the used callback performs some mutex lock (directly or indirectly by calling another shared ptr function).

It cannot be fixed easily.

Probably we need to :

  • specify the problem and the exact restriction in theses functions in the specification, without being too restrictive
  • add a new set of functions that will avoid this restriction (but perform much slower and consume more memory)

EDIT: Currently we will only specify the problem and the restriction. If needed by some uses, we can implement a new set of functions later.

@P-p-H-d P-p-H-d force-pushed the feature/null-ptr branch from 697c61c to 2382c06 Compare June 22, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants