Use shrink_to_fit() to save memory space
This commit is contained in:
parent
ec502d208a
commit
83fbc0a4f5
|
@ -1,5 +1,6 @@
|
|||
2019-04-27 Markus Gans <guru.mail@muenster.de>
|
||||
* Add the reserve() method to FListBox to increase the capacity of the list
|
||||
* Use shrink_to_fit() to save memory space
|
||||
|
||||
2019-03-24 Markus Gans <guru.mail@muenster.de>
|
||||
* Add a "scroll view" chapter to the first steps document
|
||||
|
|
|
@ -444,6 +444,7 @@ void FFileDialog::clear()
|
|||
std::free (entry.name);
|
||||
|
||||
dir_entries.clear();
|
||||
dir_entries.shrink_to_fit();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -286,6 +286,7 @@ void FListBox::clear()
|
|||
{
|
||||
std::size_t size;
|
||||
itemlist.clear();
|
||||
itemlist.shrink_to_fit();
|
||||
current = 0;
|
||||
xoffset = 0;
|
||||
yoffset = 0;
|
||||
|
|
|
@ -93,6 +93,7 @@ void FMenuList::remove (int pos)
|
|||
void FMenuList::clear()
|
||||
{
|
||||
item_list.clear();
|
||||
item_list.shrink_to_fit();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -359,6 +359,7 @@ bool FObject::delAllTimer()
|
|||
|
||||
timer_modify_lock = true;
|
||||
timer_list->clear();
|
||||
timer_list->shrink_to_fit();
|
||||
timer_modify_lock = false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -306,6 +306,7 @@ void FStatusBar::remove (int pos)
|
|||
void FStatusBar::clear()
|
||||
{
|
||||
key_list.clear();
|
||||
key_list.shrink_to_fit();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -274,6 +274,7 @@ void FTextView::clear()
|
|||
{
|
||||
std::size_t size;
|
||||
data.clear();
|
||||
data.shrink_to_fit();
|
||||
xoffset = 0;
|
||||
yoffset = 0;
|
||||
maxLineWidth = 0;
|
||||
|
|
|
@ -151,7 +151,10 @@ inline bool FTermBuffer::isEmpty() const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
inline void FTermBuffer::clear()
|
||||
{ data.clear(); }
|
||||
{
|
||||
data.clear();
|
||||
data.shrink_to_fit();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
inline FTermBuffer& FTermBuffer::write()
|
||||
|
|
Loading…
Reference in New Issue