hintonda added inline comments.

================
Comment at: include/lldb/Utility/FileSpec.h:65-69
+  enum PathSyntax : unsigned char {
     ePathSyntaxPosix,
     ePathSyntaxWindows,
     ePathSyntaxHostNative
   };
----------------
zturner wrote:
> hintonda wrote:
> > zturner wrote:
> > > This is actually a very nice change, as it reduces the size of `FileSpec` 
> > > by a couple of bytes.  I think you can submit this change as a one-liner 
> > > by itself, independent of this patch.
> > I suppose it depends on you compiler/OS, but this by it self doesn't change 
> > the size of FileSpec at all -- just changes the padding from 3 to 6.  It's 
> > still the size of 3 pointers due to alignment -- at least that's my 
> > understanding.
> > 
> > However, if you did have a way to encode this stuff into the two existing 
> > pointers, it might help -- you still need at least 4 bits if I'm not 
> > mistaken.
> It's possible for `sizeof(int)` to be equal to the size of a pointer.  This 
> happens **always** when building x86, but it can happen on x64 too.  [[ 
> https://godbolt.org/g/GN91oZ | For example ]].  Note that it returns 12.  If 
> you remove the specification of the underlying type, it returns 16 instead.
> 
You're absolutely correct.  I don't do much on 32 bit, but this would 
definitely help when compiling with -m32.

Good catch...


https://reviews.llvm.org/D39436



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to