This is the mail archive of the gcc-patches@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: Patch: convenience routines for hashtab.c


>>>>> "Horst" == Horst von Brand <vonbrand@sleipnir.valparaiso.cl> writes:

    Horst> This way, you loose the last 3 bits, which are very likely
    Horst> to be zeroes anyway

That's a good observation.

But it's not always true -- pointers inside structures, strings,
etc. generally don't obey this rule.  Objects allocated by ggc_alloc
are only four-byte aligned in some cases.

Profiling is key here.  If we're seeing lots of time in hashing, and
we observe that to be due to the low-order bits being zero, then we
should definitely do this.  Otherwise, I think we should just leave
the code as simple as possible.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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