(svn r23941) -Add: support for clang

This commit is contained in:
smatz
2012-02-12 21:17:32 +00:00
parent f4de9b8a37
commit b5525fd33d
7 changed files with 78 additions and 12 deletions

View File

@@ -107,7 +107,11 @@ DEFINE_POOL_METHOD(inline void *)::AllocateItem(size_t size, size_t index)
assert(sizeof(Titem) == size);
item = (Titem *)this->alloc_cache;
this->alloc_cache = this->alloc_cache->next;
if (Tzero) MemSetT(item, 0);
if (Tzero) {
/* Explicitly casting to (void *) prevets a clang warning -
* we are actually memsetting a (not-yet-constructed) object */
memset((void *)item, 0, sizeof(Titem));
}
} else if (Tzero) {
item = (Titem *)CallocT<byte>(size);
} else {