home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,371 of 33,346   
   red floyd to Frank Bergemann   
   Re: Effective C++, 2nd edition, item #10   
   05 Jun 12 21:36:56   
   
   e49e07f4   
   From: no.spam.here@its.invalid   
      
   On 6/5/2012 12:53 PM, Frank Bergemann wrote:   
   > I was going to use (and extend) the described mechanism for managing   
   > dedicated objects - representing unix processes - in shared memory for   
   > use in a fork()-based multi-process model (for process   
   > synchronization, fork()-based because i've to use a non-threadsafe   
   > library). However when adding the mechanism i was thinking: "Well, the   
   > issue #10 deals properly with new/delete for Airplane. But the payload   
   > is in AirplaneRep. And there is no such memory mgt for that class. The   
   > c'tor for Airplane will have to use some   
   > Airplaine::Airplane(...)   
   > : rep(new AirplaneRep(...)   
   > { ...};   
   > So i am lost trying to hold the "real" data in shared memory.   
   > Okay, i will drop this approach and use placement new instead.   
   > But i wonder about the example in item #10.   
   > What's the use in sophisticated memory mgt for a "cheshire cat" class?   
   >   
   >   
   This is not what Item #10 is about.  Operator new() and operator   
   delete() can be overridden globally, or on a per-class basis.   
      
   Item 10 simply says, if you override operator new, then you need   
   to provide an operator delete as well.   
      
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca