projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: handle EINTR return value for bt_posix_fallocate
[babeltrace.git]
/
formats
/
ctf
/
metadata
/
objstack.c
diff --git
a/formats/ctf/metadata/objstack.c
b/formats/ctf/metadata/objstack.c
index 9e264a415d3311755489940c2a490c9255b34a17..8087722059cd3d28cb66a7241de1ba8d7debca50 100644
(file)
--- a/
formats/ctf/metadata/objstack.c
+++ b/
formats/ctf/metadata/objstack.c
@@
-27,7
+27,9
@@
#include <stdlib.h>
#include <babeltrace/list.h>
#include <babeltrace/babeltrace-internal.h>
#include <stdlib.h>
#include <babeltrace/list.h>
#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/align.h>
+#define OBJSTACK_ALIGN 8 /* Object stack alignment */
#define OBJSTACK_INIT_LEN 128
#define OBJSTACK_POISON 0xcc
#define OBJSTACK_INIT_LEN 128
#define OBJSTACK_POISON 0xcc
@@
-39,7
+41,7
@@
struct objstack_node {
struct bt_list_head node;
size_t len;
size_t used_len;
struct bt_list_head node;
size_t len;
size_t used_len;
- char data[];
+ char
__attribute__ ((aligned (OBJSTACK_ALIGN)))
data[];
};
BT_HIDDEN
};
BT_HIDDEN
@@
-118,6
+120,8
@@
void *objstack_alloc(struct objstack *objstack, size_t len)
struct objstack_node *last_node;
void *p;
struct objstack_node *last_node;
void *p;
+ len = ALIGN(len, OBJSTACK_ALIGN);
+
/* Get last node */
last_node = bt_list_entry(objstack->head.prev,
struct objstack_node, node);
/* Get last node */
last_node = bt_list_entry(objstack->head.prev,
struct objstack_node, node);
This page took
0.025261 seconds
and
4
git commands to generate.