summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-03-22 11:50:40 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-03-22 11:50:40 +0300
commitb02839a6d6327f7f6fec313b355c2c1c18d8be9c (patch)
tree0a50c3e76ec555d0d0210fd1123e849f8fd2c952 /include
parent276a0e7cbc87d4217d7eabf58b3421e5b29f1349 (diff)
downloadbdwgc-b02839a6d6327f7f6fec313b355c2c1c18d8be9c.tar.gz
Move increment of GC_bytes_allocd to GC_alloc_large
(refactoring) * include/private/gc_priv.h (GC_alloc_large): Update comment (mention that GC_bytes_allocd is updated too). * malloc.c (GC_alloc_large_and_clear): Likewise. * include/private/gc_priv.h (GC_allocobj): Rename sz argument to gran; update comment. * malloc.c (GC_alloc_large): Increment GC_bytes_allocd (by rounded lb). * malloc.c (GC_generic_malloc_inner): Reformat code; remove lb_adjusted local variable. * malloc.c (GC_generic_malloc_inner_ignore_off_page, GC_generic_malloc_inner, GC_generic_malloc_aligned): Do not update GC_bytes_allocd. * mallocx.c (GC_generic_malloc_ignore_off_page): Likewise. * malloc.c (GC_generic_malloc_inner_ignore_off_page): Remove op and lb_adjusted local variables. * mallocx.c (GC_generic_malloc_ignore_off_page): Remove lb_rounded local variable.
Diffstat (limited to 'include')
-rw-r--r--include/private/gc_priv.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h
index d3857664..de1af1e9 100644
--- a/include/private/gc_priv.h
+++ b/include/private/gc_priv.h
@@ -2278,8 +2278,8 @@ GC_INNER ptr_t GC_alloc_large(size_t lb, int k, unsigned flags,
/* The flags argument should be IGNORE_OFF_PAGE */
/* or 0. Calls GC_allochblk() to do the actual */
/* allocation, but also triggers GC and/or heap */
- /* expansion as appropriate. Does not update */
- /* GC_bytes_allocd, but does other accounting. */
+ /* expansion as appropriate. Updates value of */
+ /* GC_bytes_allocd; does also other accounting. */
GC_INNER void GC_freehblk(struct hblk * p);
/* Deallocate a heap block and mark it */
@@ -2356,10 +2356,10 @@ GC_INNER void * GC_generic_malloc_inner(size_t lb, int k);
GC_INNER GC_bool GC_collect_or_expand(word needed_blocks,
GC_bool ignore_off_page, GC_bool retry);
-GC_INNER ptr_t GC_allocobj(size_t sz, int kind);
- /* Make the indicated */
- /* free list nonempty, and return its */
- /* head. Sz is in granules. */
+GC_INNER ptr_t GC_allocobj(size_t gran, int kind);
+ /* Make the indicated free list */
+ /* nonempty, and return its head. */
+ /* The size (gran) is in granules. */
#ifdef GC_ADD_CALLER
/* GC_DBG_EXTRAS is used by GC debug API functions (unlike GC_EXTRAS */