Skip to content
  • mark's avatar
    025eebca
    ENH: provide direct access to raw pointer/reference from autoPtr (issue #252) · 025eebca
    mark authored and Mark OLESEN's avatar Mark OLESEN committed
    All of the access methods for autoPtr include validity checks and will
    fail if the underlying point is NULL. In some cases, however, we'd
    like to retain the automatic deletion mechanism, but still address a
    nullptr. This is mostly for cases in which a file-stream should be
    allocated, but only on the master process. For these cases we'd still
    like to pass through and reference the underlying pointer (eg, to
    obtain the correct method call) without tripping the pointer check
    mechanism. If we attempt to use the ptr() method, the autoPtr memory
    management is bypassed and we risk memory leaks.
    
    Instead provide an alternative mechanism to obtain the raw underlying
    pointers/references. Use rawPtr() and rawRef() for these potentially
    useful, but also potentially dangerous, operations.
    025eebca
    ENH: provide direct access to raw pointer/reference from autoPtr (issue #252)
    mark authored and Mark OLESEN's avatar Mark OLESEN committed
    All of the access methods for autoPtr include validity checks and will
    fail if the underlying point is NULL. In some cases, however, we'd
    like to retain the automatic deletion mechanism, but still address a
    nullptr. This is mostly for cases in which a file-stream should be
    allocated, but only on the master process. For these cases we'd still
    like to pass through and reference the underlying pointer (eg, to
    obtain the correct method call) without tripping the pointer check
    mechanism. If we attempt to use the ptr() method, the autoPtr memory
    management is bypassed and we risk memory leaks.
    
    Instead provide an alternative mechanism to obtain the raw underlying
    pointers/references. Use rawPtr() and rawRef() for these potentially
    useful, but also potentially dangerous, operations.
Loading