[lttng-dev] [PATCH] FIX: Align buffers on 4 bytes for 64bit access

rongqing.li at windriver.com rongqing.li at windriver.com
Thu May 15 04:57:30 EDT 2014


From: Fredrik Markström <fredrik.markstrom at gmail.com>

Signed-off-by: Fredrik Markstr枚m <fredrik.markstrom at gmail.com>
---
 formats/ctf/metadata/objstack.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/formats/ctf/metadata/objstack.c b/formats/ctf/metadata/objstack.c
index 9e264a4..9643b9b 100644
--- a/formats/ctf/metadata/objstack.c
+++ b/formats/ctf/metadata/objstack.c
@@ -118,6 +118,8 @@ void *objstack_alloc(struct objstack *objstack, size_t len)
 	struct objstack_node *last_node;
 	void *p;
 
+	len = (len + 3) & ~3;
+
 	/* Get last node */
 	last_node = bt_list_entry(objstack->head.prev,
 			struct objstack_node, node);
-- 
1.7.10.4




More information about the lttng-dev mailing list