tap-driver.sh: flush stdout after each test result
[babeltrace.git] / plugins / ctf / common / metadata / objstack.c
index de6760166e93f142c33b0f431ed874f01f360d70..2f70380040f6050a8a1c283838c5c65cc8178d73 100644 (file)
  * SOFTWARE.
  */
 
+#define BT_LOG_TAG "PLUGIN-CTF-METADATA-OBJSTACK"
+#include "logging.h"
+
 #include <stdlib.h>
-#include <babeltrace/list-internal.h>
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/align-internal.h>
+#include <babeltrace2/list-internal.h>
+#include <babeltrace2/babeltrace-internal.h>
+#include <babeltrace2/align-internal.h>
 
 #define OBJSTACK_ALIGN                 8       /* Object stack alignment */
 #define OBJSTACK_INIT_LEN              128
@@ -51,11 +54,14 @@ struct objstack *objstack_create(void)
        struct objstack_node *node;
 
        objstack = calloc(1, sizeof(*objstack));
-       if (!objstack)
+       if (!objstack) {
+               BT_LOGE_STR("Failed to allocate one object stack.");
                return NULL;
+       }
        node = calloc(sizeof(struct objstack_node) + OBJSTACK_INIT_LEN,
                        sizeof(char));
        if (!node) {
+               BT_LOGE_STR("Failed to allocate one object stack node.");
                free(objstack);
                return NULL;
        }
@@ -107,6 +113,7 @@ struct objstack_node *objstack_append_node(struct objstack *objstack)
        new_node = calloc(sizeof(struct objstack_node) + (last_node->len << 1),
                        sizeof(char));
        if (!new_node) {
+               BT_LOGE_STR("Failed to allocate one object stack node.");
                return NULL;
        }
        bt_list_add_tail(&new_node->node, &objstack->head);
This page took 0.024694 seconds and 4 git commands to generate.