lkml.org 
[lkml]   [2010]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] perf: add GCC optimization to memory allocating functions
From
Date
On Fri, 2010-11-26 at 14:27 +0100, Peter Zijlstra wrote:
> On Fri, 2010-11-26 at 10:24 -0300, Davidlohr Bueso wrote:
> > From: Davidlohr Bueso <dave@gnu.org>
> >
> > We can benefit from the alloc_size attribute in xrealloc and zalloc.
>
> What's this alloc_size attribute do?
>
Quoting from http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html:

"The alloc_size attribute is used to tell the compiler that the function
return value points to memory, where the size is given by one or two of
the functions parameters. GCC uses this information to improve the
correctness of __builtin_object_size."



\
 
 \ /
  Last update: 2010-11-26 14:39    [W:0.155 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site