@@ -64,111 +64,6 @@ static inline udpard_bytes_scattered_t make_scattered(const void* const data, co
6464 return out ;
6565}
6666
67- // Legacy compatibility user context (removed from public API).
68- typedef union
69- {
70- void * ptr [2 ];
71- unsigned char bytes [sizeof (void * ) * 2 ];
72- } udpard_user_context_t ;
73- #ifdef __cplusplus
74- #define UDPARD_USER_CONTEXT_NULL \
75- udpard_user_context_t {}
76- #else
77- #define UDPARD_USER_CONTEXT_NULL ((udpard_user_context_t){ .ptr = { NULL } })
78- #endif
79-
80- // Legacy compatibility feedback payload (reliable TX removed from public API).
81- typedef struct
82- {
83- udpard_user_context_t user ;
84- uint16_t acknowledgements ;
85- } udpard_tx_feedback_t ;
86-
87- // Wraps an application pointer for legacy user context plumbing.
88- static inline udpard_user_context_t make_user_context (void * const obj )
89- {
90- udpard_user_context_t out = UDPARD_USER_CONTEXT_NULL ;
91- out .ptr [0 ] = obj ;
92- return out ;
93- }
94-
95- // Calls the current public TX push API directly.
96- static inline bool udpard_tx_push_native (udpard_tx_t * const self ,
97- const udpard_us_t now ,
98- const udpard_us_t deadline ,
99- const uint16_t iface_bitmap ,
100- const udpard_prio_t priority ,
101- const uint64_t transfer_id ,
102- const udpard_udpip_ep_t endpoint ,
103- const udpard_bytes_scattered_t payload ,
104- void * const user )
105- {
106- return udpard_tx_push (self , now , deadline , iface_bitmap , priority , transfer_id , endpoint , payload , user );
107- }
108-
109- // Calls the current public TX P2P push API directly.
110- static inline bool udpard_tx_push_p2p_native (udpard_tx_t * const self ,
111- const udpard_us_t now ,
112- const udpard_us_t deadline ,
113- const udpard_prio_t priority ,
114- const udpard_udpip_ep_t endpoints [UDPARD_IFACE_COUNT_MAX ],
115- const udpard_bytes_scattered_t payload ,
116- void * const user )
117- {
118- return udpard_tx_push_p2p (self , now , deadline , priority , endpoints , payload , user );
119- }
120-
121- // Calls the current public RX constructor directly.
122- static inline void udpard_rx_new_native (udpard_rx_t * const self ) { udpard_rx_new (self ); }
123-
124- // Maps legacy subject push API to the new endpoint-based API.
125- static inline bool udpard_tx_push_compat (udpard_tx_t * const self ,
126- const udpard_us_t now ,
127- const udpard_us_t deadline ,
128- const uint16_t iface_bitmap ,
129- const udpard_prio_t priority ,
130- const uint64_t transfer_id ,
131- const udpard_bytes_scattered_t payload ,
132- void (* const feedback )(udpard_tx_t * , udpard_tx_feedback_t ),
133- const udpard_user_context_t user )
134- {
135- (void )feedback ;
136- return udpard_tx_push_native (
137- self , now , deadline , iface_bitmap , priority , transfer_id , udpard_make_subject_endpoint (0U ), payload , user .ptr [0 ]);
138- }
139-
140- // Maps legacy P2P push API to the new endpoint-array API.
141- static inline bool udpard_tx_push_p2p_compat (udpard_tx_t * const self ,
142- const udpard_us_t now ,
143- const udpard_us_t deadline ,
144- const udpard_prio_t priority ,
145- const udpard_remote_t remote ,
146- const udpard_bytes_scattered_t payload ,
147- void (* const feedback )(udpard_tx_t * , udpard_tx_feedback_t ),
148- const udpard_user_context_t user ,
149- uint64_t * const out_transfer_id )
150- {
151- (void )feedback ;
152- const uint64_t tid = (self != NULL ) ? self -> p2p_transfer_id : 0U ;
153- const bool ok = udpard_tx_push_p2p_native (self , now , deadline , priority , remote .endpoints , payload , user .ptr [0 ]);
154- if (ok && (out_transfer_id != NULL )) {
155- * out_transfer_id = tid ;
156- }
157- return ok ;
158- }
159-
160- // Maps legacy RX constructor API to the new standalone constructor.
161- static inline void udpard_rx_new_compat (udpard_rx_t * const self , udpard_tx_t * const tx )
162- {
163- (void )tx ;
164- udpard_rx_new_native (self );
165- }
166-
167- // Remap legacy symbol names used by old tests.
168- #define udpard_tx_push udpard_tx_push_compat
169- #define udpard_tx_push_p2p udpard_tx_push_p2p_compat
170- #define udpard_rx_new udpard_rx_new_compat
171-
17267/// The instrumented allocator tracks memory consumption, checks for heap corruption, and can be configured to fail
17368/// allocations above a certain threshold.
17469#define INSTRUMENTED_ALLOCATOR_CANARY_SIZE 1024U
0 commit comments