summaryrefslogtreecommitdiff
path: root/alloc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-05-02 08:40:38 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-05-02 11:41:39 +0300
commit3af192338fa46b8cd8300eccbcf3a699f84b30f8 (patch)
tree4cf91859eb28cd3a7006c183cd9614799692abb6 /alloc.c
parentacb364c8490ed0d410084c6d8c534e6dd36abacb (diff)
downloadbdwgc-3af192338fa46b8cd8300eccbcf3a699f84b30f8.tar.gz
Do not use integer division in GC_soft_read_dirty
An integer division operation might be slow on some CPU architectures. It should be replaced with a shift operation where possible. The SOFT_VDB algorithm used division and multiplication by the page size. * os_dep.c [SOFT_VDB] (GC_log_pagesize): Define STATIC variable. * os_dep.c (GC_setpagesize): Define in a single place (for Win32 and non-Win32 cases). * os_dep.c [SOFT_VDB] (os2_getpagesize): Define pgsize and log_pgsize local variables; compute GC_log_pagesize value. * os_dep.c [SOFT_VDB] (detect_soft_dirty_supported, soft_set_grungy_pages): Check GC_log_pagesize instead of GC_page_size in assertion; use shift by GC_log_pagesize instead of division (and multiplication) by GC_page_size. * os_dep.c [SOFT_VDB] (pagemap_buffered_read): Add assertion that GC_page_size is non-zero.
Diffstat (limited to 'alloc.c')
0 files changed, 0 insertions, 0 deletions