diff options
Diffstat (limited to 'runtime/klee-libc/calloc.c')
-rw-r--r-- | runtime/klee-libc/calloc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/runtime/klee-libc/calloc.c b/runtime/klee-libc/calloc.c index 30b88b30..1466fc07 100644 --- a/runtime/klee-libc/calloc.c +++ b/runtime/klee-libc/calloc.c @@ -1,16 +1,16 @@ -//===-- calloc.c ----------------------------------------------------------===// +/*===-- calloc.c ----------------------------------------------------------===// // // The KLEE Symbolic Virtual Machine // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // -//===----------------------------------------------------------------------===// +//===----------------------------------------------------------------------===*/ #include <stdlib.h> #include <string.h> -// DWD - I prefer to be internal +/* DWD - I prefer to be internal */ #if 0 void *calloc(size_t nmemb, size_t size) { unsigned nbytes = nmemb * size; @@ -19,7 +19,8 @@ void *calloc(size_t nmemb, size_t size) { memset(addr, 0, nbytes); return addr; } -// Always reallocate. + +/* Always reallocate. */ void *realloc(void *ptr, size_t nbytes) { if(!ptr) return malloc(nbytes); @@ -30,14 +31,14 @@ void *realloc(void *ptr, size_t nbytes) { } unsigned copy_nbytes = klee_get_obj_size(ptr); - //printf("REALLOC: current object = %d bytes!\n", copy_nbytes); + /* printf("REALLOC: current object = %d bytes!\n", copy_nbytes); */ void *addr = malloc(nbytes); if(addr) { - // shrinking + /* shrinking */ if(copy_nbytes > nbytes) copy_nbytes = nbytes; - //printf("REALLOC: copying = %d bytes!\n", copy_nbytes); + /* printf("REALLOC: copying = %d bytes!\n", copy_nbytes); */ memcpy(addr, ptr, copy_nbytes); free(ptr); } |