mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-13 08:21:03 -04:00
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.
This commit is contained in:
parent
7533684d8f
commit
31fad58465
3 changed files with 79 additions and 17 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue