After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748492 - Make ring contain only onscreen contents
Make ring contain only onscreen contents
Status: RESOLVED OBSOLETE
Product: vte
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-26 18:31 UTC by Egmont Koblinger
Modified: 2021-06-10 15:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Egmont Koblinger 2015-04-26 18:31:42 UTC
Currently the ring contains data for 2^N-1 lines (for some N).

Even if we stick to doubling and never freeing the malloced area (for which there's not much reason, since it only happens on resize which is an expensive operation anyways), I think we should only use it for the onscreen data (potentially leaving up to half of the allocated memory unused, who cares).

Instead, every row that leaves the visible part should be immediately sent to the stream.

This would simplify the code and make it robust against potential bugs that only occur at certain window heights.

In particular, the fix to bug 748484 could become way simpler. _vte_ring_reset_streams() wouldn't need to take a "position" parameter and we wouldn't need to move forward with row_stream's head, it could stay the same. In turn, the whole concept of resetting the file stream (or boa or snake) would be gone, it'd be replaced by a special case of advance_tail (where the new tail is the same as the current head).
Comment 1 Behdad Esfahbod 2015-04-26 20:36:01 UTC

The idea for exponential growth is that if you start resizing, we don't have to resize / copy array at every one additional row.

Other than that, your proposal looks good to me.  I believe you had proposed this same thing a while back, but guess you never got to implement it.
Comment 2 Egmont Koblinger 2015-04-26 21:18:00 UTC
Yup I recall having propsed it already (can't remember when & where), but never started working on this. ;)
Comment 3 GNOME Infrastructure Team 2021-06-10 15:03:23 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vte/-/issues/2201.