search for: alignment_of

Displaying 5 results from an estimated 5 matches for "alignment_of".

2019 Oct 17
2
Static assert fails when compiler for i386
Hi Devs, Consider below testcase. $cat test.cpp #include <vector> #include<type_traits> typedef int _int4 __attribute__((vector_size(16))); typedef union{ int data[4]; struct {int x, y, z, w;}; _int4 vec; } int4; typedef int4 int3; int main() { static_assert(std::alignment_of<int4>::value <= alignof(max_align_t), "over aligned!"); } $clang++ -m32 error: static_assert failed due to requirement 'std::alignment_of<int4>::value <= alignof(max_align_t)' "over aligned it goes smooth when compile for x86_64. Following changes fixes thi...
2009 May 02
1
[LLVMdev] PointerIntPair causing trouble
...> _alignof and similar compiler-specific extensions to determine it), > and allow classes that assert that they are only ever allocated > through malloc to relax it back up to 3. > Something like this device should suffice; no need for extensions. template<typename T> class alignment_of { struct test { char a; T b; }; public: enum { value = sizeof(test) - sizeof(T) }; }; // usage: alignment_of<int>::value TR1's type_traits header is now available on many platforms now, too. > My preference would be for option (2), due to the difficulty of >...
2009 May 01
0
[LLVMdev] PointerIntPair causing trouble
Hi Nicolas, Looks like Preston and I have found the cause of the problem. The issue is with PointerLikeTypeTraits<T*>::NumLowBitsAvailable. This is set to 3, which basically assumes that unless the traits are specialized for a particular pointer type, objects of that type are allocated with malloc() and aligned to 8 bytes. While PointerLikeTypeTraits is overloaded for Use*, it is
2009 May 01
7
[LLVMdev] PointerIntPair causing trouble
Hi all, I've located a regression that causes my project to crash. It's in revision 67979, where PointerIntPair is changed from storing the integer in the upper bits instead of the lower bits. My project is an experimental JIT-compiler in Windows. So I was wondering if anyone had any clue why the new PointerIntPair implementation might fail. It doesn't seem very safe to me to
2015 Dec 14
4
[PATCH 0/2] resize: Split out the command line parsing into Cmdline
Some simple refactoring of virt-resize. I originally had the idea that we could turn virt-resize into a library (cf. virt-customize) and use it from virt-builder, but I now don't think that would make any meaningful difference. In particular we'd still have to open the handle the same number of times. These two patches are left over from my work on that. Rich.