Displaying 20 results from an estimated 108 matches for "alloc_size".
2012 May 23
2
[LLVMdev] alloc_size metadata
Hi,
I'm implementing the alloc_size function attribute in clang. This
attribute exists in gcc since version 4.3.
The attribute specifies that a function returns a buffer with the size
given by the multiplication of the specified arguments. I would like
to add new metadata to pass this information to LLVM IR.
For example, take...
2012 May 25
4
[LLVMdev] alloc_size metadata
On 5/25/12 2:16 AM, Duncan Sands wrote:
> Hi John,
>
>>>> I'm implementing the alloc_size function attribute in clang.
>>> does anyone actually use this attribute? And if they do, can it
>>> really buy
>>> them anything? How about "implementing" it by ignoring it!
>>
> ...
>>
>> Currently, SAFECode has a pass which just recogniz...
2012 May 25
0
[LLVMdev] alloc_size metadata
Hi John,
On 25/05/12 17:22, John Criswell wrote:
> On 5/25/12 2:16 AM, Duncan Sands wrote:
>> Hi John,
>>
>>>>> I'm implementing the alloc_size function attribute in clang.
>>>> does anyone actually use this attribute? And if they do, can it really buy
>>>> them anything? How about "implementing" it by ignoring it!
>>>
>> ...
>>>
>>> Currently, SAFECode has a pass which jus...
2012 May 24
0
[LLVMdev] alloc_size metadata
Hi Nuno,
> I'm implementing the alloc_size function attribute in clang.
does anyone actually use this attribute? And if they do, can it really buy
them anything? How about "implementing" it by ignoring it!
Ciao, Duncan.
This
> attribute exists in gcc since version 4.3.
> The attribute specifies that a function returns...
2012 May 25
0
[LLVMdev] alloc_size metadata
Hi John,
>>> I'm implementing the alloc_size function attribute in clang.
>> does anyone actually use this attribute? And if they do, can it really buy
>> them anything? How about "implementing" it by ignoring it!
>
...
>
> Currently, SAFECode has a pass which just recognizes certain functions as
> allocators...
2012 May 25
3
[LLVMdev] alloc_size metadata
On Fri, 25 May 2012 17:43:52 +0200
Duncan Sands <baldrick at free.fr> wrote:
> Hi John,
>
> On 25/05/12 17:22, John Criswell wrote:
> > On 5/25/12 2:16 AM, Duncan Sands wrote:
> >> Hi John,
> >>
> >>>>> I'm implementing the alloc_size function attribute in clang.
> >>>> does anyone actually use this attribute? And if they do, can it
> >>>> really buy them anything? How about "implementing" it by
> >>>> ignoring it!
> >>>
> >> ...
> >>>
> &...
2012 Jun 04
2
[LLVMdev] alloc_size metadata
On Jun 4, 2012, at 10:37 AM, Nuno Lopes <nunoplopes at sapo.pt> wrote:
> So here is a new proposal:
>
> !0 = metadata !{ alloc_siz_fn, offset_fn, parameters* }
The parameters are a separate metadata array or the alloc_size metadata
is variable length?
You'll probably want to write up some docs for the website on how this
is supposed to be laid out and work.
-eric
2012 May 24
5
[LLVMdev] alloc_size metadata
On 5/24/12 3:51 AM, Duncan Sands wrote:
> Hi Nuno,
>
>> I'm implementing the alloc_size function attribute in clang.
> does anyone actually use this attribute? And if they do, can it really buy
> them anything? How about "implementing" it by ignoring it!
Tools like ASan and SAFECode *could* use this attribute to determine the
size of memory objects created by alloc...
2012 May 29
0
[LLVMdev] alloc_size metadata
>> On 25/05/12 17:22, John Criswell wrote:
>> > On 5/25/12 2:16 AM, Duncan Sands wrote:
>> >> Hi John,
>> >>
>> >>>>> I'm implementing the alloc_size function attribute in clang.
>> >>>> does anyone actually use this attribute? And if they do, can it
>> >>>> really buy them anything? How about "implementing" it by
>> >>>> ignoring it!
>> >>>
>> >> ...
>...
2018 Apr 18
5
[PATCH] net: don't use kvzalloc for DMA memory
...gt; > --- linux-2.6.orig/net/core/dev.c 2018-04-16 21:08:36.000000000 +0200
> > +++ linux-2.6/net/core/dev.c 2018-04-18 16:24:43.000000000 +0200
> > @@ -8366,7 +8366,8 @@ struct net_device *alloc_netdev_mqs(int
> > /* ensure 32-byte alignment of whole construct */
> > alloc_size += NETDEV_ALIGN - 1;
> >
> > - p = kvzalloc(alloc_size, GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> > + WARN_ON(alloc_size > PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER);
> > + p = kzalloc(alloc_size, GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> > if (!p)
> > return NU...
2018 Apr 18
5
[PATCH] net: don't use kvzalloc for DMA memory
...gt; > --- linux-2.6.orig/net/core/dev.c 2018-04-16 21:08:36.000000000 +0200
> > +++ linux-2.6/net/core/dev.c 2018-04-18 16:24:43.000000000 +0200
> > @@ -8366,7 +8366,8 @@ struct net_device *alloc_netdev_mqs(int
> > /* ensure 32-byte alignment of whole construct */
> > alloc_size += NETDEV_ALIGN - 1;
> >
> > - p = kvzalloc(alloc_size, GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> > + WARN_ON(alloc_size > PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER);
> > + p = kzalloc(alloc_size, GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> > if (!p)
> > return NU...
2012 May 25
1
[LLVMdev] alloc_size metadata
...> be general but only handles C". Consider a language with a string type that
> contains the string length as well as the characters. It has a
> library function
> allocate_string(length). How much does it allocate? length+4
> bytes. That can't
> be represented by alloc_size. What's more, it may well store the
> length at the
> start, and return a pointer to just after the length: a pointer to the first
> character. alloc_size can't represent "the allocated memory starts 4 bytes
> before the return value" either. In short, it feels li...
2012 Jun 04
0
[LLVMdev] alloc_size metadata
Hi,
So here is a new proposal:
!0 = metadata !{ alloc_siz_fn, offset_fn, parameters* }
alloc_size_fn and offset_fn are functions that return either i32/i64
depending on the platform, and they must have the same number of
arguments (not necessarily the same as the as allocation function).
The parameters are given in the metadata as well.
To accommodate the common case, offer_fn can be null...
2012 Jun 04
0
[LLVMdev] alloc_size metadata
...istopher <echristo at apple.com>:
> On Jun 4, 2012, at 10:37 AM, Nuno Lopes <nunoplopes at sapo.pt> wrote:
>
>> So here is a new proposal:
>>
>> !0 = metadata !{ alloc_siz_fn, offset_fn, parameters* }
>
> The parameters are a separate metadata array or the alloc_size metadata
> is variable length?
Variable length. I think that's the simplest solution, and the
additional overhead of a separate array is probably not worth it.
> You'll probably want to write up some docs for the website on how this
> is supposed to be laid out and work.
Sure...
2012 May 29
1
[LLVMdev] alloc_size metadata
...ay 2012 17:37:40 +0100
Nuno Lopes <nunoplopes at sapo.pt> wrote:
> >> On 25/05/12 17:22, John Criswell wrote:
> >> > On 5/25/12 2:16 AM, Duncan Sands wrote:
> >> >> Hi John,
> >> >>
> >> >>>>> I'm implementing the alloc_size function attribute in clang.
> >> >>>> does anyone actually use this attribute? And if they do, can
> >> >>>> it really buy them anything? How about "implementing" it by
> >> >>>> ignoring it!
> >> >>>
> &...
2012 May 25
0
[LLVMdev] alloc_size metadata
On Thu, May 24, 2012 at 7:43 PM, John Criswell <criswell at illinois.edu>wrote:
> On 5/24/12 3:51 AM, Duncan Sands wrote:
> > Hi Nuno,
> >
> >> I'm implementing the alloc_size function attribute in clang.
> > does anyone actually use this attribute? And if they do, can it really
> buy
> > them anything? How about "implementing" it by ignoring it!
>
> Tools like ASan and SAFECode *could* use this attribute
A case where this may be useful...
2012 Jul 21
3
Use GPU in R with .Call
...====================
#define THREAD_PER_BLOCK 100
__global__ void VecAdd(double *a,double *b, double *c,int len) {
int idx = threadIdx.x + blockIdx.x * blockDim.x;
if (idx<len){
c[idx] = a[idx] + b[idx];
}
}
void vecAdd_kernel(double *ain,double *bin,double *cout,int len){
int alloc_size;
alloc_size=len*sizeof(double);
/*Step 0a) Make a device copies of ain,bin,and cout.*/
double *a_copy,*b_copy,*cout_copy;
/*Step 0b) Allocate memory for device copies.*/
cudaMalloc(&a_copy,alloc_size);
cudaMalloc(&b_copy,alloc_size);
cudaMalloc(&cou...
2012 Jun 05
0
[LLVMdev] alloc_size metadata
>> Hi,
>>
>> So here is a new proposal:
>>
>> !0 = metadata !{ alloc_siz_fn, offset_fn, parameters* }
>>
>> alloc_size_fn and offset_fn are functions that return either i32/i64
>> depending on the platform, and they must have the same number of
>> arguments (not necessarily the same as the as allocation function).
>> The parameters are given in the metadata as well.
>> To accommodate the com...
2012 Jun 05
3
[LLVMdev] alloc_size metadata
Hi Nuno,
> So here is a new proposal:
>
> !0 = metadata !{ alloc_siz_fn, offset_fn, parameters* }
>
> alloc_size_fn and offset_fn are functions that return either i32/i64
> depending on the platform, and they must have the same number of
> arguments (not necessarily the same as the as allocation function).
> The parameters are given in the metadata as well.
> To accommodate the common case, offer_...
2012 Jun 05
0
[LLVMdev] alloc_size metadata
>> So here is a new proposal:
>>
>> !0 = metadata !{ alloc_siz_fn, offset_fn, parameters* }
>>
>> alloc_size_fn and offset_fn are functions that return either i32/i64
>> depending on the platform, and they must have the same number of
>> arguments (not necessarily the same as the as allocation function).
>> The parameters are given in the metadata as well.
>> To accommodate the com...