Gitweb links: ...log http://git.netsurf-browser.org/netsurf.git/shortlog/a9990ebedb8f24205162a5b1f41a3282c0386e1c ...commit http://git.netsurf-browser.org/netsurf.git/commit/a9990ebedb8f24205162a5b1f41a3282c0386e1c ...tree http://git.netsurf-browser.org/netsurf.git/tree/a9990ebedb8f24205162a5b1f41a3282c0386e1c
The branch, jmb/bm has been updated via a9990ebedb8f24205162a5b1f41a3282c0386e1c (commit) from bbd2502eded1e39f8fa1b46a02b4ea3d297d52bd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a9990ebedb8f24205162a5b1f41a3282c0386e1c commit a9990ebedb8f24205162a5b1f41a3282c0386e1c Author: John-Mark Bell <j...@netsurf-browser.org> Commit: John-Mark Bell <j...@netsurf-browser.org> HTML: bump initial queue size; tweak allocation strategy diff --git a/content/handlers/html/box/manager.c b/content/handlers/html/box/manager.c index 092a4c7ef..2da6bc285 100644 --- a/content/handlers/html/box/manager.c +++ b/content/handlers/html/box/manager.c @@ -147,12 +147,15 @@ box_manager_capture_event(box_manager *mgr, dom_event *evt) dom_event_target *target = NULL; if (mgr->pending_queue_idx == mgr->pending_queue_slots) { + size_t slots; dom_node **tmp; if (mgr->pending_queue == NULL) { - tmp = malloc(sizeof(*tmp) * 32); + slots = 1024; + tmp = malloc(sizeof(*tmp) * slots); } else { + slots = mgr->pending_queue_slots * 2; tmp = realloc(mgr->pending_queue, - sizeof(*tmp) * (mgr->pending_queue_slots + 32)); + sizeof(*tmp) * slots); } if (tmp == NULL) { /* ENOMEM, but no way to deal with it? */ @@ -160,7 +163,7 @@ box_manager_capture_event(box_manager *mgr, dom_event *evt) } mgr->pending_queue = tmp; - mgr->pending_queue_slots += 32; + mgr->pending_queue_slots = slots; } exc = dom_event_get_target(evt, &target); ----------------------------------------------------------------------- Summary of changes: content/handlers/html/box/manager.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/content/handlers/html/box/manager.c b/content/handlers/html/box/manager.c index 092a4c7ef..2da6bc285 100644 --- a/content/handlers/html/box/manager.c +++ b/content/handlers/html/box/manager.c @@ -147,12 +147,15 @@ box_manager_capture_event(box_manager *mgr, dom_event *evt) dom_event_target *target = NULL; if (mgr->pending_queue_idx == mgr->pending_queue_slots) { + size_t slots; dom_node **tmp; if (mgr->pending_queue == NULL) { - tmp = malloc(sizeof(*tmp) * 32); + slots = 1024; + tmp = malloc(sizeof(*tmp) * slots); } else { + slots = mgr->pending_queue_slots * 2; tmp = realloc(mgr->pending_queue, - sizeof(*tmp) * (mgr->pending_queue_slots + 32)); + sizeof(*tmp) * slots); } if (tmp == NULL) { /* ENOMEM, but no way to deal with it? */ @@ -160,7 +163,7 @@ box_manager_capture_event(box_manager *mgr, dom_event *evt) } mgr->pending_queue = tmp; - mgr->pending_queue_slots += 32; + mgr->pending_queue_slots = slots; } exc = dom_event_get_target(evt, &target); -- NetSurf Browser _______________________________________________ netsurf-commits mailing list -- netsurf-commits@netsurf-browser.org To unsubscribe send an email to netsurf-commits-le...@netsurf-browser.org