summaryrefslogtreecommitdiff
path: root/src/common/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/malloc.c')
-rw-r--r--src/common/malloc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/common/malloc.c b/src/common/malloc.c
index ff71a2c5e..414770156 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -18,7 +18,7 @@ void* aMalloc_(size_t size, const char *file, int line, const char *func)
// ShowMessage("%s:%d: in func %s: aMalloc %d\n",file,line,func,size);
if (ret == NULL){
ShowFatalError("%s:%d: in func %s: aMalloc error out of memory!\n",file,line,func);
- exit(1);
+ exit(EXIT_FAILURE);
}
return ret;
@@ -29,7 +29,7 @@ void* aMallocA_(size_t size, const char *file, int line, const char *func)
// ShowMessage("%s:%d: in func %s: aMallocA %d\n",file,line,func,size);
if (ret == NULL){
ShowFatalError("%s:%d: in func %s: aMallocA error out of memory!\n",file,line,func);
- exit(1);
+ exit(EXIT_FAILURE);
}
return ret;
@@ -40,7 +40,7 @@ void* aCalloc_(size_t num, size_t size, const char *file, int line, const char *
// ShowMessage("%s:%d: in func %s: aCalloc %d %d\n",file,line,func,num,size);
if (ret == NULL){
ShowFatalError("%s:%d: in func %s: aCalloc error out of memory!\n", file, line, func);
- exit(1);
+ exit(EXIT_FAILURE);
}
return ret;
}
@@ -50,7 +50,7 @@ void* aCallocA_(size_t num, size_t size, const char *file, int line, const char
// ShowMessage("%s:%d: in func %s: aCallocA %d %d\n",file,line,func,num,size);
if (ret == NULL){
ShowFatalError("%s:%d: in func %s: aCallocA error out of memory!\n",file,line,func);
- exit(1);
+ exit(EXIT_FAILURE);
}
return ret;
}
@@ -60,7 +60,7 @@ void* aRealloc_(void *p, size_t size, const char *file, int line, const char *fu
// ShowMessage("%s:%d: in func %s: aRealloc %p %d\n",file,line,func,p,size);
if (ret == NULL){
ShowFatalError("%s:%d: in func %s: aRealloc error out of memory!\n",file,line,func);
- exit(1);
+ exit(EXIT_FAILURE);
}
return ret;
}
@@ -70,7 +70,7 @@ char* aStrdup_(const char *p, const char *file, int line, const char *func)
// ShowMessage("%s:%d: in func %s: aStrdup %p\n",file,line,func,p);
if (ret == NULL){
ShowFatalError("%s:%d: in func %s: aStrdup error out of memory!\n", file, line, func);
- exit(1);
+ exit(EXIT_FAILURE);
}
return ret;
}
@@ -227,7 +227,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
return (char *)p + sizeof(struct unit_head_large) - sizeof(int);
} else {
ShowFatalError("Memory manager::memmgr_alloc failed (allocating %d+%d bytes at %s:%d).\n", sizeof(struct unit_head_large), size, file, line);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
@@ -288,7 +288,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
// ここに来てはいけない。
ShowFatalError("Memory manager::memmgr_malloc() serious error (allocating %d+%d bytes at %s:%d)\n", sizeof(struct unit_head_large), size, file, line);
memmgr_info();
- exit(1);
+ exit(EXIT_FAILURE);
//return NULL;
};
@@ -485,14 +485,14 @@ static struct block* block_malloc(void)
char *pb = (char *)CALLOC(sizeof(struct block),BLOCK_ALLOC+1,file,line,func);
if(pb == NULL) {
ShowFatalError("Memory manager::block_alloc failed.\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
// store original block address in chunk
chunk = (struct chunk *)MALLOC(sizeof(struct chunk),file,line,func);
if (chunk == NULL) {
ShowFatalError("Memory manager::block_alloc failed.\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
chunk->block = pb;
chunk->next = (chunk_first) ? chunk_first : NULL;