summaryrefslogtreecommitdiff
path: root/src/misc
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-08 14:50:41 +0000
committerrubidium <rubidium@openttd.org>2007-12-08 14:50:41 +0000
commitf1e4914b5f379f9821274e8ddc4196b152fcc9b0 (patch)
treeb8ebe2d1af4279edf6f4a53f991c963c77f5bba0 /src/misc
parent73c58d8a409d7e5f3dbb864be893a1c0b34defd6 (diff)
downloadopenttd-f1e4914b5f379f9821274e8ddc4196b152fcc9b0.tar.xz
(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.
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/blob.hpp2
-rw-r--r--src/misc/fixedsizearray.hpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/misc/blob.hpp b/src/misc/blob.hpp
index 78cac0f72..fd08385f8 100644
--- a/src/misc/blob.hpp
+++ b/src/misc/blob.hpp
@@ -298,7 +298,7 @@ public:
/** all allocation should happen here */
static FORCEINLINE CHdr* RawAlloc(bsize_t num_bytes)
{
- return (CHdr*)malloc(num_bytes);
+ return (CHdr*)MallocT<byte>(num_bytes);
}
/** all deallocations should happen here */
diff --git a/src/misc/fixedsizearray.hpp b/src/misc/fixedsizearray.hpp
index ee4ea14ca..d0a987e1a 100644
--- a/src/misc/fixedsizearray.hpp
+++ b/src/misc/fixedsizearray.hpp
@@ -34,7 +34,7 @@ struct CFixedSizeArrayT {
CFixedSizeArrayT()
{
// allocate block for header + items (don't construct items)
- m_items = (Titem*)(((int8*)malloc(ThdrSize + Tcapacity * sizeof(Titem))) + ThdrSize);
+ m_items = (Titem*)((MallocT<int8>(ThdrSize + Tcapacity * sizeof(Titem))) + ThdrSize);
SizeRef() = 0; // initial number of items
RefCnt() = 1; // initial reference counter
}