From 31fad5846516ee1e6135bd35f0478b93928a3759 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 15 Jul 2021 18:39:41 +0200 Subject: url-mode: use shm_get_many() If we have lots of URLs, we use up a *lot* of SHM buffers (and thus pools). Each and every one is a single mmap(), of at least 4K. Since all URL labels are created and destroyed at the same time, it makes sense to use a single pool for all buffers. To do this, we must now do two passes; first one to generate the actual string (label content), and to calculate the label sizes. Then we use this information to allocate all SHM buffers at once, from the same pool. Finally, we iterate the URLs again, this time to actually render them. --- url-mode.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'url-mode.c') diff --git a/url-mode.c b/url-mode.c index 524b8d1b..a802cc6c 100644 --- a/url-mode.c +++ b/url-mode.c @@ -14,7 +14,6 @@ #include "grid.h" #include "render.h" #include "selection.h" -#include "shm.h" #include "spawn.h" #include "terminal.h" #include "uri.h" @@ -738,9 +737,7 @@ urls_reset(struct terminal *term) if (term->window != NULL) { tll_foreach(term->window->urls, it) { - const struct url *url = it->item.url; wayl_win_subsurface_destroy(&it->item.surf); - shm_purge(term->wl->shm, shm_cookie_url(url)); tll_remove(term->window->urls, it); } } -- cgit v1.3