|
| From: | Rik |
| Subject: | [Octave-bug-tracker] [bug #59192] unwind_protect objects should be replaced with lighter weight alternatives |
| Date: | Sun, 27 Sep 2020 22:46:37 -0400 (EDT) |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36 |
Update of bug #59192 (project octave):
Status: None => In Progress
Summary: unwind_protect objects should accept lambda
expressions => unwind_protect objects should be replaced with lighter weight
alternatives
_______________________________________________________
Follow-up Comment #7:
The unwind_action definitely seems like the best code construct for this
particular use. I took jwe's patch and made it slightly simpler with the use
of 'auto'. I also renamed some of the variables to attempt to make clear what
is going on. I checked things in here:
http://hg.savannah.gnu.org/hgweb/octave/rev/d28016d16e9a.
I re-titled this bug report. Using grep I made a list of the unwind_protect
and unwind_protect_safe occurrences in libinterp. There are 113 instances.
The list is attached.
I did a spot check on one instance in __eigs__.cc and the code is:
octave::unwind_protect frame;
frame.protect_var (call_depth);
This could be replaced with unwind_protect_var very simply. I expect a lot of
the others could also be replaced.
Besides changing any occurrences in core, we could mark the class, as we do
with OCTAVE_DEPRECATED macro, so that it produces a warning during
compilation. This would be a quick way to find all instances in the code
remaining after the first round of fixing on the list I generated.
(file #49874)
_______________________________________________________
Additional Item Attachment:
File name: uprotect.list Size:6 KB
<https://file.savannah.gnu.org/file/uprotect.list?file_id=49874>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59192>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
| [Prev in Thread] | Current Thread | [Next in Thread] |