help-octave
[Top][All Lists]
Advanced

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

Re: Octave Memory Management


From: Thomas D. Dean
Subject: Re: Octave Memory Management
Date: Sun, 18 Aug 2019 14:32:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 8/18/19 11:36 AM, Sebastian Schöps wrote:
Thomas D. Dean-2 wrote
I have an .oct file that I want to open a device, return the pointer to
the device structure.

...

Does octave keep the allocation of dev_ptr between function calls?

Is it possible to use a static variable in the .cc file?  Would I have
to free it when the device is closed?

I can post the full application if necessary.

Tom Dean

Maybe Carlo‘s old advice helps?
https://octave.1599824.n4.nabble.com/Persistent-dara-across-oct-files-tp4689039.html

Seb.

Carlo's answer is static variables.

That gets me mostly there.  I am opening a USB device.

A clear("all") most likely destroys the instance of the static variable.
A subsequent call to the function results in
   usb_claim_interface error -6

This most likely results in a memory leak of the size of a device structure.

Is there any way to implement a "call on clear" or
"call on function removal" function.  Sort of like a device callback
function?  Google is not much help.

Tom Dean


reply via email to

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