summaryrefslogtreecommitdiff
path: root/src/common/malloc.h
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-27 06:38:17 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-27 06:38:17 +0000
commit3c8999edce9e1f0d5c0dee3ff8311e781d64c684 (patch)
treed066567a720e5fad02e6f857d55bc165d9a3809a /src/common/malloc.h
parentea320701794515d4ffa6a8e8ff8f3b8fdfe09860 (diff)
downloadhercules-3c8999edce9e1f0d5c0dee3ff8311e781d64c684.tar.gz
hercules-3c8999edce9e1f0d5c0dee3ff8311e781d64c684.tar.bz2
hercules-3c8999edce9e1f0d5c0dee3ff8311e781d64c684.tar.xz
hercules-3c8999edce9e1f0d5c0dee3ff8311e781d64c684.zip
* Optional macro MEMSET_TURBO for faster low-level memory initializations.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8499 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/malloc.h')
-rw-r--r--src/common/malloc.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/common/malloc.h b/src/common/malloc.h
index e9dbb9d44..d3df667a6 100644
--- a/src/common/malloc.h
+++ b/src/common/malloc.h
@@ -4,6 +4,8 @@
#ifndef _MALLOC_H_
#define _MALLOC_H_
+//#define MEMSET_TURBO
+
#ifndef __NETBSD__
#if __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
@@ -147,6 +149,22 @@
////////////////////////////////////////////////
unsigned int malloc_usage (void);
+#ifndef INLINE
+ #ifdef _WIN32
+ #define INLINE
+ #else
+ #define INLINE inline
+ #endif
+#endif
+#ifdef MEMSET_TURBO
+ INLINE void malloc_tsetdword(void *dest, int value, int count);
+ INLINE void malloc_tsetword(void *dest, short value, int count);
+ INLINE void malloc_set(void *dest, int value, int size);
+#else
+ #define malloc_tsetdword(x,y,z) memset(x,y,z)
+ #define malloc_tsetword(x,y,z) memset(x,y,z)
+ #define malloc_set(x,y,z) memset(x,y,z)
+#endif
void malloc_init (void);
void malloc_final (void);