diff options
author | Brent Eagles <brent@zeroc.com> | 2006-11-01 14:30:22 +0000 |
---|---|---|
committer | Brent Eagles <brent@zeroc.com> | 2006-11-01 14:30:22 +0000 |
commit | bc8df05940f980777fd2b121c971527197f5a248 (patch) | |
tree | 16be0e41335860a1534efd0c931ebd136e711c2a /cpp | |
parent | adding note about debug mode (diff) | |
download | ice-bc8df05940f980777fd2b121c971527197f5a248.tar.bz2 ice-bc8df05940f980777fd2b121c971527197f5a248.tar.xz ice-bc8df05940f980777fd2b121c971527197f5a248.zip |
removing memory pool
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/config/PropertyNames.def | 2 | ||||
-rw-r--r-- | cpp/config/TestUtil.py | 16 | ||||
-rw-r--r-- | cpp/include/Ice/Buffer.h | 13 | ||||
-rw-r--r-- | cpp/src/Ice/.depend | 5 | ||||
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Buffer.cpp | 42 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 22 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.h | 9 | ||||
-rw-r--r-- | cpp/src/Ice/Makefile | 1 | ||||
-rw-r--r-- | cpp/src/Ice/Makefile.mak | 1 | ||||
-rw-r--r-- | cpp/src/Ice/MemoryPool.cpp | 516 | ||||
-rw-r--r-- | cpp/src/Ice/MemoryPool.h | 60 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.h | 2 |
14 files changed, 15 insertions, 680 deletions
diff --git a/cpp/config/PropertyNames.def b/cpp/config/PropertyNames.def index 4f9765f4b2d..021b910f481 100644 --- a/cpp/config/PropertyNames.def +++ b/cpp/config/PropertyNames.def @@ -129,8 +129,6 @@ Ice: ImplicitContext InitPlugins Logger.Timestamp - MemoryPool - MemoryPool.HighWaterMark MessageSizeMax MonitorConnections Nohup diff --git a/cpp/config/TestUtil.py b/cpp/config/TestUtil.py index 11373100203..cf8da7df2bb 100644 --- a/cpp/config/TestUtil.py +++ b/cpp/config/TestUtil.py @@ -33,12 +33,6 @@ threadPerConnection = 0 #threadPerConnection = 2 # -# Set to 1 to disable the memory pool. -# -#disablePool=1 -disablePool=0 - -# # If you don't set "host" below, then the Ice library will try to find # out the IP address of this host. For the Ice test suite, it's best # to set the IP address explicitly to 127.0.0.1. This avoid problems @@ -59,10 +53,10 @@ import sys, os, re, errno, getopt from threading import Thread def usage(): - print "usage: " + sys.argv[0] + " --debug --protocol protocol --compress --host host --threadPerConnection num --disablePool" + print "usage: " + sys.argv[0] + " --debug --protocol protocol --compress --host host --threadPerConnection num" sys.exit(2) try: - opts, args = getopt.getopt(sys.argv[1:], "", ["debug", "protocol=", "compress", "host=", "threadPerConnection=", "disablePool"]) + opts, args = getopt.getopt(sys.argv[1:], "", ["debug", "protocol=", "compress", "host=", "threadPerConnection="]) except getopt.GetoptError: usage() @@ -75,8 +69,6 @@ for o, a in opts: compress = 1 if o == "--threadPerConnection": threadPerConnection = a - if o == "--disablePool": - disablePool = 1 if o == "--host": host = a @@ -412,10 +404,6 @@ else: commonServerOptions += " --Ice.ThreadPool.Server.Size=1 --Ice.ThreadPool.Server.SizeMax=3" + \ " --Ice.ThreadPool.Server.SizeWarn=0" -if disablePool == 1: - commonClientOptions = " --Ice.MemoryPool=0 " + commonClientOptions - commonServerOptions = " --Ice.MemoryPool=0 " + commonServerOptions - clientOptions = clientProtocol + defaultHost + commonClientOptions serverOptions = serverProtocol + defaultHost + commonServerOptions clientServerOptions = clientServerProtocol + defaultHost + commonServerOptions diff --git a/cpp/include/Ice/Buffer.h b/cpp/include/Ice/Buffer.h index 1c37484de36..1f1779bc097 100644 --- a/cpp/include/Ice/Buffer.h +++ b/cpp/include/Ice/Buffer.h @@ -15,13 +15,11 @@ namespace IceInternal { -class MemoryPool; - class ICE_API Buffer : private IceUtil::noncopyable { public: - Buffer(MemoryPool* pool, size_t maxCapacity) : b(pool, maxCapacity), i(b.begin()) { } + Buffer(size_t maxCapacity) : b(maxCapacity), i(b.begin()) { } virtual ~Buffer() { } void swap(Buffer&); @@ -43,7 +41,7 @@ public: typedef ptrdiff_t difference_type; typedef size_t size_type; - Container(MemoryPool* pool, size_type maxCapacity); + Container(size_type maxCapacity); ~Container(); @@ -146,13 +144,6 @@ public: size_type _capacity; size_type _maxCapacity; int _shrinkCounter; - - // - // MemoryPool does not need to be reference counted. Buffer is - // always stack allocated so there is no danger of the memory pool - // instance being destroyed while buffer is using it. - // - MemoryPool* _pool; }; Container b; diff --git a/cpp/src/Ice/.depend b/cpp/src/Ice/.depend index 37851e073dd..d21624fe0eb 100644 --- a/cpp/src/Ice/.depend +++ b/cpp/src/Ice/.depend @@ -1,8 +1,7 @@ Acceptor$(OBJEXT): Acceptor.cpp ../Ice/Acceptor.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../Ice/AcceptorF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../Ice/TransceiverF.h Application$(OBJEXT): Application.cpp ../../include/Ice/Application.h ../../include/Ice/Ice.h ../../include/Ice/GCRecMutex.h ../../include/IceUtil/RecMutex.h ../../include/IceUtil/Config.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/GCShared.h ../../include/Ice/GCCountMap.h ../../include/Ice/GC.h ../../include/IceUtil/Thread.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/LoggerF.h ../../include/Ice/StreamF.h ../../include/Ice/StatsF.h ../../include/Ice/StringConverter.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/LocalException.h ../../include/Ice/Properties.h ../../include/Ice/Logger.h ../../include/Ice/LoggerUtil.h ../../include/Ice/Stats.h ../../include/Ice/Communicator.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ImplicitContext.h ../../include/Ice/ObjectFactory.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/Object.h ../../include/Ice/IncomingAsyncF.h ../../include/Ice/Outgoing.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/IceUtil/Unicode.h ../../include/Ice/OutgoingAsync.h ../../include/Ice/Incoming.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/ServantManagerF.h ../../include/Ice/IncomingAsync.h ../../include/Ice/Direct.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/FactoryTable.h ../../include/Ice/FactoryTableDef.h ../../include/IceUtil/StaticMutex.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/FacetMap.h ../../include/Ice/Locator.h ../../include/Ice/ProcessF.h ../../include/Ice/ServantLocator.h ../../include/Ice/Process.h ../../include/Ice/Connection.h ../../include/Ice/Functional.h ../../include/IceUtil/Functional.h ../../include/Ice/Stream.h ../../include/IceUtil/CtrlCHandler.h -Buffer$(OBJEXT): Buffer.cpp ../../include/Ice/Buffer.h ../../include/Ice/Config.h ../../include/IceUtil/Config.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/StreamF.h ../../include/Ice/CommunicatorF.h ../../include/Ice/BuiltinSequences.h ../Ice/MemoryPool.h ../../include/Ice/InstanceF.h +Buffer$(OBJEXT): Buffer.cpp ../../include/Ice/Buffer.h ../../include/Ice/Config.h ../../include/IceUtil/Config.h ../../include/Ice/LocalException.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/StreamF.h ../../include/Ice/CommunicatorF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/InstanceF.h BasicStream$(OBJEXT): BasicStream.cpp ../../include/IceUtil/DisableWarnings.h ../../include/Ice/BasicStream.h ../../include/Ice/InstanceF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/Ice/StringConverter.h ../../include/IceUtil/Unicode.h ../Ice/Instance.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/RecMutex.h ../../include/Ice/CommunicatorF.h ../../include/Ice/StatsF.h ../Ice/TraceLevelsF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../../include/Ice/ProxyFactoryF.h ../Ice/ThreadPoolF.h ../../include/Ice/ConnectionFactoryF.h ../../include/Ice/ConnectionMonitorF.h ../Ice/ObjectFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../Ice/EndpointFactoryManagerF.h ../../include/Ice/DynamicLibraryF.h ../../include/Ice/PluginF.h ../../include/Ice/Initialize.h ../../include/Ice/PropertiesF.h ../../include/Ice/LoggerF.h ../../include/Ice/StreamF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../Ice/SharedContext.h ../Ice/ImplicitContextI.h ../../include/Ice/ImplicitContext.h ../../include/Ice/LocalException.h ../../include/Ice/Object.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/Ice/IncomingAsyncF.h ../Ice/ProxyFactory.h ../../include/Ice/ObjectFactory.h ../Ice/ObjectFactoryManager.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/FactoryTable.h ../../include/Ice/FactoryTableDef.h ../../include/IceUtil/StaticMutex.h ../../include/Ice/UserExceptionFactoryF.h ../Ice/TraceUtil.h ../Ice/TraceLevels.h ../../include/Ice/LoggerUtil.h -MemoryPool$(OBJEXT): MemoryPool.cpp ../Ice/MemoryPool.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Config.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/Exception.h ../../include/Ice/InstanceF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h BuiltinSequences$(OBJEXT): BuiltinSequences.cpp ../../include/Ice/BuiltinSequences.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/StreamF.h ../../include/Ice/CommunicatorF.h ../../include/Ice/BasicStream.h ../../include/Ice/InstanceF.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/Ice/StringConverter.h ../../include/IceUtil/Unicode.h ../../include/Ice/Object.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/IceUtil/RecMutex.h ../../include/Ice/IncomingAsyncF.h ../../include/IceUtil/Iterator.h ../../include/IceUtil/ScopedArray.h ../../include/IceUtil/DisableWarnings.h CommunicatorF$(OBJEXT): CommunicatorF.cpp ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/UndefSysMacros.h ../../include/IceUtil/Iterator.h ../../include/IceUtil/ScopedArray.h ../../include/IceUtil/DisableWarnings.h CommunicatorI$(OBJEXT): CommunicatorI.cpp ../Ice/CommunicatorI.h ../../include/IceUtil/RecMutex.h ../../include/IceUtil/Config.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/Exception.h ../../include/IceUtil/StaticMutex.h ../../include/Ice/DynamicLibraryF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/LoggerF.h ../../include/Ice/StreamF.h ../../include/Ice/StatsF.h ../../include/Ice/StringConverter.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/Communicator.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ImplicitContext.h ../../include/Ice/LocalException.h ../Ice/Instance.h ../Ice/TraceLevelsF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../Ice/ThreadPoolF.h ../../include/Ice/ConnectionFactoryF.h ../../include/Ice/ConnectionMonitorF.h ../Ice/ObjectFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../Ice/EndpointFactoryManagerF.h ../Ice/SharedContext.h ../Ice/ImplicitContextI.h ../../include/Ice/Properties.h ../Ice/ReferenceFactory.h ../Ice/Reference.h ../Ice/ProxyFactory.h ../Ice/ObjectFactoryManager.h ../Ice/ObjectAdapterFactory.h ../Ice/ObjectAdapterI.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/Object.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/Ice/IncomingAsyncF.h ../../include/Ice/Outgoing.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/IceUtil/Unicode.h ../../include/Ice/OutgoingAsync.h ../../include/Ice/Incoming.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/ServantManagerF.h ../../include/Ice/IncomingAsync.h ../../include/Ice/Direct.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/FactoryTable.h ../../include/Ice/FactoryTableDef.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/FacetMap.h ../../include/Ice/Locator.h ../../include/Ice/ProcessF.h ../../include/Ice/Process.h ../../include/Ice/LoggerUtil.h ../Ice/DefaultsAndOverrides.h ../Ice/TraceLevels.h ../../include/Ice/GC.h ../../include/IceUtil/Thread.h @@ -36,7 +35,7 @@ ImplicitContextI$(OBJEXT): ImplicitContextI.cpp ../Ice/ImplicitContextI.h ../../ IncomingAsync$(OBJEXT): IncomingAsync.cpp ../../include/Ice/IncomingAsync.h ../../include/Ice/IncomingAsyncF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Incoming.h ../../include/Ice/InstanceF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/ServantManagerF.h ../../include/Ice/BasicStream.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/Ice/StringConverter.h ../../include/IceUtil/Unicode.h ../../include/Ice/Current.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/ServantLocator.h ../../include/Ice/Object.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/IceUtil/RecMutex.h ../../include/Ice/StreamF.h ../Ice/ConnectionI.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/IceUtil/Thread.h ../../include/Ice/Connection.h ../../include/Ice/Proxy.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/CommunicatorF.h ../../include/Ice/ConnectionFactoryF.h ../Ice/TransceiverF.h ../../include/Ice/LoggerF.h ../Ice/TraceLevelsF.h ../Ice/EventHandler.h ../Ice/EventHandlerF.h ../Ice/ThreadPoolF.h ../../include/Ice/LocalException.h ../../include/Ice/BuiltinSequences.h ../Ice/Instance.h ../../include/Ice/StatsF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../../include/Ice/ConnectionMonitorF.h ../Ice/ObjectFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../Ice/EndpointFactoryManagerF.h ../../include/Ice/DynamicLibraryF.h ../../include/Ice/PluginF.h ../../include/Ice/Initialize.h ../../include/Ice/PropertiesF.h ../Ice/SharedContext.h ../Ice/ImplicitContextI.h ../../include/Ice/ImplicitContext.h ../../include/Ice/Properties.h Incoming$(OBJEXT): Incoming.cpp ../../include/Ice/Incoming.h ../../include/Ice/InstanceF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ConnectionIF.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/ServantManagerF.h ../../include/Ice/BasicStream.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/Ice/StringConverter.h ../../include/IceUtil/Unicode.h ../../include/Ice/Current.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/StreamF.h ../../include/Ice/CommunicatorF.h ../../include/Ice/Object.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/IceUtil/RecMutex.h ../../include/Ice/IncomingAsyncF.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/OutgoingAsync.h ../../include/Ice/IncomingAsync.h ../../include/Ice/Direct.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/FactoryTable.h ../../include/Ice/FactoryTableDef.h ../../include/IceUtil/StaticMutex.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/FacetMap.h ../../include/Ice/Locator.h ../../include/Ice/ProcessF.h ../../include/Ice/ServantLocator.h ../Ice/ServantManager.h ../Ice/ConnectionI.h ../../include/IceUtil/Thread.h ../../include/Ice/Connection.h ../../include/Ice/ConnectionFactoryF.h ../Ice/TransceiverF.h ../../include/Ice/LoggerF.h ../Ice/TraceLevelsF.h ../Ice/EventHandler.h ../Ice/EventHandlerF.h ../Ice/ThreadPoolF.h ../../include/Ice/LocalException.h ../../include/Ice/BuiltinSequences.h ../Ice/Instance.h ../../include/Ice/StatsF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../../include/Ice/ConnectionMonitorF.h ../Ice/ObjectFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../Ice/EndpointFactoryManagerF.h ../../include/Ice/DynamicLibraryF.h ../../include/Ice/PluginF.h ../../include/Ice/Initialize.h ../../include/Ice/PropertiesF.h ../Ice/SharedContext.h ../Ice/ImplicitContextI.h ../../include/Ice/ImplicitContext.h ../../include/Ice/Properties.h ../../include/Ice/LoggerUtil.h ../../include/IceUtil/StringUtil.h Initialize$(OBJEXT): Initialize.cpp ../../include/Ice/GC.h ../../include/IceUtil/Config.h ../../include/IceUtil/Thread.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/Config.h ../Ice/CommunicatorI.h ../../include/IceUtil/RecMutex.h ../../include/IceUtil/StaticMutex.h ../../include/Ice/DynamicLibraryF.h ../../include/Ice/Handle.h ../../include/Ice/ProxyHandle.h ../../include/Ice/Initialize.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/PropertiesF.h ../../include/Ice/InstanceF.h ../../include/Ice/LoggerF.h ../../include/Ice/StreamF.h ../../include/Ice/StatsF.h ../../include/Ice/StringConverter.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/Communicator.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/RouterF.h ../../include/Ice/LocatorF.h ../../include/Ice/PluginF.h ../../include/Ice/ImplicitContext.h ../../include/Ice/LocalException.h ../Ice/PropertiesI.h ../../include/Ice/Properties.h ../Ice/StreamI.h ../../include/Ice/Stream.h ../../include/Ice/Object.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/Ice/IncomingAsyncF.h ../../include/Ice/BasicStream.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/IceUtil/Unicode.h -Instance$(OBJEXT): Instance.cpp ../../include/IceUtil/DisableWarnings.h ../Ice/Instance.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/Exception.h ../../include/IceUtil/RecMutex.h ../../include/Ice/InstanceF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/StatsF.h ../Ice/TraceLevelsF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../../include/Ice/ProxyFactoryF.h ../Ice/ThreadPoolF.h ../../include/Ice/ConnectionFactoryF.h ../../include/Ice/ConnectionMonitorF.h ../Ice/ObjectFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../Ice/EndpointFactoryManagerF.h ../../include/Ice/DynamicLibraryF.h ../../include/Ice/PluginF.h ../../include/Ice/Initialize.h ../../include/Ice/PropertiesF.h ../../include/Ice/LoggerF.h ../../include/Ice/StreamF.h ../../include/Ice/StringConverter.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../Ice/SharedContext.h ../Ice/ImplicitContextI.h ../../include/Ice/ImplicitContext.h ../../include/Ice/LocalException.h ../Ice/TraceLevels.h ../Ice/DefaultsAndOverrides.h ../Ice/RouterInfo.h ../../include/Ice/RouterF.h ../../include/Ice/Router.h ../../include/Ice/Object.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/Ice/IncomingAsyncF.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/IceUtil/Unicode.h ../../include/Ice/Incoming.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/ServantManagerF.h ../../include/Ice/Direct.h ../Ice/LocatorInfo.h ../../include/Ice/LocatorF.h ../../include/Ice/Locator.h ../../include/Ice/OutgoingAsync.h ../../include/Ice/IncomingAsync.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/FactoryTable.h ../../include/Ice/FactoryTableDef.h ../../include/IceUtil/StaticMutex.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/ProcessF.h ../Ice/ReferenceFactory.h ../Ice/Reference.h ../Ice/ProxyFactory.h ../Ice/ThreadPool.h ../../include/IceUtil/Thread.h ../Ice/EventHandlerF.h ../Ice/ConnectionFactory.h ../Ice/AcceptorF.h ../Ice/TransceiverF.h ../Ice/EventHandler.h ../Ice/ConnectionMonitor.h ../Ice/ObjectFactoryManager.h ../Ice/ObjectAdapterFactory.h ../Ice/ObjectAdapterI.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/FacetMap.h ../../include/Ice/Process.h ../../include/Ice/Properties.h ../Ice/LoggerI.h ../../include/Ice/Logger.h ../Ice/Network.h ../Ice/EndpointFactoryManager.h ../../include/Ice/EndpointFactoryF.h ../Ice/TcpEndpointI.h ../Ice/EndpointI.h ../Ice/ConnectorF.h ../../include/Ice/EndpointFactory.h ../Ice/UdpEndpointI.h ../../include/Ice/DynamicLibrary.h ../Ice/PluginManagerI.h ../../include/Ice/Plugin.h ../../include/IceUtil/StringUtil.h ../Ice/MemoryPool.h ../Ice/SysLoggerI.h +Instance$(OBJEXT): Instance.cpp ../../include/IceUtil/DisableWarnings.h ../Ice/Instance.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/Exception.h ../../include/IceUtil/RecMutex.h ../../include/Ice/InstanceF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/CommunicatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/StatsF.h ../Ice/TraceLevelsF.h ../Ice/DefaultsAndOverridesF.h ../Ice/RouterInfoF.h ../Ice/LocatorInfoF.h ../Ice/ReferenceFactoryF.h ../../include/Ice/ProxyFactoryF.h ../Ice/ThreadPoolF.h ../../include/Ice/ConnectionFactoryF.h ../../include/Ice/ConnectionMonitorF.h ../Ice/ObjectFactoryManagerF.h ../../include/Ice/ObjectAdapterFactoryF.h ../Ice/EndpointFactoryManagerF.h ../../include/Ice/DynamicLibraryF.h ../../include/Ice/PluginF.h ../../include/Ice/Initialize.h ../../include/Ice/PropertiesF.h ../../include/Ice/LoggerF.h ../../include/Ice/StreamF.h ../../include/Ice/StringConverter.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/Proxy.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../Ice/SharedContext.h ../Ice/ImplicitContextI.h ../../include/Ice/ImplicitContext.h ../../include/Ice/LocalException.h ../Ice/TraceLevels.h ../Ice/DefaultsAndOverrides.h ../Ice/RouterInfo.h ../../include/Ice/RouterF.h ../../include/Ice/Router.h ../../include/Ice/Object.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/Ice/IncomingAsyncF.h ../../include/Ice/Outgoing.h ../../include/IceUtil/Monitor.h ../../include/IceUtil/Cond.h ../../include/IceUtil/Time.h ../../include/Ice/BasicStream.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/IceUtil/Unicode.h ../../include/Ice/Incoming.h ../../include/Ice/ServantLocatorF.h ../../include/Ice/ServantManagerF.h ../../include/Ice/Direct.h ../Ice/LocatorInfo.h ../../include/Ice/LocatorF.h ../../include/Ice/Locator.h ../../include/Ice/OutgoingAsync.h ../../include/Ice/IncomingAsync.h ../../include/Ice/UserExceptionFactory.h ../../include/Ice/FactoryTable.h ../../include/Ice/FactoryTableDef.h ../../include/IceUtil/StaticMutex.h ../../include/Ice/UserExceptionFactoryF.h ../../include/Ice/ProcessF.h ../Ice/ReferenceFactory.h ../Ice/Reference.h ../Ice/ProxyFactory.h ../Ice/ThreadPool.h ../../include/IceUtil/Thread.h ../Ice/EventHandlerF.h ../Ice/ConnectionFactory.h ../Ice/AcceptorF.h ../Ice/TransceiverF.h ../Ice/EventHandler.h ../Ice/ConnectionMonitor.h ../Ice/ObjectFactoryManager.h ../Ice/ObjectAdapterFactory.h ../Ice/ObjectAdapterI.h ../../include/Ice/ObjectAdapter.h ../../include/Ice/FacetMap.h ../../include/Ice/Process.h ../../include/Ice/Properties.h ../Ice/LoggerI.h ../../include/Ice/Logger.h ../Ice/Network.h ../Ice/EndpointFactoryManager.h ../../include/Ice/EndpointFactoryF.h ../Ice/TcpEndpointI.h ../Ice/EndpointI.h ../Ice/ConnectorF.h ../../include/Ice/EndpointFactory.h ../Ice/UdpEndpointI.h ../../include/Ice/DynamicLibrary.h ../Ice/PluginManagerI.h ../../include/Ice/Plugin.h ../../include/IceUtil/StringUtil.h ../Ice/SysLoggerI.h LocalException$(OBJEXT): LocalException.cpp ../../include/Ice/LocalException.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/StreamF.h ../../include/Ice/CommunicatorF.h ../../include/Ice/BuiltinSequences.h ../../include/Ice/BasicStream.h ../../include/Ice/InstanceF.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/Ice/StringConverter.h ../../include/IceUtil/Unicode.h ../../include/Ice/Object.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/IceUtil/RecMutex.h ../../include/Ice/IncomingAsyncF.h ../../include/IceUtil/Iterator.h ../../include/IceUtil/ScopedArray.h ../../include/IceUtil/DisableWarnings.h LocalObject$(OBJEXT): LocalObject.cpp ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h LocatorF$(OBJEXT): LocatorF.cpp ../../include/Ice/LocatorF.h ../../include/Ice/LocalObjectF.h ../../include/Ice/Handle.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Config.h ../../include/Ice/Config.h ../../include/Ice/ProxyHandle.h ../../include/Ice/ProxyF.h ../../include/Ice/ObjectF.h ../../include/Ice/GCCountMap.h ../../include/Ice/Exception.h ../../include/Ice/LocalObject.h ../../include/IceUtil/Shared.h ../../include/Ice/Proxy.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/Ice/ProxyFactoryF.h ../../include/Ice/ConnectionIF.h ../../include/Ice/EndpointIF.h ../../include/Ice/Endpoint.h ../../include/Ice/UndefSysMacros.h ../../include/Ice/ObjectAdapterF.h ../../include/Ice/ReferenceF.h ../../include/Ice/OutgoingAsyncF.h ../../include/Ice/Current.h ../../include/Ice/ConnectionF.h ../../include/Ice/Identity.h ../../include/Ice/StreamF.h ../../include/Ice/CommunicatorF.h ../../include/Ice/BasicStream.h ../../include/Ice/InstanceF.h ../../include/Ice/ObjectFactoryF.h ../../include/Ice/Buffer.h ../../include/Ice/Protocol.h ../../include/Ice/StringConverter.h ../../include/IceUtil/Unicode.h ../../include/Ice/Object.h ../../include/Ice/GCShared.h ../../include/Ice/GCRecMutex.h ../../include/IceUtil/RecMutex.h ../../include/Ice/IncomingAsyncF.h ../../include/IceUtil/Iterator.h ../../include/IceUtil/ScopedArray.h ../../include/IceUtil/DisableWarnings.h diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index ec5b2915957..061a8ed0981 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -31,7 +31,7 @@ using namespace Ice; using namespace IceInternal; IceInternal::BasicStream::BasicStream(Instance* instance) : - IceInternal::Buffer(instance->memoryPool(), instance->messageSizeMax()), + IceInternal::Buffer(instance->messageSizeMax()), _instance(instance), _currentReadEncaps(0), _currentWriteEncaps(0), diff --git a/cpp/src/Ice/Buffer.cpp b/cpp/src/Ice/Buffer.cpp index 1273ea92aaa..783854e4cb8 100644 --- a/cpp/src/Ice/Buffer.cpp +++ b/cpp/src/Ice/Buffer.cpp @@ -9,7 +9,6 @@ #include <Ice/Buffer.h> #include <Ice/LocalException.h> -#include <Ice/MemoryPool.h> using namespace std; using namespace Ice; @@ -22,25 +21,17 @@ IceInternal::Buffer::swap(Buffer& other) std::swap(i, other.i); } -IceInternal::Buffer::Container::Container(IceInternal::MemoryPool* pool, size_type maxCapacity) : +IceInternal::Buffer::Container::Container(size_type maxCapacity) : _buf(0), _size(0), _capacity(0), - _maxCapacity(maxCapacity), - _pool(pool) + _maxCapacity(maxCapacity) { } IceInternal::Buffer::Container::~Container() { - if(_pool) - { - _pool->free(_buf); - } - else - { - ::free(_buf); - } + ::free(_buf); } void @@ -56,14 +47,7 @@ IceInternal::Buffer::Container::swap(Container& other) void IceInternal::Buffer::Container::clear() { - if(_pool) - { - _pool->free(_buf); - } - else - { - ::free(_buf); - } + free(_buf); _buf = 0; _size = 0; _capacity = 0; @@ -88,25 +72,11 @@ IceInternal::Buffer::Container::reserve(size_type n) if(_buf) { - if(_pool) - { - _buf = _pool->realloc(_buf, _capacity); - } - else - { - _buf = reinterpret_cast<pointer>(::realloc(_buf, _capacity)); - } + _buf = reinterpret_cast<pointer>(::realloc(_buf, _capacity)); } else { - if(_pool) - { - _buf = _pool->alloc(_capacity); - } - else - { - _buf = reinterpret_cast<pointer>(::malloc(_capacity)); - } + _buf = reinterpret_cast<pointer>(::malloc(_capacity)); } if(!_buf) diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 29fc2c88857..c9f848fde29 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -34,7 +34,6 @@ #include <Ice/PluginManagerI.h> #include <Ice/Initialize.h> #include <IceUtil/StringUtil.h> -#include <Ice/MemoryPool.h> #include <stdio.h> @@ -452,12 +451,6 @@ IceInternal::Instance::identityToString(const Identity& ident) const } } -IceInternal::MemoryPool* -IceInternal::Instance::memoryPool() const -{ - return _memoryPool; -} - IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const InitializationData& initData) : _state(StateActive), _initData(initData), @@ -467,7 +460,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi _threadPerConnection(0), _threadPerConnectionStackSize(0), _defaultContext(new SharedContext), - _memoryPool(0), _implicitContext(0) { try @@ -681,19 +673,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi _pluginManager = new PluginManagerI(communicator, _dynamicLibraryList); - if(_initData.properties->getPropertyAsIntWithDefault("Ice.MemoryPool", 0) == 1) - { - - // - // High watermark defaults to 4 * max page size. - // - size_t highWaterMark = _initData.properties->getPropertyAsIntWithDefault("Ice.MemoryPool.HighWaterMark", 128); - const size_t megaByte = 1024 * 1024; - - highWaterMark *= megaByte; - _memoryPool = new MemoryPool(highWaterMark); - } - _outgoingConnectionFactory = new OutgoingConnectionFactory(this); _servantFactoryManager = new ObjectFactoryManager(); @@ -725,7 +704,6 @@ IceInternal::Instance::~Instance() assert(!_referenceFactory); assert(!_proxyFactory); assert(!_outgoingConnectionFactory); - delete _memoryPool; assert(!_connectionMonitor); assert(!_servantFactoryManager); diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index 3590cd74af5..b69436da20d 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -44,8 +44,6 @@ class CommunicatorI; namespace IceInternal { -class MemoryPool; - class Instance : public IceUtil::Shared, public IceUtil::RecMutex { @@ -79,12 +77,6 @@ public: SharedContextPtr getDefaultContext() const; Ice::Identity stringToIdentity(const std::string&) const; - // - // The memory pool is only accessed by BasicStream's. BasicStream's are - // always stack allocated so there is no danger of a memory pool instance being - // prematurely destroyed while it is in use. - // - MemoryPool* memoryPool() const; std::string identityToString(const Ice::Identity&) const; const Ice::ImplicitContextIPtr& getImplicitContext() const @@ -129,7 +121,6 @@ private: DynamicLibraryListPtr _dynamicLibraryList; Ice::PluginManagerPtr _pluginManager; SharedContextPtr _defaultContext; - MemoryPool* _memoryPool; const Ice::ImplicitContextIPtr _implicitContext; }; diff --git a/cpp/src/Ice/Makefile b/cpp/src/Ice/Makefile index 49ba18b3b96..0f711ce7c84 100644 --- a/cpp/src/Ice/Makefile +++ b/cpp/src/Ice/Makefile @@ -19,7 +19,6 @@ OBJS = Acceptor.o \ Application.o \ Buffer.o \ BasicStream.o \ - MemoryPool.o \ BuiltinSequences.o \ CommunicatorF.o \ CommunicatorI.o \ diff --git a/cpp/src/Ice/Makefile.mak b/cpp/src/Ice/Makefile.mak index 88c741f4a74..abe77da955a 100644 --- a/cpp/src/Ice/Makefile.mak +++ b/cpp/src/Ice/Makefile.mak @@ -18,7 +18,6 @@ OBJS = Acceptor.obj \ Application.obj \ Buffer.obj \ BasicStream.obj \ - MemoryPool.obj \ BuiltinSequences.obj \ CommunicatorI.obj \ Communicator.obj \ diff --git a/cpp/src/Ice/MemoryPool.cpp b/cpp/src/Ice/MemoryPool.cpp deleted file mode 100644 index 196fa920cb5..00000000000 --- a/cpp/src/Ice/MemoryPool.cpp +++ /dev/null @@ -1,516 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <Ice/MemoryPool.h> - -// #define MEMPOOL_DEBUG - -// -// TODO: Will a rover to a free block help speed things up here? It's -// probably not a very significant optimization as long as the pool is -// primarily for BasicStream usage. If it becomes more general purpose, it -// will need more consideration. -// - -namespace IceInternal -{ - -struct BlockInfo; - -struct PageInfo -{ - size_t nBlocks; - size_t pageSize; - - BlockInfo* blocks; - PageInfo* nextPage; -}; - -struct BlockInfo -{ - // - // We could get rid of the next link since the next blockinfo should b - // b+size. However, it is pretty useful as a convenience and it allows - // for a some block validation. - // - BlockInfo* next; - BlockInfo* prev; - - // - // We keep track of the parent page so we can quickly update - // information on the parent page. - // - PageInfo* page; - - // - // The amount of user memory for this block. The actual size of the - // block in the pool is size + sizeof BlockInfo - // - size_t size; - - // - // The amount of memory in the block that is actually used. - size_t used; - - // - // Flag indicating whether this block is allocated or not. - // - bool free; - - Ice::Byte* user; -}; - -const size_t blocksPerOversize = 4; - -} // End of namespace IceInternal - -IceInternal::MemoryPool::MemoryPool(size_t highWaterMark): - _pageSize(4 * 1024 * 1024), - _maxPageSize(8 * _pageSize), - _highWaterMark(highWaterMark), - _currentSize(0), - _pages(0) -{ -} - -IceInternal::MemoryPool::~MemoryPool() -{ - while(_pages != 0) - { - PageInfo* current = _pages; - _pages = _pages->nextPage; - ::free(current); - } -} - -// -// The Memory pool's public interface. There should be no reason to -// call directly on the memory pool's instance. -// -Ice::Byte* -IceInternal::MemoryPool::alloc(size_t n) -{ - IceUtil::Mutex::Lock lock(_mutex); - return allocBlock(n); -} - -void -IceInternal::MemoryPool::free(Ice::Byte* b) -{ - if(b == 0) - { - return; - } - IceUtil::Mutex::Lock lock(_mutex); - freeBlock(b); -} - -Ice::Byte* -IceInternal::MemoryPool::realloc(Ice::Byte* b, size_t n) -{ - // - // TODO: Is this safe? Can we assume that nobody else is going to try and - // delete this block? If so this is super speedy! In one throughput - // test with 1000 iterations, we call realloc 4200 times! - // - BlockInfo* block = reinterpret_cast<BlockInfo*>(b - sizeof(BlockInfo)); - if(block->size >= n) - { - block->used = n; - return b; - } - - IceUtil::Mutex::Lock lock(_mutex); - return reallocBlock(b, n); -} - -IceInternal::BlockInfo* -IceInternal::MemoryPool::initBlock(Ice::Byte* p, PageInfo* page, size_t n, bool allocated) -{ - BlockInfo* block = reinterpret_cast<BlockInfo*>(p); - block->size = n; - block->prev = 0; - block->next = 0; - block->page = page; - block->free = !allocated; - block->user = p + sizeof(BlockInfo); - -#ifdef MEMPOOL_DEBUG - memset(block->user, 'I', block->size); -#endif - return block; -} - -// -// Page layout: -// -// +----------+-----------+-------------+-----------+--------------......-+ -// | PageInfo | BlockInfo | user memory | BlockInfo | user memory | -// +----------+-----------+-------------+-----------+--------------......-+ -// -IceInternal::PageInfo* -IceInternal::MemoryPool::initPage(size_t n) -{ - Ice::Byte* rawData = reinterpret_cast<Ice::Byte*>(malloc(n)); -#ifdef MEMPOOL_DEBUG - memset(rawData, 'P', n); -#endif - if(rawData == 0) - { - return 0; - } - - PageInfo* p = reinterpret_cast<PageInfo*>(rawData); - - p->nBlocks = 0; - - // - // We keep track of the page size because it'll help make decisions - // about culling free pages. - // - p->pageSize = n; - - // - // Initialize the first free block. - // - p->blocks = initBlock(rawData + sizeof(PageInfo), p, n - (sizeof(PageInfo) + sizeof(BlockInfo)), false); - p->nextPage = 0; - return p; -} - -IceInternal::PageInfo* -IceInternal::MemoryPool::createNewPage(size_t n) -{ - const size_t overhead = sizeof(PageInfo) + sizeof(BlockInfo); - const size_t defaultMaxBlockSize = _pageSize - overhead; - - size_t newPageSize = 0; - if(n > defaultMaxBlockSize) - { - if((n + overhead) < _maxPageSize) - { - newPageSize = _maxPageSize; - } - else - { - newPageSize = n + overhead; - } - } - else - { - newPageSize = _pageSize; - } - _currentSize += newPageSize; - return initPage(newPageSize); -} - -// -// Remove unused pages (pages with no allocated blocks). If the force -// arg is false, only remove pages if the total memory allocated for the -// pool is over the high watermark. If force is true, remove unused -// pages unconditionally. Generally speaking, this is useful for -// shrinking memory to within a certain constraint when possible, but -// that doesn't mean that it's always possible. There may not be any -// free pages. However, since this pool is primarily intended for the -// Ice::BasicStream class, usage of pool memory is probably fairly -// transient so opportunities for cleanup will occur fairly often. -// -void -IceInternal::MemoryPool::purgePages(bool force) -{ - if((force || _currentSize > _highWaterMark)) - { - PageInfo* newList = 0; - PageInfo* p = _pages; - while(p != 0) - { - PageInfo* next = p->nextPage; - if(p->nBlocks == 0) - { - _currentSize -= p->pageSize; - ::free(p); - } - else - { - p->nextPage = newList; - newList = p; - } - p = next; - } - _pages = newList; - } -} - -// -// Get some memory from the pool. -// -Ice::Byte* -IceInternal::MemoryPool::allocBlock(size_t n) -{ - if(n < 16) - { - n = 16; - } - // - // All n should be an exact multiple of 16. This makes address math - // a little easier and it ensures that blocks aren't insanely - // small. This should not be an issue when servicing - // Ice::BasicStream. - // - n = n + (n % 16); - - // - // Try each page until we get a successful allocation. - // - for(PageInfo* p = _pages; p != 0; p = p->nextPage) - { - Ice::Byte* block = getBlock(p, n); - if(block) - { - return block; - } - } - - // - // None of the currently allocated pages has sufficient free space - // to allocate a block of the required size, so we'll need to - // create a new page and allocate from there. - // - PageInfo* newPage = createNewPage(n); - if(newPage == 0) - { - // - // Trouble! Our attempt to create a page has failed, so we need - // to look at purging pages and try again. - // - purgePages(true); - - newPage = createNewPage(n); - assert(newPage != 0); - - // - // If newPage is 0, there will be trouble. Since we are - // malloc() based, returning 0 is the most reasonable thing to - // do and matches earlier behavior. - // - if(newPage == 0) - { - return 0; - } - } - newPage->nextPage = _pages; - _pages = newPage; - return getBlock(newPage, n); -} - -#ifdef MEMPOOL_DEBUG -void -validateBlock(BlockInfo* p) -{ - assert(!p->prev || p->prev->next == p); - assert(!p->next || p->next->prev == p); - if(p->next) - { - assert(reinterpret_cast<size_t>(p) + sizeof(BlockInfo) + p->size == reinterpret_cast<size_t>(p->next)); - } - if(p->prev) - { - assert(reinterpret_cast<size_t>(p->prev) + sizeof(BlockInfo) + p->prev->size == - reinterpret_cast<size_t>(p)); - } -} -#else -# define validateBlock(x) (void)x -#endif - -// -// Iterate through this page's blocks, trying to find one that is big -// enough for 'n'. Return an address to a block's user memory on a -// successful find, otherwise return 0. -// -Ice::Byte* -IceInternal::MemoryPool::getBlock(PageInfo* page, size_t n) -{ - BlockInfo* p = page->blocks; - - const size_t requiredMem = n + sizeof(BlockInfo); - - while(p != 0) - { - if((n <= p->size) && p->free) - { - validateBlock(p); - Ice::Byte* base = reinterpret_cast<Ice::Byte*>(p); - BlockInfo* newBlock = 0; - - // - // TODO: It might be nice to leave some extra space for - // reallocations. How big of a space to reserve? Since - // Ice::BasicStream already does a 'predictive' reserve and - // we coalesce adjacent free blocks, it might be overkill - // at this point. - // - size_t offset = 0; - if ((requiredMem + 16) <= p->size) - { - // - // p will be the block for the allocated memory. - // newBlock will be the remaining free memory and will - // be to the 'right' of p. - // - offset = requiredMem; - } - - if(offset != 0) - { - newBlock = initBlock(base + offset, p->page, p->size - requiredMem, false); - newBlock->next = p->next; - newBlock->prev = p; - if(newBlock->next) - { - newBlock->next->prev = newBlock; - } - - // - // Adjust p's members. - // - p->next = newBlock; - p->size = n; - } - - if(newBlock) - { - validateBlock(newBlock); - } - - p->free = false; - p->page->nBlocks++; -#ifdef MEMPOOL_DEBUG - memset(p->user, 'G', p->size); -#endif - validateBlock(p); - p->used = n; - return p->user; - } - p = p->next; - } - - return 0; -} - -void -IceInternal::MemoryPool::freeBlock(Ice::Byte* p) -{ - BlockInfo* block = reinterpret_cast<BlockInfo*>(p - sizeof(BlockInfo)); - - - validateBlock(block); - block->free = true; - block->used = 0; - block->page->nBlocks--; - - // - // Combine with next block if it is free. This means that the next - // block is obliterated. - // - BlockInfo* nextBlock = block->next; - if(nextBlock && nextBlock->free) - { - block->size += nextBlock->size + sizeof(BlockInfo); - block->next = nextBlock->next; - if(nextBlock->next) - { - nextBlock->next->prev = block; - } - } - - // - // Combine with the previous block if it is free. This means that - // this block is obliterated. - // - BlockInfo* previousBlock = block->prev; - if(previousBlock && previousBlock->free) - { - previousBlock->size += block->size + sizeof(BlockInfo); - previousBlock->next = block->next; - if(block->next) - { - block->next->prev = previousBlock; - } - block = previousBlock; - } - -#ifdef MEMPOOL_DEBUG - memset(block->user, 'E', block->size); - if(block->prev) - { - validateBlock(block->prev); - } - if(block->next) - { - validateBlock(block->next); - } - validateBlock(block); -#endif - - if(block->page->nBlocks == 0) - { - purgePages(false); - } -} - -Ice::Byte* -IceInternal::MemoryPool::reallocBlock(Ice::Byte* p, size_t n) -{ - // - // Note: The way we allocate and free blocks *could* mean that a - // free block is available immediately after the current block. - // - BlockInfo* block = reinterpret_cast<BlockInfo*>(p - sizeof(BlockInfo)); - assert(!block->free); - validateBlock(block); - - // - // The way we allocate blocks, its very possible that the - // current block is already big enough! - // - if(n > block->size) - { - // - // If the next block is free, try combining it with the - // current block to satisfy the allocation requirement. - // - if(block->next && block->next->free && (block->size + block->next->size) >= n) - { - block->size += block->next->size; - block->next = block->next->next; - if(block->next) - { - block->next->prev = block; - } - block->used = n; - validateBlock(block); - } - else - { - // - // Realloc with current block has failed. Allocate a new - // block that is big enough and copy the contents of the - // old block into the new. - // - Ice::Byte* t = allocBlock(n); - memcpy(t, p, block->used); - freeBlock(p); - return t; - } - } - - assert(n <= block->size); - return p; -} diff --git a/cpp/src/Ice/MemoryPool.h b/cpp/src/Ice/MemoryPool.h deleted file mode 100644 index c7df2041d5b..00000000000 --- a/cpp/src/Ice/MemoryPool.h +++ /dev/null @@ -1,60 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2006 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - - -#ifndef ICE_MEMORY_POOL_H -#define ICE_MEMORY_POOL_H - -#include <IceUtil/Mutex.h> -#include <Ice/InstanceF.h> - -namespace IceInternal -{ - -// -// Forward declarations. -// -struct PageInfo; -struct BlockInfo; - -// -// Public interface to the memory pool -// -class MemoryPool : private IceUtil::noncopyable -{ -public: - MemoryPool(size_t); - ~MemoryPool(); - - Ice::Byte* alloc(size_t); - Ice::Byte* realloc(Ice::Byte*, size_t); - void free(Ice::Byte*); - -private: - IceUtil::Mutex _mutex; - size_t _pageSize; - size_t _maxPageSize; - size_t _highWaterMark; - size_t _currentSize; - - PageInfo* _pages; - - BlockInfo* initBlock(Ice::Byte*, PageInfo*, size_t, bool); - PageInfo* initPage(size_t); - PageInfo* createNewPage(size_t); - void purgePages(bool); - Ice::Byte* allocBlock(size_t); - Ice::Byte* getBlock(PageInfo*, size_t); - void freeBlock(Ice::Byte*); - Ice::Byte* reallocBlock(Ice::Byte*, size_t); -}; - -} - -#endif // End of ICE_MEMORY_POOL_H diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index c3691781415..9a65784e333 100644 --- a/cpp/src/Ice/PropertyNames.cpp +++ b/cpp/src/Ice/PropertyNames.cpp @@ -7,7 +7,7 @@ // // ********************************************************************** -// Generated by makeprops.py from file `../../config/PropertyNames.def', Thu Oct 26 11:14:46 2006 +// Generated by makeprops.py from file `../config/PropertyNames.def', Tue Oct 31 15:27:13 2006 // IMPORTANT: Do not edit this file -- any edits made here will be lost! @@ -31,8 +31,6 @@ const char* IceInternal::PropertyNames::IceProps[] = "Ice.ImplicitContext", "Ice.InitPlugins", "Ice.Logger.Timestamp", - "Ice.MemoryPool", - "Ice.MemoryPool.HighWaterMark", "Ice.MessageSizeMax", "Ice.MonitorConnections", "Ice.Nohup", diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h index 6406edaa986..356ebc29520 100644 --- a/cpp/src/Ice/PropertyNames.h +++ b/cpp/src/Ice/PropertyNames.h @@ -7,7 +7,7 @@ // // ********************************************************************** -// Generated by makeprops.py from file `../../config/PropertyNames.def', Thu Oct 26 11:14:46 2006 +// Generated by makeprops.py from file `../config/PropertyNames.def', Tue Oct 31 15:27:13 2006 // IMPORTANT: Do not edit this file -- any edits made here will be lost! |