summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2011-05-20 14:56:10 -0400
committerLoren Shih <seraph@lindenlab.com>2011-05-20 14:56:10 -0400
commit6f5313caea9bb8458dca23bbaf4f10cd6641c7fb (patch)
treeac34191250860e5f250cf1cc2e9199cdaa8204f6 /indra/llcommon
parenteb8221338e0276b9afe8d92738166f97782d48d6 (diff)
parent0b612741d53a044a0179e1c32018bf8cd4213631 (diff)
automated merge mesh-development -> davep-mesh-candidate-2010
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/CMakeLists.txt14
-rw-r--r--indra/llcommon/llaccountingquota.h78
-rw-r--r--indra/llcommon/llapp.cpp7
-rw-r--r--indra/llcommon/llmemory.h12
-rw-r--r--indra/llcommon/llsys.cpp62
-rw-r--r--indra/llcommon/llversionviewer.h4
6 files changed, 158 insertions, 19 deletions
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 22e0705036..9910281b64 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -7,7 +7,6 @@ include(00-Common)
include(LLCommon)
include(Linking)
include(Boost)
-include(Pth)
include(LLSharedLibs)
include(GoogleBreakpad)
include(GooglePerfTools)
@@ -18,7 +17,6 @@ include_directories(
${EXPAT_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
- ${PTH_INCLUDE_DIRS}
)
# add_executable(lltreeiterators lltreeiterators.cpp)
@@ -117,6 +115,7 @@ set(llcommon_HEADER_FILES
indra_constants.h
linden_common.h
linked_lists.h
+ llaccountingquota.h
llallocator.h
llallocator_heap_profile.h
llagentconstants.h
@@ -268,6 +267,10 @@ if(LLCOMMON_LINK_SHARED)
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
+ if(WINDOWS)
+ # always generate llcommon.pdb, even for "Release" builds
+ set_target_properties(llcommon PROPERTIES LINK_FLAGS "/DEBUG")
+ endif(WINDOWS)
ll_stage_sharedlib(llcommon)
else(LLCOMMON_LINK_SHARED)
add_library (llcommon ${llcommon_SOURCE_FILES})
@@ -283,10 +286,15 @@ target_link_libraries(
${WINDOWS_LIBRARIES}
${BOOST_PROGRAM_OPTIONS_LIBRARY}
${BOOST_REGEX_LIBRARY}
- ${PTH_LIBRARIES}
${GOOGLE_PERFTOOLS_LIBRARIES}
)
+if (DARWIN)
+ include(CMakeFindFrameworks)
+ find_library(CARBON_LIBRARY Carbon)
+ target_link_libraries(llcommon ${CARBON_LIBRARY})
+endif (DARWIN)
+
add_dependencies(llcommon stage_third_party_libs)
if (LL_TESTS)
diff --git a/indra/llcommon/llaccountingquota.h b/indra/llcommon/llaccountingquota.h
new file mode 100644
index 0000000000..f52d94f868
--- /dev/null
+++ b/indra/llcommon/llaccountingquota.h
@@ -0,0 +1,78 @@
+/**
+ * @file llaccountingquota.h
+ * @
+ *
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_ACCOUNTINGQUOTA_H
+#define LL_ACCOUNTINGQUOTA_H
+
+struct ParcelQuota
+{
+ ParcelQuota( F32 ownerRenderCost, F32 ownerPhysicsCost, F32 ownerNetworkCost, F32 ownerSimulationCost,
+ F32 groupRenderCost, F32 groupPhysicsCost, F32 groupNetworkCost, F32 groupSimulationCost,
+ F32 otherRenderCost, F32 otherPhysicsCost, F32 otherNetworkCost, F32 otherSimulationCost,
+ F32 totalRenderCost, F32 totalPhysicsCost, F32 totalNetworkCost, F32 totalSimulationCost)
+ : mOwnerRenderCost( ownerRenderCost ), mOwnerPhysicsCost( ownerPhysicsCost )
+ , mOwnerNetworkCost( ownerNetworkCost ), mOwnerSimulationCost( ownerSimulationCost )
+ , mGroupRenderCost( groupRenderCost ), mGroupPhysicsCost( groupPhysicsCost )
+ , mGroupNetworkCost( groupNetworkCost ), mGroupSimulationCost( groupSimulationCost )
+ , mOtherRenderCost( otherRenderCost ), mOtherPhysicsCost( otherPhysicsCost )
+ , mOtherNetworkCost( otherNetworkCost ), mOtherSimulationCost( otherSimulationCost )
+ , mTotalRenderCost( totalRenderCost ), mTotalPhysicsCost( totalPhysicsCost )
+ , mTotalNetworkCost( totalNetworkCost ), mTotalSimulationCost( totalSimulationCost )
+ {
+ }
+ ParcelQuota(){}
+ F32 mOwnerRenderCost, mOwnerPhysicsCost, mOwnerNetworkCost, mOwnerSimulationCost;
+ F32 mGroupRenderCost, mGroupPhysicsCost, mGroupNetworkCost, mGroupSimulationCost;
+ F32 mOtherRenderCost, mOtherPhysicsCost, mOtherNetworkCost, mOtherSimulationCost;
+ F32 mTotalRenderCost, mTotalPhysicsCost, mTotalNetworkCost, mTotalSimulationCost;
+};
+
+struct SelectionQuota
+{
+ SelectionQuota( S32 localId, F32 renderCost, F32 physicsCost, F32 networkCost, F32 simulationCost )
+ : mLocalId( localId)
+ , mRenderCost( renderCost )
+ , mPhysicsCost( physicsCost )
+ , mNetworkCost( networkCost )
+ , mSimulationCost( simulationCost )
+ {
+ }
+ SelectionQuota() {}
+
+ F32 mRenderCost, mPhysicsCost, mNetworkCost, mSimulationCost;
+ S32 mLocalId;
+};
+
+#endif
+
+
+
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index 39daefd1ad..ed192a9975 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -24,6 +24,10 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
+#include "llapp.h"
+
#include <cstdlib>
#ifdef LL_DARWIN
@@ -32,9 +36,6 @@
#include <sys/sysctl.h>
#endif
-#include "linden_common.h"
-#include "llapp.h"
-
#include "llcommon.h"
#include "llapr.h"
#include "llerrorcontrol.h"
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h
index 0adb78236e..3bd1403576 100644
--- a/indra/llcommon/llmemory.h
+++ b/indra/llcommon/llmemory.h
@@ -28,7 +28,7 @@
#include "llmemtype.h"
-#if 0 //DON'T use ll_aligned_foo now that we use tcmalloc everywhere (tcmalloc aligns automatically at appropriate intervals)
+#if LL_DEBUG
inline void* ll_aligned_malloc( size_t size, int align )
{
void* mem = malloc( size + (align - 1) + sizeof(void*) );
@@ -95,7 +95,15 @@ inline void ll_aligned_free_32(void *p)
free(p); // posix_memalign() is compatible with heap deallocator
#endif
}
-#endif
+#else // LL_DEBUG
+// ll_aligned_foo are noops now that we use tcmalloc everywhere (tcmalloc aligns automatically at appropriate intervals)
+#define ll_aligned_malloc( size, align ) malloc(size)
+#define ll_aligned_free( ptr ) free(ptr)
+#define ll_aligned_malloc_16 malloc
+#define ll_aligned_free_16 free
+#define ll_aligned_malloc_32 malloc
+#define ll_aligned_free_32 free
+#endif // LL_DEBUG
class LL_COMMON_API LLMemory
{
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 10cdc7087b..ca2d3f9181 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -46,6 +46,7 @@
# include <sys/sysctl.h>
# include <sys/utsname.h>
# include <stdint.h>
+# include <Carbon/Carbon.h>
#elif LL_LINUX
# include <errno.h>
# include <sys/utsname.h>
@@ -318,7 +319,58 @@ LLOSInfo::LLOSInfo() :
}
mOSString += compatibility_mode;
+#elif LL_DARWIN
+
+ // Initialize mOSStringSimple to something like:
+ // "Mac OS X 10.6.7"
+ {
+ const char * DARWIN_PRODUCT_NAME = "Mac OS X";
+
+ SInt32 major_version, minor_version, bugfix_version;
+ OSErr r1 = Gestalt(gestaltSystemVersionMajor, &major_version);
+ OSErr r2 = Gestalt(gestaltSystemVersionMinor, &minor_version);
+ OSErr r3 = Gestalt(gestaltSystemVersionBugFix, &bugfix_version);
+
+ if((r1 == noErr) && (r2 == noErr) && (r3 == noErr))
+ {
+ mMajorVer = major_version;
+ mMinorVer = minor_version;
+ mBuild = bugfix_version;
+
+ std::stringstream os_version_string;
+ os_version_string << DARWIN_PRODUCT_NAME << " " << mMajorVer << "." << mMinorVer << "." << mBuild;
+
+ // Put it in the OS string we are compiling
+ mOSStringSimple.append(os_version_string.str());
+ }
+ else
+ {
+ mOSStringSimple.append("Unable to collect OS info");
+ }
+ }
+
+ // Initialize mOSString to something like:
+ // "Mac OS X 10.6.7 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386"
+ struct utsname un;
+ if(uname(&un) != -1)
+ {
+ mOSString = mOSStringSimple;
+ mOSString.append(" ");
+ mOSString.append(un.sysname);
+ mOSString.append(" ");
+ mOSString.append(un.release);
+ mOSString.append(" ");
+ mOSString.append(un.version);
+ mOSString.append(" ");
+ mOSString.append(un.machine);
+ }
+ else
+ {
+ mOSString = mOSStringSimple;
+ }
+
#else
+
struct utsname un;
if(uname(&un) != -1)
{
@@ -334,15 +386,7 @@ LLOSInfo::LLOSInfo() :
// Simplify 'Simple'
std::string ostype = mOSStringSimple.substr(0, mOSStringSimple.find_first_of(" ", 0));
- if (ostype == "Darwin")
- {
- // Only care about major Darwin versions, truncate at first '.'
- S32 idx1 = mOSStringSimple.find_first_of(".", 0);
- std::string simple = mOSStringSimple.substr(0, idx1);
- if (simple.length() > 0)
- mOSStringSimple = simple;
- }
- else if (ostype == "Linux")
+ if (ostype == "Linux")
{
// Only care about major and minor Linux versions, truncate at second '.'
std::string::size_type idx1 = mOSStringSimple.find_first_of(".", 0);
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index 08026c38a6..7703132d90 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -28,8 +28,8 @@
#define LL_LLVERSIONVIEWER_H
const S32 LL_VERSION_MAJOR = 2;
-const S32 LL_VERSION_MINOR = 6;
-const S32 LL_VERSION_PATCH = 8;
+const S32 LL_VERSION_MINOR = 7;
+const S32 LL_VERSION_PATCH = 0;
const S32 LL_VERSION_BUILD = 0;
const char * const LL_CHANNEL = "Second Life Developer";