equal
deleted
inserted
replaced
|
1 /* $Id$ */ |
|
2 |
|
3 /** @file alloc_func.cpp functions to 'handle' memory allocation errors */ |
|
4 |
|
5 #include "../stdafx.h" |
|
6 #include "alloc_func.hpp" |
|
7 |
|
8 /** |
|
9 * Function to exit with an error message after malloc() or calloc() have failed |
|
10 * @param size number of bytes we tried to allocate |
|
11 */ |
|
12 void MallocError(size_t size) |
|
13 { |
|
14 error("Out of memory. Cannot allocate %i bytes", size); |
|
15 } |
|
16 |
|
17 /** |
|
18 * Function to exit with an error message after realloc() have failed |
|
19 * @param size number of bytes we tried to allocate |
|
20 */ |
|
21 void ReallocError(size_t size) |
|
22 { |
|
23 error("Out of memory. Cannot reallocate %i bytes", size); |
|
24 } |