src/share/vm/runtime/os.cpp

changeset 4277
e4f764ddb06a
parent 4193
716c64bda5ba
child 4280
80e866b1d053
equal deleted inserted replaced
4276:8c413497f434 4277:e4f764ddb06a
574 if (size == 0) { 574 if (size == 0) {
575 // return a valid pointer if size is zero 575 // return a valid pointer if size is zero
576 // if NULL is returned the calling functions assume out of memory. 576 // if NULL is returned the calling functions assume out of memory.
577 size = 1; 577 size = 1;
578 } 578 }
579 579 if (size > size + space_before + space_after) { // Check for rollover.
580 return NULL;
581 }
580 NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap()); 582 NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap());
581 u_char* ptr = (u_char*)::malloc(size + space_before + space_after); 583 u_char* ptr = (u_char*)::malloc(size + space_before + space_after);
582 584
583 #ifdef ASSERT 585 #ifdef ASSERT
584 if (ptr == NULL) return NULL; 586 if (ptr == NULL) return NULL;

mercurial