summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-18 18:37:56 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-18 18:37:56 +0000
commit7735e57518a67031d96f62685b51c0ac530b7d45 (patch)
treebafeb80c4ebba2edf4ce0397bec715394a24b01c
parent423dc08401213672973855b70c1e93e94ee1ef0f (diff)
downloadhercules-7735e57518a67031d96f62685b51c0ac530b7d45.tar.gz
hercules-7735e57518a67031d96f62685b51c0ac530b7d45.tar.bz2
hercules-7735e57518a67031d96f62685b51c0ac530b7d45.tar.xz
hercules-7735e57518a67031d96f62685b51c0ac530b7d45.zip
- Changed the memory manager fatal errors when allocating memory to print out the size request as well as the file and line where they originated.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6165 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--src/common/malloc.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index e92086b5c..e443c3e3c 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/04/18
+ * Changed the memory manager fatal errors when allocating memory to print
+ out the size request as well as the file and line where they originated.
+ [Skotlex]
* Fixed the delete_timer (@summons, alchemist plants) not invoking
unit_free, hence causing memory leaks and the like. [Skotlex]
* Applied jA's patch to fix a bug in the scripting engine in regards to
diff --git a/src/common/malloc.c b/src/common/malloc.c
index 1e3af2d40..6ed1668b9 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -257,7 +257,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func ) {
*(int*)((char*)p + sizeof(struct unit_head_large) - sizeof(int) + size) = 0xdeadbeaf;
return (char *)p + sizeof(struct unit_head_large) - sizeof(int);
} else {
- ShowFatalError("Memory manager::memmgr_alloc failed.\n");
+ ShowFatalError("Memory manager::memmgr_alloc failed (allocating %d+%d bytes at %s:%d).\n", sizeof(struct unit_head_large), size, file, line);
exit(1);
}
}
@@ -317,7 +317,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func ) {
}
}
// ここに来てはいけない。
- ShowFatalError("Memory manager::memmgr_malloc() serious error.\n");
+ 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);
return NULL;