LWN.net Logo

Object-oriented design patterns in the kernel, part 1

Object-oriented design patterns in the kernel, part 1

Posted Jun 2, 2011 16:19 UTC (Thu) by juliank (subscriber, #45896)
In reply to: Object-oriented design patterns in the kernel, part 1 by pixelbeat
Parent article: Object-oriented design patterns in the kernel, part 1

> Well by my analysis in the above link, GCC does init the padding to zero.
Did you actually enable optimizations when testing?

> I'd be very interested if there was a counter example in the wild

https://lwn.net/Articles/417989/
https://lwn.net/Articles/417994/


(Log in to post comments)

Object-oriented design patterns in the kernel, part 1

Posted Jun 3, 2011 1:59 UTC (Fri) by pixelbeat (guest, #7440) [Link]

> Did you actually enable optimizations when testing?
That is immaterial as optimizations may zero the padding.
The interesting case to test is the non optimized case.

> https://lwn.net/Articles/417989/
> https://lwn.net/Articles/417994/
They concur with my testing I think.
I.E. only in the case where all members are specified
in the initializer list, is the padding not zeroed.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds