jiridanek commented on a change in pull request #757:
URL: https://github.com/apache/qpid-dispatch/pull/757#discussion_r437586665
##########
File path: include/qpid/dispatch/ctools.h
##########
@@ -217,4 +218,41 @@ do { \
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
+//
+// Heap allocation with abort() on failure
+//
+
+static inline void *qd_malloc(size_t size)
+{
+ void *ptr = malloc(size);
+ if (!ptr)
+ abort();
Review comment:
maybe some error message for the abort? on the other hand, that abort
will probably never be called in practice, so it does not matter for UX...
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]