[haiku-bugs] Re: [Haiku] #5526: Layout API: Make it FragileBaseClass safe

  • From: "yourpalal" <trac@xxxxxxxxxxxx>
  • Date: Fri, 28 Oct 2011 21:33:54 -0000

#5526: Layout API: Make it FragileBaseClass safe
----------------------------------+----------------------------
   Reporter:  mmadia              |      Owner:  yourpalal
       Type:  enhancement         |     Status:  assigned
   Priority:  blocker             |  Milestone:  R1/beta1
  Component:  Kits/Interface Kit  |    Version:  R1/Development
 Resolution:                      |   Keywords:
 Blocked By:                      |   Blocking:  5524
Has a Patch:  0                   |   Platform:  All
----------------------------------+----------------------------

Comment (by yourpalal):

 Thinking further, I don't think we have anything to gain by switching to
 BObjectList in BLayout.

 So, that means this ticket boils down to:

  * Adding virtual status_t Perform() methods to all relevant classes.
 Currently this is inherited from BArchivable, but none of the layout
 classes implement it.
 * Filling in any other virtual methods that may need to be overridden at a
 later date with stubs of the form
 {{{
 foo
 Bar::Baz()
 {
     return Base::Baz();
 }
 }}}
 * Adding virtual method padding (here are my proposed amounts)
     * 5 for BLayoutItem
     * 10 for BLayout (plus the 5 from BLayoutItem)
     * 5 for BTwoDimensionalLayout -> these are inherited by BGroup/BGrid
 Layout as well, so they probably don't need any of their own
     * BCardLayout/BSplitLayout probably don't need any, I would (mostly)
 considered these to be leaf classes.
 * Adding uint32 padding: Here I think we could give each class about the
 same amount of uint32's as they get in virtual methods. For leaf classes,
 I might add 5 uint32's for good measure.
 * anything else??

 One thing I wonder about is whether it is worth it to modify these numbers
 a bit to get our structures 8 byte-aligned
 or something. My intuition says it probably won't matter, but maybe I'm
 wrong :)

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5526#comment:6>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: