aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llcommon')
-rw-r--r--linden/indra/llcommon/llmemory.cpp88
-rw-r--r--linden/indra/llcommon/llversionviewer.h2
-rw-r--r--linden/indra/llcommon/llworkerthread.cpp3
-rw-r--r--linden/indra/llcommon/llworkerthread.h4
4 files changed, 36 insertions, 61 deletions
diff --git a/linden/indra/llcommon/llmemory.cpp b/linden/indra/llcommon/llmemory.cpp
index 8fa324f..9b6f893 100644
--- a/linden/indra/llcommon/llmemory.cpp
+++ b/linden/indra/llcommon/llmemory.cpp
@@ -36,12 +36,8 @@
36# include <psapi.h> 36# include <psapi.h>
37#elif defined(LL_DARWIN) 37#elif defined(LL_DARWIN)
38# include <sys/types.h> 38# include <sys/types.h>
39# include <sys/sysctl.h>
40# include <mach/task.h> 39# include <mach/task.h>
41# include <mach/vm_map.h>
42# include <mach/mach_init.h> 40# include <mach/mach_init.h>
43# include <mach/vm_region.h>
44# include <mach/mach_port.h>
45#elif defined(LL_LINUX) 41#elif defined(LL_LINUX)
46# include <unistd.h> 42# include <unistd.h>
47#endif 43#endif
@@ -314,13 +310,18 @@ U64 getCurrentRSS()
314 310
315#elif defined(LL_DARWIN) 311#elif defined(LL_DARWIN)
316 312
317// This can cause bad stalls! Replace with fast version 313/*
318 314 The API used here is not capable of dealing with 64-bit memory sizes, but is available before 10.4.
319// static U32 getPageSize() 315
320// { 316 Once we start requiring 10.4, we can use the updated API, which looks like this:
321// int ctl[2] = { CTL_HW, HW_PAGESIZE }; 317
322// int page_size; 318 task_basic_info_64_data_t basicInfo;
323// size_t size = sizeof(page_size); 319 mach_msg_type_number_t basicInfoCount = TASK_BASIC_INFO_64_COUNT;
320 if (task_info(mach_task_self(), TASK_BASIC_INFO_64, (task_info_t)&basicInfo, &basicInfoCount) == KERN_SUCCESS)
321
322 Of course, this doesn't gain us anything unless we start building the viewer as a 64-bit executable, since that's the only way
323 for our memory allocation to exceed 2^32.
324*/
324 325
325// if (sysctl(ctl, 2, &page_size, &size, NULL, 0) == -1) 326// if (sysctl(ctl, 2, &page_size, &size, NULL, 0) == -1)
326// { 327// {
@@ -333,58 +334,25 @@ U64 getCurrentRSS()
333 334
334U64 getCurrentRSS() 335U64 getCurrentRSS()
335{ 336{
336 // Stalls!!! 337 U64 residentSize = 0;
337
338// task_t task = mach_task_self();
339// vm_address_t addr = VM_MIN_ADDRESS;
340// vm_size_t size = 0;
341// U64 residentPages = 0;
342 338
343// while (true) 339 task_basic_info_data_t basicInfo;
344// { 340 mach_msg_type_number_t basicInfoCount = TASK_BASIC_INFO_COUNT;
345// mach_msg_type_number_t bcount = VM_REGION_BASIC_INFO_COUNT; 341 if (task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&basicInfo, &basicInfoCount) == KERN_SUCCESS)
346// vm_region_basic_info binfo; 342 {
347// mach_port_t bobj; 343 residentSize = basicInfo.resident_size;
348// kern_return_t ret;
349
350// addr += size;
351
352// ret = vm_region(task, &addr, &size, VM_REGION_BASIC_INFO,
353// (vm_region_info_t) &binfo, &bcount, &bobj);
354
355// if (ret != KERN_SUCCESS)
356// {
357// break;
358// }
359
360// if (bobj != MACH_PORT_NULL)
361// {
362// mach_port_deallocate(task, bobj);
363// }
364
365// mach_msg_type_number_t ecount = VM_REGION_EXTENDED_INFO_COUNT;
366// vm_region_extended_info einfo;
367// mach_port_t eobj;
368
369// ret = vm_region(task, &addr, &size, VM_REGION_EXTENDED_INFO,
370// (vm_region_info_t) &einfo, &ecount, &eobj);
371
372// if (ret != KERN_SUCCESS)
373// {
374// llwarns << "vm_region failed" << llendl;
375// return 0;
376// }
377
378// if (eobj != MACH_PORT_NULL)
379// {
380// mach_port_deallocate(task, eobj);
381// }
382 344
383// residentPages += einfo.pages_resident; 345 // If we ever wanted it, the process virtual size is also available as:
384// } 346 // virtualSize = basicInfo.virtual_size;
347
348// llinfos << "resident size is " << residentSize << llendl;
349 }
350 else
351 {
352 llwarns << "task_info failed" << llendl;
353 }
385 354
386// return residentPages * getPageSize(); 355 return residentSize;
387 return 0;
388} 356}
389 357
390#elif defined(LL_LINUX) 358#elif defined(LL_LINUX)
diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h
index 036d34b..75cc463 100644
--- a/linden/indra/llcommon/llversionviewer.h
+++ b/linden/indra/llcommon/llversionviewer.h
@@ -34,7 +34,7 @@
34 34
35const S32 LL_VERSION_MAJOR = 1; 35const S32 LL_VERSION_MAJOR = 1;
36const S32 LL_VERSION_MINOR = 20; 36const S32 LL_VERSION_MINOR = 20;
37const S32 LL_VERSION_PATCH = 9; 37const S32 LL_VERSION_PATCH = 10;
38const S32 LL_VERSION_BUILD = 0; 38const S32 LL_VERSION_BUILD = 0;
39 39
40const char * const LL_CHANNEL = "Second Life Release"; 40const char * const LL_CHANNEL = "Second Life Release";
diff --git a/linden/indra/llcommon/llworkerthread.cpp b/linden/indra/llcommon/llworkerthread.cpp
index 6301fa1..0389cff 100644
--- a/linden/indra/llcommon/llworkerthread.cpp
+++ b/linden/indra/llcommon/llworkerthread.cpp
@@ -36,6 +36,7 @@
36#include "llframecallbackmanager.h" 36#include "llframecallbackmanager.h"
37#endif 37#endif
38 38
39BOOL LLWorkerClass::sDeleteLock = FALSE ;
39//============================================================================ 40//============================================================================
40// Run on MAIN thread 41// Run on MAIN thread
41 42
@@ -94,6 +95,7 @@ S32 LLWorkerThread::update(U32 max_time_ms)
94 { 95 {
95 (*iter)->abortWork(false); 96 (*iter)->abortWork(false);
96 } 97 }
98 LLWorkerClass::sDeleteLock = TRUE ;
97 for (std::vector<LLWorkerClass*>::iterator iter = delete_list.begin(); 99 for (std::vector<LLWorkerClass*>::iterator iter = delete_list.begin();
98 iter != delete_list.end(); ++iter) 100 iter != delete_list.end(); ++iter)
99 { 101 {
@@ -107,6 +109,7 @@ S32 LLWorkerThread::update(U32 max_time_ms)
107 } 109 }
108 delete *iter; 110 delete *iter;
109 } 111 }
112 LLWorkerClass::sDeleteLock = FALSE ;
110 // delete and aborted entries mean there's still work to do 113 // delete and aborted entries mean there's still work to do
111 res += delete_list.size() + abort_list.size(); 114 res += delete_list.size() + abort_list.size();
112 return res; 115 return res;
diff --git a/linden/indra/llcommon/llworkerthread.h b/linden/indra/llcommon/llworkerthread.h
index 58f1ead..72f9bc3 100644
--- a/linden/indra/llcommon/llworkerthread.h
+++ b/linden/indra/llcommon/llworkerthread.h
@@ -118,6 +118,9 @@ class LLWorkerClass
118{ 118{
119 friend class LLWorkerThread; 119 friend class LLWorkerThread;
120 friend class LLWorkerThread::WorkRequest; 120 friend class LLWorkerThread::WorkRequest;
121
122public:
123 static BOOL sDeleteLock ;
121public: 124public:
122 typedef LLWorkerThread::handle_t handle_t; 125 typedef LLWorkerThread::handle_t handle_t;
123 enum FLAGS 126 enum FLAGS
@@ -178,6 +181,7 @@ private:
178 void setFlags(U32 flags) { mWorkFlags = mWorkFlags | flags; } 181 void setFlags(U32 flags) { mWorkFlags = mWorkFlags | flags; }
179 void clearFlags(U32 flags) { mWorkFlags = mWorkFlags & ~flags; } 182 void clearFlags(U32 flags) { mWorkFlags = mWorkFlags & ~flags; }
180 U32 getFlags() { return mWorkFlags; } 183 U32 getFlags() { return mWorkFlags; }
184public:
181 bool getFlags(U32 flags) { return mWorkFlags & flags ? true : false; } 185 bool getFlags(U32 flags) { return mWorkFlags & flags ? true : false; }
182 186
183private: 187private: