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

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu May 15 13:45:19 EDT 2014


----- Original Message -----
> From: "rongqing li" <rongqing.li at windriver.com>
> To: lttng-dev at lists.lttng.org
> Sent: Thursday, May 15, 2014 4:57:30 AM
> Subject: [lttng-dev] [PATCH] FIX: Align buffers on 4 bytes for 64bit access

Why hardcoded constants ? Why 4 ? What is the intent ?

Thanks,

Mathieu

> 
> 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
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list