From 3c8999edce9e1f0d5c0dee3ff8311e781d64c684 Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 27 Aug 2006 06:38:17 +0000 Subject: * 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 --- src/common/malloc.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/common/malloc.h') 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); -- cgit v1.2.3-70-g09d2