summaryrefslogtreecommitdiff
path: root/src/common/malloc.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-19 15:50:41 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-19 15:50:41 +0000
commitb9804183841afd5381069796096a154edb5b9f53 (patch)
tree95e6f70d9ecd43e727d0defe1b02a818bc191169 /src/common/malloc.c
parent3bd682b3cb3507c8a57fa6930475808981fd0663 (diff)
downloadhercules-b9804183841afd5381069796096a154edb5b9f53.tar.gz
hercules-b9804183841afd5381069796096a154edb5b9f53.tar.bz2
hercules-b9804183841afd5381069796096a154edb5b9f53.tar.xz
hercules-b9804183841afd5381069796096a154edb5b9f53.zip
Reformatting @_@
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10581 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/malloc.c')
-rw-r--r--src/common/malloc.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/common/malloc.c b/src/common/malloc.c
index 859b58b5e..eda8c3fdb 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -189,7 +189,8 @@ static void block_free(struct block* p);
static void memmgr_info(void);
static unsigned int memmgr_usage_bytes = 0;
-void* _mmalloc(size_t size, const char *file, int line, const char *func ) {
+void* _mmalloc(size_t size, const char *file, int line, const char *func )
+{
int i;
struct block *block;
size_t size_hash;
@@ -291,13 +292,15 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func ) {
return NULL;
};
-void* _mcalloc(size_t num, size_t size, const char *file, int line, const char *func ) {
+void* _mcalloc(size_t num, size_t size, const char *file, int line, const char *func )
+{
void *p = _mmalloc(num * size,file,line,func);
memset(p,0,num * size);
return p;
}
-void* _mrealloc(void *memblock, size_t size, const char *file, int line, const char *func ) {
+void* _mrealloc(void *memblock, size_t size, const char *file, int line, const char *func )
+{
size_t old_size;
if(memblock == NULL) {
return _mmalloc(size,file,line,func);
@@ -318,7 +321,8 @@ void* _mrealloc(void *memblock, size_t size, const char *file, int line, const c
}
}
-char* _mstrdup(const char *p, const char *file, int line, const char *func ) {
+char* _mstrdup(const char *p, const char *file, int line, const char *func )
+{
if(p == NULL) {
return NULL;
} else {
@@ -329,7 +333,8 @@ char* _mstrdup(const char *p, const char *file, int line, const char *func ) {
}
}
-void _mfree(void *ptr, const char *file, int line, const char *func ) {
+void _mfree(void *ptr, const char *file, int line, const char *func )
+{
struct unit_head *head;
size_t size_hash;
@@ -420,7 +425,8 @@ void _mfree(void *ptr, const char *file, int line, const char *func ) {
}
/* 現在の状況を表示する */
-static void memmgr_info(void) {
+static void memmgr_info(void)
+{
int i;
struct block *p;
ShowInfo("** Memory Manager Information **\n");
@@ -461,7 +467,8 @@ static void memmgr_info(void) {
}
/* ブロックを確保する */
-static struct block* block_malloc(void) {
+static struct block* block_malloc(void)
+{
if(block_unused != NULL) {
/* ブロック用の領域は確保済み */
struct block* ret = block_unused;
@@ -523,7 +530,8 @@ static struct block* block_malloc(void) {
}
}
-static void block_free(struct block* p) {
+static void block_free(struct block* p)
+{
/* free() せずに、未使用フラグを付けるだけ */
p->unit_size = 0;
/* 未使用ポインターを更新する */