This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: empty function optimizations


> Here is an (probably incomplete, perhaps incorrect) list of vector
> methods that don't depend on the template parameter:
> 
> get_allocator

Sorry.  This function depends on the template parameter _Alloc because of
specialization; for some specializations there is an allocator object in
each vector, for others there is a static allocator object.  But even if
this weren't true, the two versions of this method in the SGI STL are tiny
inline methods.

> begin (2x)
> end
> empty
> front
> back
> 
> So while it is not clear how much that would save, it is certainly
> incorrect that there would be no savings.

Sorry again.  All of the above methods are inline, furthermore, they
are so small that inlining is the correct thing to do even when optimizing
for space.

So it appears that you have identified zero savings.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]