"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "util/SharedUsageLimitProxyMemoryAllocator.cpp" between
muscle8.20.zip and muscle8.30.zip

About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.

SharedUsageLimitProxyMemoryAllocator.cpp  (muscle8.20):SharedUsageLimitProxyMemoryAllocator.cpp  (muscle8.30)
skipping to change at line 60 skipping to change at line 60
status_t SharedUsageLimitProxyMemoryAllocator :: ChangeDaemonCounter(int32 byteD elta) status_t SharedUsageLimitProxyMemoryAllocator :: ChangeDaemonCounter(int32 byteD elta)
{ {
if (byteDelta > 0) if (byteDelta > 0)
{ {
if ((size_t)byteDelta > _localCachedBytes) if ((size_t)byteDelta > _localCachedBytes)
{ {
// Hmm, we don't have enough bytes locally, better ask for some from th e shared region // Hmm, we don't have enough bytes locally, better ask for some from th e shared region
const int32 wantBytes = ((byteDelta/CACHE_BYTES)+1)*CACHE_BYTES; // rou nd up to nearest multiple const int32 wantBytes = ((byteDelta/CACHE_BYTES)+1)*CACHE_BYTES; // rou nd up to nearest multiple
if (ChangeDaemonCounterAux(wantBytes).IsOK()) _localCachedBytes += want Bytes; if (ChangeDaemonCounterAux(wantBytes).IsOK()) _localCachedBytes += want Bytes;
if ((size_t)byteDelta > _localCachedBytes) return B_ACCESS_DENIED; // still not enough!?
} }
if ((size_t)byteDelta > _localCachedBytes) return B_ACCESS_DENIED; // sti ll not enough!?
_localCachedBytes -= byteDelta; _localCachedBytes -= byteDelta;
} }
else else
{ {
_localCachedBytes -= byteDelta; // actually adds, since byteDelta is nega tive _localCachedBytes -= byteDelta; // actually adds, since byteDelta is nega tive
if (_localCachedBytes > 2*CACHE_BYTES) if (_localCachedBytes > 2*CACHE_BYTES)
{ {
int32 diffBytes = (int32)(_localCachedBytes-CACHE_BYTES); // FogBugz # 4569 -- reduce cache to our standard cache size int32 diffBytes = (int32)(_localCachedBytes-CACHE_BYTES); // FogBugz # 4569 -- reduce cache to our standard cache size
if (ChangeDaemonCounterAux(-diffBytes).IsOK()) _localCachedBytes -= dif fBytes; if (ChangeDaemonCounterAux(-diffBytes).IsOK()) _localCachedBytes -= dif fBytes;
} }
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)