summaryrefslogtreecommitdiff
path: root/src/common/malloc.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-05-30 22:20:16 -0300
committershennetsind <ind@henn.et>2013-05-30 22:20:16 -0300
commit5a138ceabf08fe0ca75a24306e849ce3f24faef8 (patch)
tree5cc9cae641157e05172f450d84a6fe6d9753b793 /src/common/malloc.c
parent20bdc01fa687b174a732be4483ddea4982d67ce9 (diff)
parentb30c74a7733848f03e5defc238dca0e0cb044470 (diff)
downloadhercules-5a138ceabf08fe0ca75a24306e849ce3f24faef8.tar.gz
hercules-5a138ceabf08fe0ca75a24306e849ce3f24faef8.tar.bz2
hercules-5a138ceabf08fe0ca75a24306e849ce3f24faef8.tar.xz
hercules-5a138ceabf08fe0ca75a24306e849ce3f24faef8.zip
Memory Slasher - May 30 Patch
http://hercules.ws/board/topic/928-memory-slasher-may-30-patch/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/common/malloc.c')
-rw-r--r--src/common/malloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/malloc.c b/src/common/malloc.c
index e98ec770a..372991fbe 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -253,7 +253,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
p->unit_head.block = NULL;
p->unit_head.size = 0;
p->unit_head.file = file;
- p->unit_head.line = line;
+ p->unit_head.line = (unsigned short)line;
p->prev = NULL;
if (unit_head_large_first == NULL)
p->next = NULL;
@@ -327,7 +327,7 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func )
head->block = block;
head->file = file;
- head->line = line;
+ head->line = (unsigned short)line;
head->size = (unsigned short)size;
*(long*)((char*)head + sizeof(struct unit_head) - sizeof(long) + size) = 0xdeadbeaf;
return (char *)head + sizeof(struct unit_head) - sizeof(long);
@@ -426,7 +426,7 @@ void _mfree(void *ptr, const char *file, int line, const char *func )
#ifdef DEBUG_MEMMGR
memset(ptr, 0xfd, block->unit_size - sizeof(struct unit_head) + sizeof(long) );
head->file = file;
- head->line = line;
+ head->line = (unsigned short)line;
#endif
memmgr_assert( block->unit_used > 0 );
if(--block->unit_used == 0) {