(svn r11597) -Change: replace all remaining instances of (re|m|c)alloc with (Re|M|C)allocT and add a check for out-of-memory situations to the *allocT functions.

This commit is contained in:
rubidium
2007-12-08 14:50:41 +00:00
parent 73c58d8a40
commit f1e4914b5f
13 changed files with 19 additions and 16 deletions

View File

@@ -491,7 +491,7 @@ const void *GetRawSprite(SpriteID sprite, bool real_sprite)
void GfxInitSpriteMem()
{
/* initialize sprite cache heap */
if (_spritecache_ptr == NULL) _spritecache_ptr = (MemBlock*)malloc(_sprite_cache_size * 1024 * 1024);
if (_spritecache_ptr == NULL) _spritecache_ptr = (MemBlock*)MallocT<byte>(_sprite_cache_size * 1024 * 1024);
/* A big free block */
_spritecache_ptr->size = ((_sprite_cache_size * 1024 * 1024) - sizeof(MemBlock)) | S_FREE_MASK;