summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-06-27 21:02:01 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-06-27 21:02:01 +0000
commit926ea0b39afd04cab469ca17b28f95ebf969e669 (patch)
tree40d5653e19160f72e7a0b80fadb9bdb93ef3575c /indra/llcommon
parent41877d457ab9542dca22b99f3eddb1bfcfe7c1d6 (diff)
QAR-669 1.20 Viewer RC11
QAR-648 1.20 Viewer RC10 merge Branch_1-20-Viewer-2 -r 88724:90511 -> release
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llmemory.cpp88
-rw-r--r--indra/llcommon/llversionviewer.h2
-rw-r--r--indra/llcommon/llworkerthread.cpp3
-rw-r--r--indra/llcommon/llworkerthread.h4
4 files changed, 36 insertions, 61 deletions
diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index 4ca6a12435..56879f4e73 100644
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -36,12 +36,8 @@
# include <psapi.h>
#elif defined(LL_DARWIN)
# include <sys/types.h>
-# include <sys/sysctl.h>
# include <mach/task.h>
-# include <mach/vm_map.h>
# include <mach/mach_init.h>
-# include <mach/vm_region.h>
-# include <mach/mach_port.h>
#elif defined(LL_LINUX)
# include <unistd.h>
#endif
@@ -314,13 +310,18 @@ U64 getCurrentRSS()
#elif defined(LL_DARWIN)
-// This can cause bad stalls! Replace with fast version
-
-// static U32 getPageSize()
-// {
-// int ctl[2] = { CTL_HW, HW_PAGESIZE };
-// int page_size;
-// size_t size = sizeof(page_size);
+/*
+ The API used here is not capable of dealing with 64-bit memory sizes, but is available before 10.4.
+
+ Once we start requiring 10.4, we can use the updated API, which looks like this:
+
+ task_basic_info_64_data_t basicInfo;
+ mach_msg_type_number_t basicInfoCount = TASK_BASIC_INFO_64_COUNT;
+ if (task_info(mach_task_self(), TASK_BASIC_INFO_64, (task_info_t)&basicInfo, &basicInfoCount) == KERN_SUCCESS)
+
+ 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
+ for our memory allocation to exceed 2^32.
+*/
// if (sysctl(ctl, 2, &page_size, &size, NULL, 0) == -1)
// {
@@ -333,58 +334,25 @@ U64 getCurrentRSS()
U64 getCurrentRSS()
{
- // Stalls!!!
-
-// task_t task = mach_task_self();
-// vm_address_t addr = VM_MIN_ADDRESS;
-// vm_size_t size = 0;
-// U64 residentPages = 0;
+ U64 residentSize = 0;
-// while (true)
-// {
-// mach_msg_type_number_t bcount = VM_REGION_BASIC_INFO_COUNT;
-// vm_region_basic_info binfo;
-// mach_port_t bobj;
-// kern_return_t ret;
-
-// addr += size;
-
-// ret = vm_region(task, &addr, &size, VM_REGION_BASIC_INFO,
-// (vm_region_info_t) &binfo, &bcount, &bobj);
-
-// if (ret != KERN_SUCCESS)
-// {
-// break;
-// }
-
-// if (bobj != MACH_PORT_NULL)
-// {
-// mach_port_deallocate(task, bobj);
-// }
-
-// mach_msg_type_number_t ecount = VM_REGION_EXTENDED_INFO_COUNT;
-// vm_region_extended_info einfo;
-// mach_port_t eobj;
-
-// ret = vm_region(task, &addr, &size, VM_REGION_EXTENDED_INFO,
-// (vm_region_info_t) &einfo, &ecount, &eobj);
-
-// if (ret != KERN_SUCCESS)
-// {
-// llwarns << "vm_region failed" << llendl;
-// return 0;
-// }
-
-// if (eobj != MACH_PORT_NULL)
-// {
-// mach_port_deallocate(task, eobj);
-// }
+ task_basic_info_data_t basicInfo;
+ mach_msg_type_number_t basicInfoCount = TASK_BASIC_INFO_COUNT;
+ if (task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&basicInfo, &basicInfoCount) == KERN_SUCCESS)
+ {
+ residentSize = basicInfo.resident_size;
-// residentPages += einfo.pages_resident;
-// }
+ // If we ever wanted it, the process virtual size is also available as:
+ // virtualSize = basicInfo.virtual_size;
+
+// llinfos << "resident size is " << residentSize << llendl;
+ }
+ else
+ {
+ llwarns << "task_info failed" << llendl;
+ }
-// return residentPages * getPageSize();
- return 0;
+ return residentSize;
}
#elif defined(LL_LINUX)
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 2cdb55eb19..bed6c1dda5 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -34,7 +34,7 @@
const S32 LL_VERSION_MAJOR = 1;
const S32 LL_VERSION_MINOR = 20;
-const S32 LL_VERSION_PATCH = 9;
+const S32 LL_VERSION_PATCH = 11;
const S32 LL_VERSION_BUILD = 0;
const char * const LL_CHANNEL = "Second Life Release";
diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp
index d828ed9468..f3be5a2690 100644
--- a/indra/llcommon/llworkerthread.cpp
+++ b/indra/llcommon/llworkerthread.cpp
@@ -36,6 +36,7 @@
#include "llframecallbackmanager.h"
#endif
+BOOL LLWorkerClass::sDeleteLock = FALSE ;
//============================================================================
// Run on MAIN thread
@@ -94,6 +95,7 @@ S32 LLWorkerThread::update(U32 max_time_ms)
{
(*iter)->abortWork(false);
}
+ LLWorkerClass::sDeleteLock = TRUE ;
for (std::vector<LLWorkerClass*>::iterator iter = delete_list.begin();
iter != delete_list.end(); ++iter)
{
@@ -107,6 +109,7 @@ S32 LLWorkerThread::update(U32 max_time_ms)
}
delete *iter;
}
+ LLWorkerClass::sDeleteLock = FALSE ;
// delete and aborted entries mean there's still work to do
res += delete_list.size() + abort_list.size();
return res;
diff --git a/indra/llcommon/llworkerthread.h b/indra/llcommon/llworkerthread.h
index be06bc2a58..793155308b 100644
--- a/indra/llcommon/llworkerthread.h
+++ b/indra/llcommon/llworkerthread.h
@@ -118,6 +118,9 @@ class LLWorkerClass
{
friend class LLWorkerThread;
friend class LLWorkerThread::WorkRequest;
+
+public:
+ static BOOL sDeleteLock ;
public:
typedef LLWorkerThread::handle_t handle_t;
enum FLAGS
@@ -178,6 +181,7 @@ private:
void setFlags(U32 flags) { mWorkFlags = mWorkFlags | flags; }
void clearFlags(U32 flags) { mWorkFlags = mWorkFlags & ~flags; }
U32 getFlags() { return mWorkFlags; }
+public:
bool getFlags(U32 flags) { return mWorkFlags & flags ? true : false; }
private: