You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/02/11 15:35:02 UTC

[GitHub] [qpid-dispatch] ganeshmurthy commented on a change in pull request #1027: WIP: generic Q2 unblocking API

ganeshmurthy commented on a change in pull request #1027:
URL: https://github.com/apache/qpid-dispatch/pull/1027#discussion_r574598410



##########
File path: include/qpid/dispatch/alloc_pool.h
##########
@@ -80,7 +80,26 @@ void *qd_alloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool);
 /** De-allocate from a thread pool. Use via ALLOC_DECLARE */
 void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, char *p);
 uint32_t qd_alloc_sequence(void *p);
-static inline void qd_nullify_safe_ptr(qd_alloc_safe_ptr_t *sp) { sp->ptr = 0; }
+
+// generic safe pointer api for any alloc pool item
+
+#define QD_SAFE_PTR_INIT(p) { .ptr = (void*)(p), .seq = qd_alloc_sequence(p) }
+
+static inline void qd_nullify_safe_ptr(qd_alloc_safe_ptr_t *sp)

Review comment:
       Instead of this function (qd_nullify_safe_ptr), can we just pass in a zero to qd_alloc_set_safe_ptr(). That way when people search for qd_alloc_set_safe_ptr, we can see where the safe pointer is set and unset. I do understand that this PR is not introducing the qd_nullify_safe_ptr() function.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org