projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert to alignment on max(architecture size)
[lttv.git]
/
ltt
/
ltt-private.h
diff --git
a/ltt/ltt-private.h
b/ltt/ltt-private.h
index 5f7919726b6c51300c5f7217ab87c6366bb22045..e432dc5b04010394d9372a0183c5ccbd21cf1572 100644
(file)
--- a/
ltt/ltt-private.h
+++ b/
ltt/ltt-private.h
@@
-196,23
+196,24
@@
struct LttSystemDescription {
/*
* Calculate the offset needed to align the type.
/*
* Calculate the offset needed to align the type.
- * If alignment is 0, alignment is d
is
activated.
+ * If alignment is 0, alignment is d
e
activated.
* else, the function returns the offset needed to
* align align_drift on the alignment value.
*
* else, the function returns the offset needed to
* align align_drift on the alignment value.
*
- * Do not limit alignment on architecture size anymore,
- * because uint64_t types are aligned on 64-bit even
- * on 32-bit archs.
+ * align align_drift on the alignment value (should be
+ * the size of the architecture).
*/
static inline unsigned int ltt_align(size_t align_drift,
size_t size_of_type,
size_t alignment)
{
*/
static inline unsigned int ltt_align(size_t align_drift,
size_t size_of_type,
size_t alignment)
{
+ size_t align_offset = min(alignment, size_of_type);
+
if(!alignment)
return 0;
g_assert(size_of_type != 0);
if(!alignment)
return 0;
g_assert(size_of_type != 0);
- return ((
size_of_type - align_drift) & (size_of_type -
1));
+ return ((
align_offset - align_drift) & (align_offset-
1));
}
}
This page took
0.022774 seconds
and
4
git commands to generate.