octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?


From: Rik
Subject: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?
Date: Tue, 18 Jul 2017 10:41:34 -0700

7/18/17

jwe,

In the goal of simplifying the code base and relying more on standard
libraries rather than handspun code, would it make sense to replace the
implementation of octave_local_buffer with std::unique_ptr
(http://www.cplusplus.com/reference/memory/unique_ptr/)?  The purpose of
unique_ptr is to provide an efficient garbage collection mechanism for the
managed pointer such that when the unique_ptr object goes out of scope,
either due to reaching the end of a function or because an exception has
been triggered, any allocated memory is released.

Seems like it would be simple to keep the OCTAVE_LOCAL_BUFFER macro for the
moment but just change the implementation to use unique_ptr. 

--Rik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]