• Clemens Hammacher's avatar
    [managed] Clean up {std::shared_ptr} use · dce80ce2
    Clemens Hammacher authored
    1) Pass {std::shared_ptr} by reference if a copy might not be needed.
       This applies both to accessors as well as constructing methods.
       This change often saves one atomic increment and decrement of the
       internal reference counter.
    2) Use {std::make_shared} directly to improve memory management of the
       {std::shared_ptr}. This saves one dynamic memory allocation on all
       known implementations.
    
    R=titzer@chromium.org
    
    Bug: v8:8834
    Change-Id: I1a951deb135082745885bc981662a8d6d6fb1a71
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1532333Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#60425}
    dce80ce2
managed.h 5.34 KB