bugGNU nano - Bugs: bug #56522, [Task] change the flags to use an...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #56522: [Task] change the flags to use an array of bytes or shorts instead of bits

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Wed 19 Jun 2019 07:01:14 AM UTC  
 
Severity:  1 - Wish Status:  None
Assigned to:  None Open/Closed:  Open

Wed 19 Jun 2019 07:01:14 AM UTC, original submission:  

Since the beginning, the flags in nano (SMART_HOME, HISTORYLOG, QUICK_BLANK, and so on) have been an array of bits, implemented within an array of four integers.  This means that each SET() and UNSET() requires a read-mask-write cycle instead of each being just a single write.  This is not so bad, because setting and unsetting happen infrequently.  But also the checking of the flag with ISSET() involves a read plus a mask operation, instead of being a single read.

Is saving two nanoseconds per flag check worth it?  For most flags probably not, but...  SOFTWRAP gets checked so often (in the paths that are called often) that it would be nice if this check were quicker.

Benno Schulenberg <bens>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5