Round 2 Code Review request for new MallocMaxTestWords option and fixed test (7030610, 7037122, 7123945)
Coleen Phillimore
coleen.phillimore at oracle.com
Mon Mar 18 19:37:02 PDT 2013
Hi Ron, I was looking at this again and I like David's suggestion for
moving this to a new function, like below. Can you make this change
too? A lot of us do look at os::malloc() function so having it easier
to read would be beneficial.
thanks,
Coleen
On 3/18/2013 9:43 PM, Coleen Phillimore wrote:
>>>> Otherwise seems functionally ok but I really hate to see test-only
>>>> code being injected into a primary execution path like this. Why
>>>> not move it off to the side:
>>>>
>>>> if (MallocMaxTestWords > 0)
>>>> return testMalloc(alloc_size);
>>>>
>>>> and have
>>>>
>>>> void* testMalloc(size_t alloc_size) {
>>>> if (!check_malloc_max_test_words(alloc_size)) return NULL;
>>>> u_char* ptr = (u_char*)::malloc(alloc_size);
>>>> add_current_malloc_test_words(alloc_size, ptr);
>>>> return ptr;
>>>> }
>>
>> BTW you would of course just inline those other methods.
More information about the hotspot-runtime-dev
mailing list