summaryrefslogtreecommitdiff
path: root/mallocx.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2008-10-28 00:42:29 +0000
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 21:06:43 +0400
commite637f6ab757ec031eefc2e07af254a4198f5da7a (patch)
tree8b2fbc85eace0cb5239843b2f8de1ab29c224515 /mallocx.c
parentd60024dba01d3a856a4cd7d99f34b7ee52f5318a (diff)
downloadbdwgc-e637f6ab757ec031eefc2e07af254a4198f5da7a.tar.gz
2008-10-27 Hans Boehm <Hans.Boehm@hp.com>
* win32_threads.c (GC_get_stack_min, GC_may_be_in_stack): Add one entry VirtualQuery cache, I_HOLD_LOCK assertions. (GC_push_stack_for, GC_get_next_stack) : Hopefully fix WINCE support. 2008-10-27 Hans Boehm <Hans.Boehm@hp.com> (Thanks to Klaus Treichel.) * finalize.c (GC_general_register_disappearing_link): Add assertion. * malloc.c (GC_generic_malloc): Round lb to granules, not words. * mallocx.c (GC_generic_malloc_ignore_off_page): Round lb to granules, not words.
Diffstat (limited to 'mallocx.c')
-rw-r--r--mallocx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mallocx.c b/mallocx.c
index a289ade0..b010bccb 100644
--- a/mallocx.c
+++ b/mallocx.c
@@ -167,7 +167,7 @@ void * realloc(void * p, size_t lb)
void * GC_generic_malloc_ignore_off_page(size_t lb, int k)
{
void *result;
- size_t lw;
+ size_t lg, lw;
size_t lb_rounded;
word n_blocks;
GC_bool init;
@@ -175,8 +175,9 @@ void * GC_generic_malloc_ignore_off_page(size_t lb, int k)
if (SMALL_OBJ(lb))
return(GC_generic_malloc((word)lb, k));
- lw = ROUNDED_UP_WORDS(lb);
- lb_rounded = WORDS_TO_BYTES(lw);
+ lg = ROUNDED_UP_GRANULES(lb);
+ lw = GRANULES_TO_WORDS(lg);
+ lb_rounded = GRANULES_TO_BYTES(lg);
n_blocks = OBJ_SZ_TO_BLOCKS(lb_rounded);
init = GC_obj_kinds[k].ok_init;
if (GC_have_errors) GC_print_all_errors();