[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
- Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?,
Rik <=
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, John W. Eaton, 2017/07/18
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, Rik, 2017/07/19
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, John W. Eaton, 2017/07/19
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, Rik, 2017/07/20
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, John W. Eaton, 2017/07/20
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, Rik, 2017/07/21
- Message not available
- Message not available
- Message not available
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, Daniel J Sebald, 2017/07/21
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, Daniel J Sebald, 2017/07/23
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, John W. Eaton, 2017/07/21
- Re: Replace OCTAVE_LOCAL_BUFFER implementation with std::unique_ptr?, Mike Miller, 2017/07/21