acl: use setjmp/longjmp to handle alloc failures at build phase
[dpdk.git] / lib / librte_acl / tb_mem.h
index a8dae94..ca7af96 100644 (file)
@@ -48,6 +48,7 @@ extern "C" {
 #endif
 
 #include <rte_acl_osdep.h>
+#include <setjmp.h>
 
 struct tb_mem_block {
        struct tb_mem_block *next;
@@ -61,6 +62,8 @@ struct tb_mem_pool {
        size_t               alignment;
        size_t               min_alloc;
        size_t               alloc;
+       /* jump target in case of memory allocation failure. */
+       sigjmp_buf           fail;
 };
 
 void *tb_alloc(struct tb_mem_pool *pool, size_t size);