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

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Tue, 01 Nov 2011 09:11:27 -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 bonefish):

 I'd be a bit more generous with virtual method padding. It's rather cheap,
 since it's only added to the vtable, not to the objects. So 10 slots for
 every polymorphic class (including BAbstractLayout[Item],
 B{Group,Grid}Layout,...) is a good idea, I think. The member padding
 contributes to the object size, so it should be based on how likely
 additions seem. I would add at least add 2 uint32s to every public class
 (except basic ones like BSize and BAlignment), maybe up to 8 or 10.

 Alignment of object sizes isn't necessary. I also wouldn't move to
 BObjectList.

 Further tasks:
  * Override all virtual methods that one might need to override in the
 future (including Perform()). They would just call their base class
 versions, ATM.
  * Add private copy constructor and assignment operator declarations
 (without implementations) where we don't want to allow copying (in most
 classes I guess).

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

Other related posts: