From d6ab6bca7a538c1a320ce00ab845e98c16649c94 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 7 Dec 2024 22:28:15 -0800 Subject: pipes and endpoints: support for inline allocations of transport data This is a new transport API, which should make it easier for transports to rely upon lifetime guarantees made by the common SP framework, thus eliminating the need for transport specific reference counters, reap lists, and similar. The transport declares the size of the object in the ops vector (for pipe, dialer, or listener), and the framework supplies one allocated using the associated allocator. For now these add the pipe object to the socket and endpoint using linked linked lists. The plan is to transition those to reference counts which should be lighter weight and free form locking issues. The pipe teardown has been moved more fully to the reaper, to avoid some of the deadlocks that can occur as nni_pipe_close can be called from almost any context. For now the old API is retained as well, but the intention is to convert all the transports and then remove it. --- src/core/pipe.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/pipe.h') diff --git a/src/core/pipe.h b/src/core/pipe.h index 9e7109de..71e07a9f 100644 --- a/src/core/pipe.h +++ b/src/core/pipe.h @@ -63,4 +63,7 @@ extern void nni_pipe_bump_error(nni_pipe *, int); extern char *nni_pipe_peer_addr(nni_pipe *p, char buf[NNG_MAXADDRSTRLEN]); +extern int nni_pipe_alloc_dialer(void **, nni_dialer *); +extern int nni_pipe_alloc_listener(void **, nni_listener *); + #endif // CORE_PIPE_H -- cgit v1.2.3-70-g09d2