search for: structsize

Displaying 10 results from an estimated 10 matches for "structsize".

Did you mean: struct_size
2000 May 02
0
patch for .samba-2.0.7/source/lib/bitmap.c
...uint32 bitmaps ); + + /**************************************************************************** allocate a bitmap of the specified size ****************************************************************************/ struct bitmap *bitmap_allocate(int n) { - struct bitmap *bm; + size_t structsize, bitmapsize; + struct bitmap *bm; - bm = (struct bitmap *)malloc(sizeof(*bm)); + structsize = ( sizeof(*bm) + BITMAP_ALIGN - 1 )&( ~( BITMAP_ALIGN - 1)); + bitmapsize = ( sizeof( bm->b[0] ) * ( n + UINT32_BITS-1 )/ UINT32_BITS ); - if (!bm) return NULL; - - bm->n = n; - bm...
2009 Sep 22
3
[LLVMdev] StructLayout
How are bitfields handled in StructLayout? In LLVM 2.5 the struct is unambiguously size by: StructSize += TD.getTypePaddedSize(Ty); // Consume space for this data In LLVM 2.6 it's getTypeAllocSize, which does the same thing. Unfortunately, this is not correct for bitfields. For example, LLVM reports this struct: typedef struct test1 { short f0 : 10; char f1 : 5; long f2 : 1; long f3 :...
2008 Apr 21
2
[LLVMdev] newbie question for type comparison
...} } However, I had the impression that the type comparison can be done by a pointer comparison. Can anyone please suggest me a better way to do it? Also, I want to get the size of %struct.S, should I use the following code? const TargetData &TD = getAnalysis<TargetData>(); unsigned StructSize = TD.getABITypeSizeInBits(ai->getOperand(0)->getType()); Thanks a lot. Lu
2010 Nov 11
1
[LLVMdev] named types with self-references
...alid type.  In this case, zero bytes is correct, but something like %rt = {%rt,i8} has infinite size. I tried %rt = {%rt,i8}, Its type size is 1. Does ' infinite size' mean the getTypeAllocSize function may not terminate? I am still using 2.6, whose getStructLayout stops, and assigns 1 as StructSize. Will 2.8 return a larger number? We could even define %rt = {%rt} %rt1 = {%rt2} %rt2 = {%rt1} and LLVM can eventually unify all of them to be %rt. If these %rt are not valid, will any pass of LLVM check and report such types, or this is supposed to be a requirement of frontends? > &...
2008 Apr 21
0
[LLVMdev] newbie question for type comparison
...ssion that the type comparison can be done by a > pointer comparison. Can anyone please suggest me a better way to do it? > > Also, I want to get the size of %struct.S, should I use the following > code? > > const TargetData &TD = getAnalysis<TargetData>(); > unsigned StructSize = > TD.getABITypeSizeInBits(ai->getOperand(0)->getType()); > There are different interpretations of "size" that TargetData supports, but without knowing what you're trying to do, I'd have to guess that this is probably what you want. -- John T. > Tha...
2008 Apr 21
3
[LLVMdev] newbie question for type comparison
...t; > by a pointer comparison. Can anyone please suggest me a better way > > to do it? > > > > Also, I want to get the size of %struct.S, should I use the > > following code? > > > > const TargetData &TD = getAnalysis<TargetData>(); > > unsigned StructSize = > > TD.getABITypeSizeInBits(ai->getOperand(0)->getType()); > > > There are different interpretations of "size" that TargetData > supports, but without knowing what you're trying to do, I'd have to > guess that this is probably what you want...
2009 Sep 23
0
[LLVMdev] StructLayout
...question. If the size of long is 8 on your x64 platform. Because the size of long is so different on different platform, sad it is. 2009/9/23, David Greene <dag at cray.com>: > How are bitfields handled in StructLayout? In LLVM 2.5 the > struct is unambiguously size by: > > StructSize += TD.getTypePaddedSize(Ty); // Consume space for this data > > In LLVM 2.6 it's getTypeAllocSize, which does the same thing. > > Unfortunately, this is not correct for bitfields. For example, > LLVM reports this struct: > > typedef struct test1 { > short f0 : 10; &gt...
2010 Nov 11
0
[LLVMdev] named types with self-references
On Nov 11, 2010, at 8:45 AM, Jianzhou Zhao wrote: > Hello, > > Can I define a named type ? %rt = {%rt} > llvm-as can parse this definition without errors. > > JIT executes '%0 = alloca %rt' as allocating a memory with size 0. > Because the llvm::TargetData::getTypeAllocSize accually returns 0 in > this case. The function that calculates %rt's size is by the
2010 Nov 11
2
[LLVMdev] named types with self-references
Hello, Can I define a named type ? %rt = {%rt} llvm-as can parse this definition without errors. JIT executes '%0 = alloca %rt' as allocating a memory with size 0. Because the llvm::TargetData::getTypeAllocSize accually returns 0 in this case. The function that calculates %rt's size is by the TargetData::getStructLayout, which calculates the a layout of %rt. It can only returns 0
2008 Apr 21
0
[LLVMdev] newbie question for type comparison
...comparison. Can anyone please suggest me a better way >>> to do it? >>> >>> Also, I want to get the size of %struct.S, should I use the >>> following code? >>> >>> const TargetData &TD = getAnalysis<TargetData>(); >>> unsigned StructSize = >>> TD.getABITypeSizeInBits(ai->getOperand(0)->getType()); >>> >>> >> There are different interpretations of "size" that TargetData >> supports, but without knowing what you're trying to do, I'd have to >> guess...