src/share/vm/runtime/os.cpp

changeset 4280
80e866b1d053
parent 4261
6cb0d32b828b
parent 4277
e4f764ddb06a
child 4299
f34d701e952e
equal deleted inserted replaced
4269:6b6ddf8c4329 4280:80e866b1d053
580 if (size == 0) { 580 if (size == 0) {
581 // return a valid pointer if size is zero 581 // return a valid pointer if size is zero
582 // if NULL is returned the calling functions assume out of memory. 582 // if NULL is returned the calling functions assume out of memory.
583 size = 1; 583 size = 1;
584 } 584 }
585 585 if (size > size + space_before + space_after) { // Check for rollover.
586 return NULL;
587 }
586 NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap()); 588 NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap());
587 u_char* ptr = (u_char*)::malloc(size + space_before + space_after); 589 u_char* ptr = (u_char*)::malloc(size + space_before + space_after);
588 590
589 #ifdef ASSERT 591 #ifdef ASSERT
590 if (ptr == NULL) return NULL; 592 if (ptr == NULL) return NULL;

mercurial