projects
/
platform
/
core
/
system
/
sensord.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68e4522
)
Delete the space of queue and vector after use
26/275126/2
author
TaeminYeom
<taemin.yeom@samsung.com>
Tue, 17 May 2022 01:17:36 +0000
(10:17 +0900)
committer
Hyotaek Shim
<hyotaek.shim@samsung.com>
Tue, 17 May 2022 05:39:36 +0000
(
05:39
+0000)
Change-Id: I982e9012adaf815c8f081b7f9e8ac2267f79de18
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
(cherry picked from commit
ff90e89a0f118e04113eec5940b1e4b06aeaef29
)
src/shared/event_loop.cpp
patch
|
blob
|
history
diff --git
a/src/shared/event_loop.cpp
b/src/shared/event_loop.cpp
index 1db808c98eeb8f6ff6100dec7aeaecab3515280c..720687b8c38ab8ab2bb0ee66fe6fb7c5e6d131f6 100644
(file)
--- a/
src/shared/event_loop.cpp
+++ b/
src/shared/event_loop.cpp
@@
-58,7
+58,11
@@
static void release_res()
for (auto &it : channel_handler_release_list)
delete it;
- channel_handler_release_list.clear();
+
+ /* To reduce memory allocation, swap to new data structure.
+ This prevents occasional over-allocation of memory. */
+ std::priority_queue<channel*>().swap(channel_release_queue);
+ std::vector<channel_handler*>().swap(channel_handler_release_list);
}
static gboolean g_io_handler(GIOChannel *ch, GIOCondition condition, gpointer data)