Reuse the empty character structure to save memory and processing time
See original GitHub issueRight now on resize the line is filled with “empty” characters which pad the row, these are then cut from the row if the resize reduces columns.
A better way to handle this would be to have a single “padding” char which is not added to the rows but instead used to fill in the rows if a row’s size is less than Terminal.cols
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Memory allocation for char array - Stack Overflow
I want to create an array of chars and I don't know yet what size it will be. I want to write something...
Read more >Dynamic Memory Allocation and Fragmentation in C and C++
In C, dynamic memory is allocated from the heap using some standard library functions. The two key dynamic memory functions are malloc() and...
Read more >C++ Tutorial: Memory Allocation - 2020 - BogoToBogo
A variable is deallocated when the system reclaims the memory from the variable, so it no longer has an area to store its...
Read more >4. Optimize String Use: A Case Study - Optimized C++ [Book]
If the string variable referenced by result is empty, then the call to reserve() allocates storage for enough characters. If the string variable...
Read more >Archived | Building your own memory manager for C/C++ ...
This tutorial demystifies memory management concepts by telling you how to create your ... Modified data structure to store Complex* with no extra...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would have to test it but the idea would be to always assume rows are
this.cols
in length and if it’s not found, assume it’s the empty character. If you have a good test case for your concern let me know.I think the structure should stay the same, just not create so many nbsp character arrays.