return buf;
}
-
-
-
-
-
-
void*
myrealloc_file_line(void *ptr, size_t newsize, char* file, int line) {
char *buf;
return buf;
}
-
-
-
static
void
bndcheck(int idx) {
mymalloc(int size) {
void *buf;
+ if (size < 0) {
+ fprintf(stderr, "Attempt to allocate size %d\n", size);
+ exit(3);
+ }
+
if ( (buf = malloc(size)) == NULL ) {
mm_log((1, "mymalloc: unable to malloc %d\n", size));
fprintf(stderr,"Unable to malloc %d.\n", size); exit(3);