Quick question about oct files and OCTAVE_LOCAL_BUFFER
David Bateman
David.Bateman at motorola.com
Fri Aug 29 05:11:21 CDT 2008
john.2.tomlinson at bt.com wrote:
>
> Hello all
>
> I am working on some code that is written in 'C' and calling this code
> from Octave. Within the 'C' code I am allocating memory using
> OCTAVE_LOCAL_BUFFER. Can the group just confirm that I do not need to
> do anything to free this memory when the function finishes?
>
> Sorry for the rather newbie question - I get a little nervous not
> freeing memory after programming 'C/C++' for 15 years.
>
> John Tomlinson.
> Ipswich, UK
>
In C++ it typically uses the std::vector<T> class for allocation of the
memory and yes in C++ when the variable goes out of scope it will be
deleted. However, in C you can't use OCTAVE_LOCAL_BUFFER. Do you mean
you are using C++ and not C?
D.
--
David Bateman David.Bateman at motorola.com
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
More information about the Help-octave
mailing list