Improve error message if malloc or realloc fails.
This commit is contained in:
parent
b660e75504
commit
29c4a2a151
|
|
@ -75,7 +75,8 @@ tmalloc(size_t num)
|
|||
mutex_unlock(&allocMutex);
|
||||
#endif
|
||||
if (!s){
|
||||
fprintf(stderr,"malloc: Internal Error: can't allocate %ld bytes. \n",(long)num);
|
||||
fprintf(stderr, "Error: malloc: can't allocate %lld bytes.\n", (long long)num);
|
||||
fprintf(stderr, " Not enough memory or heap corruption\n");
|
||||
#if defined HAS_WINGUI || defined SHARED_MODULE
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
#else
|
||||
|
|
@ -119,7 +120,8 @@ trealloc(const void *ptr, size_t num)
|
|||
#endif
|
||||
}
|
||||
if (!s) {
|
||||
fprintf(stderr,"realloc: Internal Error: can't allocate %ld bytes.\n", (long)num);
|
||||
fprintf(stderr,"Error: realloc: can't allocate %lld bytes.\n", (long long)num);
|
||||
fprintf(stderr," Not enough memory or heap corruption\n");
|
||||
#if defined HAS_WINGUI || defined SHARED_MODULE
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in New Issue