patchGNU Octave - Patches: patch #10217, interpreter: Avoid string...

 
 

patch #10217: interpreter: Avoid string construction 2

Submitter:  John W. Eaton <jwe>
Submitted:  Wed 22 Jun 2022 01:42:37 PM UTC
   
 
Category:  Core : other Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 28 Feb 2023 02:33:30 PM UTC, comment #2: 

I see now that this patch is also the file avoidstringctors_2.patch attached to patch #10147.  There, I added the comment

I generally dislike returning pointers or references to internal data members, even if they are constant, because it means the programmer needs to ensure that the lifetime of the containing object is longer than the reference to the internal data, and that there are no changes to the containing object that will invalidate the reference or change the value that it refers to unexpectedly.  It seems to me that it is easy to miss details like this when refactoring code in the future, and that can lead to hard to find bugs.  To me, the possible maintenance issues outweigh the performance gains.  Maybe there is another way to do this job that doesn't have the possible maintenance issues?

John W. Eaton <jwe>
Group administrator
Tue 28 Feb 2023 11:31:34 AM UTC, comment #1: 

Updated patch attached.

(file #54402)

Arun Giridhar <arungiridhar>
Group Member
Wed 22 Jun 2022 01:42:37 PM UTC, original submission:  

From Petter Tomner <petter>, extracted from the zip file attached to the following comment in the discourse thread "WIP stack VM f\
or Octave": https://octave.discourse.group/t/wip-stack-vm-for-octave/2884/10

const string references instead of copies.

John W. Eaton <jwe>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #54402:  new_30599.patch added by arungiridhar (4KiB - text/x-patch)
file #53335:  octave_30599.patch added by jwe (5KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arungiridhar (Updated the item)
  • -email is unavailable- added by jwe (Submitted the item)
  • -email is unavailable- added by jwe
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-02-28 arungiridhar Attached File- Added new_30599.patch, #54402
    2022-06-22 jwe Attached File- Added octave_30599.patch, #53335
        Carbon-Copy- Added petter

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code