From 03b3136bc1e74af6839a13fa9be46ee6b845fab9 Mon Sep 17 00:00:00 2001 From: Andrew Kaufman Date: Mon, 26 May 2014 13:27:16 -0700 Subject: [PATCH] Fixing default ObjectPool for larger sizes. Previously, setting IECORE_OBJECTPOOL_MEMORY = 2048 or larger would overflow the lexical cast, and you'd end up with 18446744071562067968 --- src/IECore/ObjectPool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IECore/ObjectPool.cpp b/src/IECore/ObjectPool.cpp index 7070418ad3..fa85d13a70 100644 --- a/src/IECore/ObjectPool.cpp +++ b/src/IECore/ObjectPool.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////// // -// Copyright (c) 2013, Image Engine Design Inc. All rights reserved. +// Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -141,7 +141,7 @@ ObjectPoolPtr ObjectPool::defaultObjectPool() if( !c ) { const char *m = getenv( "IECORE_OBJECTPOOL_MEMORY" ); - int mi = m ? boost::lexical_cast( m ) : 500; + size_t mi = m ? boost::lexical_cast( m ) : 500; c = new ObjectPool(1024 * 1024 * mi); } return c;