6895788: G1: SATB and update buffer allocation code allocates too much space

Fri, 06 Nov 2009 11:10:05 -0800

author
johnc
date
Fri, 06 Nov 2009 11:10:05 -0800
changeset 1519
5f932a151fd4
parent 1486
26f1542097f1
child 1520
0e2d7ae2bc67

6895788: G1: SATB and update buffer allocation code allocates too much space
Summary: The type in the NEW_C_HEAP_ARRRY and FREE_C_HEAP_ARRAY calls in the buffer allocation code was changed from void* to char as the size argument had already been mulitipled by the byte size of an object pointer.
Reviewed-by: ysr, tonyp

src/share/vm/gc_implementation/g1/ptrQueue.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Tue Nov 03 16:43:16 2009 -0800
     1.2 +++ b/src/share/vm/gc_implementation/g1/ptrQueue.cpp	Fri Nov 06 11:10:05 2009 -0800
     1.3 @@ -107,7 +107,7 @@
     1.4      res[0] = NULL;
     1.5      return res;
     1.6    } else {
     1.7 -    return NEW_C_HEAP_ARRAY(void*, _sz);
     1.8 +    return (void**) NEW_C_HEAP_ARRAY(char, _sz);
     1.9    }
    1.10  }
    1.11  
    1.12 @@ -127,7 +127,8 @@
    1.13      assert(_buf_free_list != NULL, "_buf_free_list_sz must be wrong.");
    1.14      void** head = _buf_free_list;
    1.15      _buf_free_list = (void**)_buf_free_list[0];
    1.16 -    FREE_C_HEAP_ARRAY(void*,head);
    1.17 +    FREE_C_HEAP_ARRAY(char, head);
    1.18 +    _buf_free_list_sz --;
    1.19      n--;
    1.20    }
    1.21  }

mercurial