diff options
author | skidd13 <skidd13@openttd.org> | 2008-06-22 15:21:51 +0000 |
---|---|---|
committer | skidd13 <skidd13@openttd.org> | 2008-06-22 15:21:51 +0000 |
commit | 640e5478862e3b83d85db6332e0d82a45a95e4ed (patch) | |
tree | 8904cbdb49b1373360cba22af59cfdea4811c6de /src/core/alloc_type.hpp | |
parent | 31b002dab0cb1bcbc00c9982a72e2cd948f74de5 (diff) | |
download | openttd-640e5478862e3b83d85db6332e0d82a45a95e4ed.tar.xz |
(svn r13606) -Codechange: use "static FORCEINLINE" where possible as default for core functions (big functions use just inline instead)
Diffstat (limited to 'src/core/alloc_type.hpp')
-rw-r--r-- | src/core/alloc_type.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/alloc_type.hpp b/src/core/alloc_type.hpp index 1710e9a4d..fe9c3b81d 100644 --- a/src/core/alloc_type.hpp +++ b/src/core/alloc_type.hpp @@ -37,20 +37,20 @@ struct SmallStackSafeStackAlloc { * Gets a pointer to the data stored in this wrapper. * @return the pointer. */ - inline operator T* () { return data; } + FORCEINLINE operator T* () { return data; } /** * Gets a pointer to the data stored in this wrapper. * @return the pointer. */ - inline T* operator -> () { return data; } + FORCEINLINE T* operator -> () { return data; } /** * Gets a pointer to the last data element stored in this wrapper. * @note needed because endof does not work properly for pointers. * @return the 'endof' pointer. */ - inline T* EndOf() { + FORCEINLINE T* EndOf() { #if !defined(__NDS__) return endof(data); #else @@ -74,14 +74,14 @@ public: * @param size the amount of bytes to allocate. * @return the given amounts of bytes zeroed. */ - void *operator new(size_t size) { return CallocT<byte>(size); } + FORCEINLINE void *operator new(size_t size) { return CallocT<byte>(size); } /** * Memory allocator for an array of class instances. * @param size the amount of bytes to allocate. * @return the given amounts of bytes zeroed. */ - void *operator new[](size_t size) { return CallocT<byte>(size); } + FORCEINLINE void *operator new[](size_t size) { return CallocT<byte>(size); } /** * Memory release for a single class instance. @@ -91,7 +91,7 @@ public: * @warning The value of the \a size parameter can only be trusted for * classes that have their own (virtual) destructor method. */ - void operator delete(void *ptr, size_t size) { free(ptr); } + FORCEINLINE void operator delete(void *ptr, size_t size) { free(ptr); } /** * Memory release for an array of class instances. @@ -101,7 +101,7 @@ public: * @warning The value of the \a size parameter can only be trusted for * classes that have their own (virtual) destructor method. */ - void operator delete[](void *ptr, size_t size) { free(ptr); } + FORCEINLINE void operator delete[](void *ptr, size_t size) { free(ptr); } }; #endif /* ALLOC_TYPE_HPP */ |