ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/util.h
Revision: 1.3
Committed: Mon Sep 4 11:07:59 2006 UTC (17 years, 8 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.2: +2 -0 lines
Log Message:
Changes...

- alternative shstr representation, saves code
- use glibs splice memory allocator (seems slower)
- use simpler memory/lifetime management for objects, no recycling

File Contents

# Content
1 #ifndef UTIL_H__
2 #define UTIL_H__
3
4 #if __GNUC__ >= 3
5 # define is_constant(c) __builtin_constant_p (c)
6 #else
7 # define is_constant(c) 0
8 #endif
9
10 // makes dynamically allocated objects zero-initialised
11 struct zero_initialised
12 {
13 void *operator new (size_t s);
14 void *operator new [] (size_t s);
15 void operator delete (void *p, size_t s);
16 void operator delete [] (void *p, size_t s);
17 };
18
19 #endif
20