Changeset 539

Show
Ignore:
Timestamp:
08/17/09 09:09:10 (15 years ago)
Author:
vbarta
Message:

improved formatting

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/doc/local/memory_management.dox

    r533 r539  
    11/*! 
    2 \page Memory Management in BDM 
     2\page memory_management Memory Management in BDM 
    33 
    44C++ memory management is notoriously flexible, allowing a wide range 
     
    3333library aims to provide the minimal exception safety (that is, 
    3434throwing an exception doesn't crash and doesn't leak any resources) 
    35 for all thrown exceptions \b except \b memory errors - when a program 
     35for all thrown exceptions \b except memory errors - when a program 
    3636using BDM exhausts memory, it should be terminated as soon as possible 
    3737(and in most cases it has probably already terminated by 
    3838itself). Specific exceptions may provide stronger guarantees, as 
    39 documented for specific cases. All exceptions thrown outside the 
     39documented for specific cases. All exceptions thrown out of the 
    4040library are descendants of std::exception. 
    4141 
     
    5252std::tr1:shared_ptr (which is planned to replace bdm::shared_ptr once 
    5353it becomes widely available). Note that objects allocated on the stack 
    54 \b must not \b have their addresses passed to shared_ptr - that is a 
     54\b must \b not have their addresses passed to shared_ptr - that is a 
    5555bug leading to intermittent runtime errors. 
    5656 
     
    6161 
    6262\code 
    63 // egamma_ptr is typedef for object_ptr<egamma>, whose default 
    64 // constructor calls new egamma() 
     63/* 
     64 egamma_ptr is typedef for object_ptr<egamma>, whose default 
     65 constructor calls new egamma() 
     66*/ 
    6567egamma_ptr eG;  
    6668eG->set_parameters ( a, b ); 
     
    6971Coms ( 0 ) = eG; // object_ptr<T> is derived from shared_ptr<T> 
    7072 
    71 // The egamma instance doesn't leak: if the shared_ptr instance which 
    72 // wraps it isn't assigned to anything else, the pointer is deleted by 
    73 // the destructor of either object_ptr, or Array, whichever runs last. 
     73/* 
     74 The egamma instance doesn't leak: if the shared_ptr instance which 
     75 wraps it isn't assigned to anything else, the pointer is deleted by 
     76 the destructor of either object_ptr, or Array, whichever runs last. 
     77*/ 
    7478\endcode 
    7579 
     
    8690 
    8791\code 
    88 // the pointer must stay valid for the lifetime of the object 
     92/* the pointer must stay valid for the lifetime of the object */ 
    8993CurrentContext ( const char *name, int idx ); 
    9094\endcode 
     
    108112 
    109113\code 
    110 //! Returns the stored pointer (which remains owned by this 
    111 //! instance). 
     114/* 
     115 Returns the stored pointer (which remains owned by this 
     116 instance). 
     117*/ 
    112118T *get(); 
    113119\endcode