octave-maintainers
[Top][All Lists]
Advanced

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

Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?


From: John W. Eaton
Subject: Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?
Date: Tue, 18 Jul 2017 14:30:59 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 07/18/2017 01:41 PM, Rik wrote:
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

I'd be in favor of doing that. It's been discussed before and we this open bug report:

  https://savannah.gnu.org/bugs/?48793

jwe




reply via email to

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