From 13458a96c7f9b77fe22f831baf418633cc38fad6 Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Wed, 6 Apr 2011 03:33:53 +0200 Subject: contributions.txt entry for OPEN-38 --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index 4e91bbdd36..d604cc0d15 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -61,6 +61,7 @@ Aimee Trescothick Alejandro Rosenthal VWR-1184 Aleric Inglewood + OPEN-38 SNOW-240 SNOW-522 SNOW-626 -- cgit v1.3 From 77f89dbaf2970dbb0b4ceb04c6fe084d3d698bdf Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 12 Sep 2011 12:29:36 -0400 Subject: STORM-1579 xml formatting issues in Region/Estate floater Add entry to contributions.txt --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index 5930bab04f..7bbd96cb91 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -572,6 +572,7 @@ Jonathan Yap STORM-1567 STORM-1572 STORM-1574 + STORM-1579 Kadah Coba STORM-1060 Jondan Lundquist -- cgit v1.3 From 48e1a563abfb64b119c47343d0340c8e14c188d5 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 13 Sep 2011 12:40:37 -0400 Subject: VWR-26622: correct recognition of Intel Mobile 4 Series GPUs --- doc/contributions.txt | 1 + indra/newview/gpu_table.txt | 2 +- indra/newview/tests/gpus_results.txt | 1 + indra/newview/tests/gpus_seen.txt | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index 5930bab04f..94f8110aed 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1029,6 +1029,7 @@ Synystyr Texan Takeda Terrawyng TankMaster Finesmith STORM-1100 + VWR-26622 Talamasca Tali Rosca Tayra Dagostino diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 9dad3fe762..86e3bac186 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -283,7 +283,7 @@ Intel Cantiga .*Intel.*Cantiga.* 0 0 Intel Eaglelake .*Intel.*Eaglelake.* 0 1 Intel Graphics Media HD .*Intel.*Graphics Media.*HD.* 0 1 Intel HD Graphics .*Intel.*HD Graphics.* 2 1 -Intel Mobile 4 Series .*Intel.*Mobile *4 Series.* 0 1 +Intel Mobile 4 Series .*Intel.*Mobile.* 4 Series.* 0 1 Intel Media Graphics HD .*Intel.*Media Graphics HD.* 0 1 Intel Montara .*Intel.*Montara.* 0 0 Intel Pineview .*Intel.*Pineview.* 0 1 diff --git a/indra/newview/tests/gpus_results.txt b/indra/newview/tests/gpus_results.txt index 8723554ee6..39ad5bf695 100644 --- a/indra/newview/tests/gpus_results.txt +++ b/indra/newview/tests/gpus_results.txt @@ -741,6 +741,7 @@ Intel Mobile 4 Series Intel Mobile 4 Series Express Chipset Family supported 0 Intel Mobile 4 Series Intel Mobile 45 Express Chipset Family (Microsoft Corporation - WDDM 1.1) UNRECOGNIZED Intel Mobile HD Graphics supported 2 Intel HD Graphics +Intel Mobile Intel(R) 4 Series Express Chipset Family supported 0 Intel Mobile 4 Series Intel Mobile SandyBridge HD Graphics supported 2 Intel HD Graphics Intel Montara unsupported 0 Intel Montara Intel Pineview supported 0 Intel Pineview diff --git a/indra/newview/tests/gpus_seen.txt b/indra/newview/tests/gpus_seen.txt index c807f22b58..98b4adcf39 100644 --- a/indra/newview/tests/gpus_seen.txt +++ b/indra/newview/tests/gpus_seen.txt @@ -739,6 +739,7 @@ Intel Mobile 4 Series Intel Mobile 4 Series Express Chipset Family Intel Mobile 45 Express Chipset Family (Microsoft Corporation - WDDM 1.1) Intel Mobile HD Graphics +Intel Mobile Intel(R) 4 Series Express Chipset Family Intel Mobile SandyBridge HD Graphics Intel Montara Intel Pineview -- cgit v1.3 From ddc74472e9273075e3b2b2f13e7f32ed50771933 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 23 Sep 2011 13:03:11 -0400 Subject: improve recognition of some more ATI Radeon cards, allow class zero use for Humper virtual machines --- doc/contributions.txt | 1 + indra/newview/gpu_table.txt | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index 94f8110aed..54392cf724 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1029,6 +1029,7 @@ Synystyr Texan Takeda Terrawyng TankMaster Finesmith STORM-1100 + STORM-1602 VWR-26622 Talamasca Tali Rosca diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 21cb988819..e95d4d9401 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -94,6 +94,9 @@ ATI M56 .*ATI.*M56.* 1 1 ATI M71 .*ATI.*M71.* 1 1 ATI M72 .*ATI.*M72.* 1 1 ATI M76 .*ATI.*M76.* 3 1 +ATI Radeon HD 64xx .*ATI.*AMD Radeon.* HD [67]4..[MG] 3 1 +ATI Radeon HD 65xx .*ATI.*AMD Radeon.* HD [67]5..[MG] 3 1 +ATI Radeon HD 66xx .*ATI.*AMD Radeon.* HD [67]6..[MG] 3 1 ATI Mobility Radeon 4100 .*ATI.*Mobility.*41.* 1 1 ATI Mobility Radeon 7xxx .*ATI.*Mobility.*Radeon 7.* 0 1 ATI Mobility Radeon 8xxx .*ATI.*Mobility.*Radeon 8.* 0 1 @@ -106,7 +109,6 @@ ATI Mobility Radeon HD 545v .*ATI.*Mobility.*HD *545v.* 2 1 ATI Mobility Radeon HD 550v .*ATI.*Mobility.*HD *550v.* 2 1 ATI Mobility Radeon HD 560v .*ATI.*Mobility.*HD *560v.* 2 1 ATI Mobility Radeon HD 565v .*ATI.*Mobility.*HD *565v.* 2 1 -ATI Radeon HD 64xxM .*ATI.*AMD Radeon.* HD [67]4..M 3 1 ATI Mobility Radeon HD 2300 .*ATI.*Mobility.*HD *23.* 1 1 ATI Mobility Radeon HD 2400 .*ATI.*Mobility.*HD *24.* 1 1 ATI Mobility Radeon HD 2600 .*ATI.*Mobility.*HD *26.* 3 1 @@ -166,7 +168,7 @@ ATI Radeon HD 6200 .*ATI.*Radeon HD *62.. 3 1 ATI Radeon HD 6300 .*ATI.*Radeon HD *63.. 3 1 ATI Radeon HD 6400 .*ATI.*Radeon HD *64.. 3 1 ATI Radeon HD 6500 .*ATI.*Radeon HD *65.. 3 1 -ATI Radeon HD 66xx .*ATI.*Radeon HD *66.. 3 1 +ATI Radeon HD 6600 .*ATI.*Radeon HD *66.. 3 1 ATI Radeon HD 6700 .*ATI.*Radeon HD *67.. 3 1 ATI Radeon HD 6800 .*ATI.*Radeon HD *68.. 3 1 ATI Radeon HD 6900 .*ATI.*Radeon HD *69.. 3 1 @@ -512,3 +514,4 @@ XGI XGI.* 0 0 VIA VIA.* 0 0 Apple Generic Apple.*Generic.* 0 0 Apple Software Renderer Apple.*Software Renderer.* 0 0 +Humper Humper.* 0 1 -- cgit v1.3 From c0410361de85203630b72150ace398c40aa2a1b7 Mon Sep 17 00:00:00 2001 From: "jaeger_reg@tank-pc.ftrdhcpuser.net" Date: Mon, 26 Sep 2011 13:16:17 -0700 Subject: Statistic floater update to improve displayed info. --- doc/contributions.txt | 1 + .../newview/skins/default/xui/en/floater_stats.xml | 339 ++++++++++++++------- 2 files changed, 238 insertions(+), 102 deletions(-) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index bcdc5a63d2..d58b313755 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -1032,6 +1032,7 @@ Synystyr Texan Takeda Terrawyng TankMaster Finesmith STORM-1100 + STORM-1258 Talamasca Tali Rosca Tayra Dagostino diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index b87cb9a433..406114294d 100644 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -10,7 +10,7 @@ save_rect="true" save_visibility="true" title="STATISTICS" - width="250"> + width="260"> - + width="260"> + + @@ -52,9 +53,10 @@ unit_label="kbps" stat="kbitstat" bar_min="0" - bar_max="900" - tick_spacing="100" - label_spacing="300" + bar_max="5000" + tick_spacing="500" + label_spacing="1000" + precision="0" show_bar="true" show_history="false"> @@ -65,9 +67,9 @@ stat="packetslostpercentstat" bar_min="0" bar_max="5" - tick_spacing="1" + tick_spacing="0.5" label_spacing="1" - precision="1" + precision="3" show_per_sec="false" show_bar="false" show_mean="true"> @@ -78,15 +80,17 @@ unit_label="msec" stat="simpingstat" bar_min="0" - bar_max="1000" - tick_spacing="100" - label_spacing="200" + bar_max="5000" + tick_spacing="500" + label_spacing="1000" + precision="0" show_bar="false" show_per_sec="false" show_mean="false"> - + - + bar_max="10000" + tick_spacing="1000" + label_spacing="2000" + precision="0" + show_per_sec="false" + show_bar="false"> + - + bar_max="200000" + tick_spacing="25000" + label_spacing="50000" + precision="0" + show_bar="false"> + @@ -138,13 +144,14 @@ unit_label="/sec" stat="numnewobjectsstat" bar_min="0" - bar_max="1000" - tick_spacing="100" - label_spacing="500" + bar_max="2000" + tick_spacing="200" + label_spacing="400" show_per_sec="true" show_bar="false"> + - + show_per_sec="false" + show_bar="false"> + - + show_per_sec="false" + show_bar="false"> + - + show_per_sec="false" + show_bar="false"> + - + show_per_sec="false" + show_bar="false"> + - + @@ -239,7 +255,12 @@ name="packetsoutstat" label="Packets Out" stat="packetsoutstat" - unit_label="/sec" + unit_label="/sec" + bar_min="0.f" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" show_bar="false" > @@ -247,7 +268,12 @@ name="objectkbitstat" label="Objects" stat="objectkbitstat" - unit_label="kbps" + unit_label="kbps" + bar_min="0.f" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" show_bar="false" > @@ -255,7 +281,12 @@ name="texturekbitstat" label="Texture" stat="texturekbitstat" - unit_label="kbps" + unit_label="kbps" + bar_min="0.f" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" show_bar="false" > @@ -263,7 +294,12 @@ name="assetkbitstat" label="Asset" stat="assetkbitstat" - unit_label="kbps" + unit_label="kbps" + bar_min="0.f" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" show_bar="false" > @@ -271,7 +307,12 @@ name="layerskbitstat" label="Layers" stat="layerskbitstat" - unit_label="kbps" + unit_label="kbps" + bar_min="0.f" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" show_bar="false" > @@ -279,12 +320,13 @@ name="actualinkbitstat" label="Actual In" stat="actualinkbitstat" - unit_label="kbps" - bar_min="0.f" - bar_max="1024.f" - tick_spacing="128.f" - label_spacing="256.f" - show_bar="true" + unit_label="kbps" + bar_min="0.f" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false" show_history="false" > @@ -292,26 +334,27 @@ name="actualoutkbitstat" label="Actual Out" stat="actualoutkbitstat" - unit_label="kbps" - bar_min="0.f" - bar_max="512.f" - tick_spacing="128.f" - label_spacing="256.f" - show_bar="true" + unit_label="kbps" + bar_min="0.f" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false" show_history="false"> - + @@ -335,10 +378,11 @@ name="simfps" label="Sim FPS" stat="simfps" + precision="1" bar_min="0.f" - bar_max="200.f" - tick_spacing="20.f" - label_spacing="100.f" + bar_max="45.f" + tick_spacing="7.5f" + label_spacing="15.f" show_per_sec="false" show_bar="false" show_mean="false" > @@ -350,9 +394,9 @@ stat="simphysicsfps" precision="1" bar_min="0.f" - bar_max="66.f" - tick_spacing="33.f" - label_spacing="33.f" + bar_max="45.f" + tick_spacing="7.5.f" + label_spacing="15.f" show_per_sec="false" show_bar="false" show_mean="false" > @@ -369,8 +413,8 @@ precision="0" bar_min="0.f" bar_max="500.f" - tick_spacing="10.f" - label_spacing="40.f" + tick_spacing="50.f" + label_spacing="100.f" show_per_sec="false" show_bar="false" show_mean="false" > @@ -383,8 +427,8 @@ precision="0" bar_min="0.f" bar_max="500.f" - tick_spacing="10.f" - label_spacing="40.f" + tick_spacing="50.f" + label_spacing="100.f" show_per_sec="false" show_bar="false" show_mean="false" > @@ -395,7 +439,7 @@ label="Memory Allocated" stat="physicsmemoryallocated" unit_label="MB" - precision="0" + precision="1" bar_min="0.f" bar_max="1024.f" tick_spacing="128.f" @@ -468,9 +512,9 @@ stat="simactiveobjects" precision="0" bar_min="0.f" - bar_max="800.f" - tick_spacing="100.f" - label_spacing="200.f" + bar_max="5000.f" + tick_spacing="750.f" + label_spacing="1250.f" show_per_sec="false" show_bar="false" show_mean="false" > @@ -482,9 +526,9 @@ stat="simactivescripts" precision="0" bar_min="0.f" - bar_max="800.f" - tick_spacing="100.f" - label_spacing="200.f" + bar_max="15000.f" + tick_spacing="1875.f" + label_spacing="3750.f" show_per_sec="false" show_bar="false" show_mean="false" > @@ -497,9 +541,9 @@ unit_label="eps" precision="0" bar_min="0.f" - bar_max="20000.f" - tick_spacing="2500.f" - label_spacing="5000.f" + bar_max="5000.f" + tick_spacing="750.f" + label_spacing="1250.f" show_per_sec="false" show_bar="false" show_mean="false" > @@ -568,7 +612,7 @@ label="Total Unacked Bytes" stat="simtotalunackedbytes" unit_label="kb" - precision="0" + precision="1" bar_min="0.f" bar_max="100000.f" tick_spacing="25000.f" @@ -587,7 +631,7 @@ label="Total Frame Time" stat="simframemsec" unit_label="ms" - precision="1" + precision="3" bar_min="0.f" bar_max="40.f" tick_spacing="10.f" @@ -602,7 +646,7 @@ label="Net Time" stat="simnetmsec" unit_label="ms" - precision="1" + precision="3" bar_min="0.f" bar_max="40.f" tick_spacing="10.f" @@ -617,7 +661,7 @@ label="Physics Time" stat="simsimphysicsmsec" unit_label="ms" - precision="1" + precision="3" bar_min="0.f" bar_max="40.f" tick_spacing="10.f" @@ -632,7 +676,7 @@ label="Simulation Time" stat="simsimothermsec" unit_label="ms" - precision="1" + precision="3" bar_min="0.f" bar_max="40.f" tick_spacing="10.f" @@ -647,7 +691,7 @@ label="Agent Time" stat="simagentmsec" unit_label="ms" - precision="1" + precision="3" bar_min="0.f" bar_max="40.f" tick_spacing="10.f" @@ -662,7 +706,7 @@ label="Images Time" stat="simimagesmsec" unit_label="ms" - precision="1" + precision="3" bar_min="0.f" bar_max="40.f" tick_spacing="10.f" @@ -677,7 +721,7 @@ label="Script Time" stat="simscriptmsec" unit_label="ms" - precision="1" + precision="3" bar_min="0.f" bar_max="40.f" tick_spacing="10.f" @@ -686,6 +730,97 @@ show_bar="false" show_mean="false" > + + + + + + + + + + + + + + + + -- cgit v1.3 From fd91f09e19f937cb7e2f779c4e146064415ad427 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 6 Oct 2011 16:37:11 -0400 Subject: STORM-1602 improvements from leliel Mirihi, and more optimizations --- doc/contributions.txt | 1 + indra/newview/gpu_table.txt | 410 +++++++++++++++++++++++--------------------- 2 files changed, 215 insertions(+), 196 deletions(-) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index 54392cf724..99472f6380 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -619,6 +619,7 @@ Latif Khalifa VWR-5370 leliel Mirihi STORM-1100 + STORM-1602 len Starship Lisa Lowe CT-218 diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index e95d4d9401..c5e66d2682 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -44,6 +44,7 @@ ATI All-in-Wonder X1800 .*ATI.*All-in-Wonder X18.* 3 1 ATI All-in-Wonder X1900 .*ATI.*All-in-Wonder X19.* 3 1 ATI All-in-Wonder PCI-E .*ATI.*All-in-Wonder.*PCI-E.* 1 1 ATI All-in-Wonder Radeon .*ATI.*All-in-Wonder Radeon.* 0 1 +ATI ASUS ARES .*ATI.*ASUS.*ARES.* 3 1 ATI ASUS A9xxx .*ATI.*ASUS.*A9.* 1 1 ATI ASUS AH24xx .*ATI.*ASUS.*AH24.* 1 1 ATI ASUS AH26xx .*ATI.*ASUS.*AH26.* 3 1 @@ -55,6 +56,7 @@ ATI ASUS AX5xx .*ATI.*ASUS.*AX5.* 1 1 ATI ASUS AX8xx .*ATI.*ASUS.*AX8.* 2 1 ATI ASUS EAH24xx .*ATI.*ASUS.*EAH24.* 2 1 ATI ASUS EAH26xx .*ATI.*ASUS.*EAH26.* 3 1 +ATI ASUS EAH29xx .*ATI.*ASUS.*EAH29.* 3 1 ATI ASUS EAH34xx .*ATI.*ASUS.*EAH34.* 1 1 ATI ASUS EAH36xx .*ATI.*ASUS.*EAH36.* 3 1 ATI ASUS EAH38xx .*ATI.*ASUS.*EAH38.* 3 1 @@ -73,6 +75,7 @@ ATI Radeon X16xx .*ATI.*(Radeon|Diamond) X16.* ?.* 2 1 ATI Radeon X15xx .*ATI.*(Radeon|Diamond) X15.* ?.* 2 1 ATI Radeon X13xx .*ATI.*(Radeon|Diamond) X13.* ?.* 1 1 ATI Radeon X1xxx .*ATI.*(Radeon|Diamond) X1.. ?.* 1 1 +ATI Radeon X2xxx .*ATI.*(Radeon|Diamond) X2.. ?.* 1 1 ATI Display Adapter .*ATI.*display adapter.* 0 1 ATI FireGL 5200 .*ATI.*FireGL V52.* 0 1 ATI FireGL 5xxx .*ATI.*FireGL V5.* 1 1 @@ -97,7 +100,7 @@ ATI M76 .*ATI.*M76.* 3 1 ATI Radeon HD 64xx .*ATI.*AMD Radeon.* HD [67]4..[MG] 3 1 ATI Radeon HD 65xx .*ATI.*AMD Radeon.* HD [67]5..[MG] 3 1 ATI Radeon HD 66xx .*ATI.*AMD Radeon.* HD [67]6..[MG] 3 1 -ATI Mobility Radeon 4100 .*ATI.*Mobility.*41.* 1 1 +ATI Mobility Radeon 4100 .*ATI.*Mobility.*41.. 1 1 ATI Mobility Radeon 7xxx .*ATI.*Mobility.*Radeon 7.* 0 1 ATI Mobility Radeon 8xxx .*ATI.*Mobility.*Radeon 8.* 0 1 ATI Mobility Radeon 9800 .*ATI.*Mobility.*98.* 1 1 @@ -194,12 +197,12 @@ ATI RS880M .*ATI.*RS880M 1 1 ATI Radeon RX9550 .*ATI.*RX9550.* 1 1 ATI Radeon VE .*ATI.*Radeon.*VE.* 0 0 ATI Radeon X300 .*ATI.*Radeon *X3.* 0 1 -ATI Radeon X400 .*ATI.*Radeon X4.* 0 1 -ATI Radeon X500 .*ATI.*Radeon X5.* 0 1 -ATI Radeon X600 .*ATI.*Radeon X6.* 1 1 -ATI Radeon X700 .*ATI.*Radeon X7.* 1 1 -ATI Radeon X800 .*ATI.*Radeon X8.* 2 1 -ATI Radeon X900 .*ATI.*Radeon X9.* 2 1 +ATI Radeon X400 .*ATI.*Radeon ?X4.* 0 1 +ATI Radeon X500 .*ATI.*Radeon ?X5.* 0 1 +ATI Radeon X600 .*ATI.*Radeon ?X6.* 1 1 +ATI Radeon X700 .*ATI.*Radeon ?X7.* 1 1 +ATI Radeon X800 .*ATI.*Radeon ?X8.* 2 1 +ATI Radeon X900 .*ATI.*Radeon ?X9.* 2 1 ATI Radeon Xpress .*ATI.*Radeon Xpress.* 0 1 ATI Rage 128 .*ATI.*Rage 128.* 0 1 ATI R350 (9800) .*R350.* 1 1 @@ -285,196 +288,210 @@ Intel HD Graphics 2000 .*Intel.*HD2000.* 1 1 Intel HD Graphics 3000 .*Intel.*HD3000.* 2 1 Matrox .*Matrox.* 0 0 Mesa .*Mesa.* 0 0 -NVIDIA 205 .*NVIDIA.*GeForce 205.* 2 1 -NVIDIA 210 .*NVIDIA.*GeForce 210.* 2 1 -NVIDIA 310M .*NVIDIA.*GeForce 310M.* 1 1 -NVIDIA 310 .*NVIDIA.*GeForce 310.* 3 1 -NVIDIA 315M .*NVIDIA.*GeForce 315M.* 2 1 -NVIDIA 315 .*NVIDIA.*GeForce 315.* 3 1 -NVIDIA 320M .*NVIDIA.*GeForce 320M.* 2 1 -NVIDIA G100M .*NVIDIA *(GeForce)? *(G)? ?100M.* 0 1 -NVIDIA G100 .*NVIDIA *(GeForce)? *(G)? ?100.* 0 1 -NVIDIA G102M .*NVIDIA *(GeForce)? *(G)? ?102M.* 0 1 -NVIDIA G103M .*NVIDIA *(GeForce)? *(G)? ?103M.* 0 1 -NVIDIA G105M .*NVIDIA *(GeForce)? *(G)? ?105M.* 0 1 -NVIDIA G 110M .*NVIDIA *(GeForce)? *(G)? ?110M.* 0 1 -NVIDIA G 120M .*NVIDIA *(GeForce)? *(G)? ?120M.* 1 1 -NVIDIA G 200 .*NVIDIA *(GeForce)? *(G)? ?200(M)?.* 0 1 -NVIDIA G 205M .*NVIDIA *(GeForce)? *(G)? ?205(M)?.* 0 1 -NVIDIA G 210 .*NVIDIA *(GeForce)? *(G)? ?210(M)?.* 1 1 -NVIDIA 305M .*NVIDIA *(GeForce)? *(G)? ?305(M)?.* 1 1 -NVIDIA G 310M .*NVIDIA *(GeForce)? *(G)? ?310(M)?.* 2 1 -NVIDIA G 315 .*NVIDIA *(GeForce)? *(G)? ?315(M)?.* 2 1 -NVIDIA G 320M .*NVIDIA *(GeForce)? *(G)? ?320(M)?.* 2 1 -NVIDIA G 405 .*NVIDIA *(GeForce)? *(G)? ?405(M)?.* 1 1 -NVIDIA G 410M .*NVIDIA *(GeForce)? *(G)? ?410(M)?.* 1 1 -NVIDIA GT 120M .*NVIDIA *(GeForce)? *GT *120(M)?.* 2 1 -NVIDIA GT 120 .*NVIDIA.*GT.*120 2 1 -NVIDIA GT 130M .*NVIDIA *(GeForce)? *GT *130(M)?.* 2 1 -NVIDIA GT 140M .*NVIDIA *(GeForce)? *GT *140(M)?.* 2 1 -NVIDIA GT 150M .*NVIDIA *(GeForce)? *GT(S)? *150(M)?.* 2 1 -NVIDIA GT 160M .*NVIDIA *(GeForce)? *GT *160(M)?.* 2 1 -NVIDIA GT 220M .*NVIDIA *(GeForce)? *GT *220(M)?.* 2 1 -NVIDIA GT 230M .*NVIDIA *(GeForce)? *GT *230(M)?.* 2 1 -NVIDIA GT 240M .*NVIDIA *(GeForce)? *GT *240(M)?.* 2 1 -NVIDIA GT 250M .*NVIDIA *(GeForce)? *GT *250(M)?.* 2 1 -NVIDIA GT 260M .*NVIDIA *(GeForce)? *GT *260(M)?.* 2 1 -NVIDIA GT 320M .*NVIDIA *(GeForce)? *GT *320(M)?.* 2 1 -NVIDIA GT 325M .*NVIDIA *(GeForce)? *GT *325(M)?.* 0 1 -NVIDIA GT 330M .*NVIDIA *(GeForce)? *GT *330(M)?.* 3 1 -NVIDIA GT 335M .*NVIDIA *(GeForce)? *GT *335(M)?.* 1 1 -NVIDIA GT 340M .*NVIDIA *(GeForce)? *GT *340(M)?.* 2 1 -NVIDIA GT 415M .*NVIDIA *(GeForce)? *GT *415(M)?.* 2 1 -NVIDIA GT 420M .*NVIDIA *(GeForce)? *GT *420(M)?.* 2 1 -NVIDIA GT 425M .*NVIDIA *(GeForce)? *GT *425(M)?.* 3 1 -NVIDIA GT 430M .*NVIDIA *(GeForce)? *GT *430(M)?.* 3 1 -NVIDIA GT 435M .*NVIDIA *(GeForce)? *GT *435(M)?.* 3 1 -NVIDIA GT 440M .*NVIDIA *(GeForce)? *GT *440(M)?.* 3 1 -NVIDIA GT 445M .*NVIDIA *(GeForce)? *GT *445(M)?.* 3 1 -NVIDIA GT 450M .*NVIDIA *(GeForce)? *GT *450(M)?.* 3 1 -NVIDIA GT 520M .*NVIDIA *(GeForce)? *GT *520(M)?.* 3 1 -NVIDIA GT 525M .*NVIDIA *(GeForce)? *GT *525(M)?.* 3 1 -NVIDIA GT 540M .*NVIDIA *(GeForce)? *GT *540(M)?.* 3 1 -NVIDIA GT 550M .*NVIDIA *(GeForce)? *GT *550(M)?.* 3 1 -NVIDIA GT 555M .*NVIDIA *(GeForce)? *GT *555(M)?.* 3 1 -NVIDIA GTS 160M .*NVIDIA *(GeForce)? *GT(S)? *160(M)?.* 2 1 -NVIDIA GTS 240 .*NVIDIA *(GeForce)? *GTS *24.* 3 1 -NVIDIA GTS 250 .*NVIDIA *(GeForce)? *GTS *25.* 3 1 -NVIDIA GTS 350M .*NVIDIA *(GeForce)? *GTS *350M.* 3 1 -NVIDIA GTS 360M .*NVIDIA *(GeForce)? *GTS *360M.* 3 1 -NVIDIA GTS 360 .*NVIDIA *(GeForce)? *GTS *360.* 3 1 -NVIDIA GTS 450 .*NVIDIA *(GeForce)? *GTS *45.* 3 1 -NVIDIA GTX 260 .*NVIDIA *(GeForce)? *GTX *26.* 3 1 -NVIDIA GTX 275 .*NVIDIA *(GeForce)? *GTX *275.* 3 1 -NVIDIA GTX 270 .*NVIDIA *(GeForce)? *GTX *27.* 3 1 -NVIDIA GTX 285 .*NVIDIA *(GeForce)? *GTX *285.* 3 1 -NVIDIA GTX 280 .*NVIDIA *(GeForce)? *GTX *280.* 3 1 -NVIDIA GTX 290 .*NVIDIA *(GeForce)? *GTX *290.* 3 1 -NVIDIA GTX 295 .*NVIDIA *(GeForce)? *GTX *295.* 3 1 -NVIDIA GTX 460M .*NVIDIA *(GeForce)? *GTX *460M.* 3 1 -NVIDIA GTX 465 .*NVIDIA *(GeForce)? *GTX *465.* 3 1 -NVIDIA GTX 460 .*NVIDIA *(GeForce)? *GTX *46.* 3 1 -NVIDIA GTX 470M .*NVIDIA *(GeForce)? *GTX *470M.* 3 1 -NVIDIA GTX 470 .*NVIDIA *(GeForce)? *GTX *47.* 3 1 -NVIDIA GTX 480M .*NVIDIA *(GeForce)? *GTX *480M.* 3 1 -NVIDIA GTX 485M .*NVIDIA *(GeForce)? *GTX *485M.* 3 1 -NVIDIA GTX 480 .*NVIDIA *(GeForce)? *GTX *48.* 3 1 -NVIDIA GTX 530 .*NVIDIA *(GeForce)? *GTX *53.* 3 1 -NVIDIA GTX 550 .*NVIDIA *(GeForce)? *GTX *55.* 3 1 -NVIDIA GTX 560 .*NVIDIA *(GeForce)? *GTX *56.* 3 1 -NVIDIA GTX 570 .*NVIDIA *(GeForce)? *GTX *57.* 3 1 -NVIDIA GTX 580M .*NVIDIA *(GeForce)? *GTX *580M.* 3 1 -NVIDIA GTX 580 .*NVIDIA *(GeForce)? *GTX *58.* 3 1 -NVIDIA GTX 590 .*NVIDIA *(GeForce)? *GTX *59.* 3 1 -NVIDIA C51 .*NVIDIA *(GeForce)? *C51.* 0 1 -NVIDIA G72 .*NVIDIA *(GeForce)? *G72.* 1 1 -NVIDIA G73 .*NVIDIA *(GeForce)? *G73.* 1 1 -NVIDIA G84 .*NVIDIA *(GeForce)? *G84.* 2 1 -NVIDIA G86 .*NVIDIA *(GeForce)? *G86.* 3 1 -NVIDIA G92 .*NVIDIA *(GeForce)? *G92.* 3 1 +NVIDIA 205 .*NVIDIA .*GeForce 205.* 2 1 +NVIDIA 210 .*NVIDIA .*GeForce 210.* 2 1 +NVIDIA 310M .*NVIDIA .*GeForce 310M.* 1 1 +NVIDIA 310 .*NVIDIA .*GeForce 310.* 3 1 +NVIDIA 315M .*NVIDIA .*GeForce 315M.* 2 1 +NVIDIA 315 .*NVIDIA .*GeForce 315.* 3 1 +NVIDIA 320M .*NVIDIA .*GeForce 320M.* 2 1 +NVIDIA G100M .*NVIDIA .*100M.* 0 1 +NVIDIA G100 .*NVIDIA .*100.* 0 1 +NVIDIA G102M .*NVIDIA .*102M.* 0 1 +NVIDIA G103M .*NVIDIA .*103M.* 0 1 +NVIDIA G105M .*NVIDIA .*105M.* 0 1 +NVIDIA G 110M .*NVIDIA .*110M.* 0 1 +NVIDIA G 120M .*NVIDIA .*120M.* 1 1 +NVIDIA G 200 .*NVIDIA .*200(M)?.* 0 1 +NVIDIA G 205M .*NVIDIA .*205(M)?.* 0 1 +NVIDIA G 210 .*NVIDIA .*210(M)?.* 1 1 +NVIDIA 305M .*NVIDIA .*305(M)?.* 1 1 +NVIDIA G 310M .*NVIDIA .*310(M)?.* 2 1 +NVIDIA G 315 .*NVIDIA .*315(M)?.* 2 1 +NVIDIA G 320M .*NVIDIA .*320(M)?.* 2 1 +NVIDIA G 405 .*NVIDIA .*405(M)?.* 1 1 +NVIDIA G 410M .*NVIDIA .*410(M)?.* 1 1 +NVIDIA GT 120M .*NVIDIA .*GT *120(M)?.* 2 1 +NVIDIA GT 120 .*NVIDIA .*GT.*120 2 1 +NVIDIA GT 130M .*NVIDIA .*GT *130(M)?.* 2 1 +NVIDIA GT 140M .*NVIDIA .*GT *140(M)?.* 2 1 +NVIDIA GT 150M .*NVIDIA .*GT(S)? *150(M)?.* 2 1 +NVIDIA GT 160M .*NVIDIA .*GT *160(M)?.* 2 1 +NVIDIA GT 220M .*NVIDIA .*GT *220(M)?.* 2 1 +NVIDIA GT 230M .*NVIDIA .*GT *230(M)?.* 2 1 +NVIDIA GT 240M .*NVIDIA .*GT *240(M)?.* 2 1 +NVIDIA GT 250M .*NVIDIA .*GT *250(M)?.* 2 1 +NVIDIA GT 260M .*NVIDIA .*GT *260(M)?.* 2 1 +NVIDIA GT 320M .*NVIDIA .*GT *320(M)?.* 2 1 +NVIDIA GT 325M .*NVIDIA .*GT *325(M)?.* 0 1 +NVIDIA GT 330M .*NVIDIA .*GT *330(M)?.* 3 1 +NVIDIA GT 335M .*NVIDIA .*GT *335(M)?.* 1 1 +NVIDIA GT 340M .*NVIDIA .*GT *340(M)?.* 2 1 +NVIDIA GT 415M .*NVIDIA .*GT *415(M)?.* 2 1 +NVIDIA GT 420M .*NVIDIA .*GT *420(M)?.* 2 1 +NVIDIA GT 425M .*NVIDIA .*GT *425(M)?.* 3 1 +NVIDIA GT 430M .*NVIDIA .*GT *430(M)?.* 3 1 +NVIDIA GT 435M .*NVIDIA .*GT *435(M)?.* 3 1 +NVIDIA GT 440M .*NVIDIA .*GT *440(M)?.* 3 1 +NVIDIA GT 445M .*NVIDIA .*GT *445(M)?.* 3 1 +NVIDIA GT 450M .*NVIDIA .*GT *450(M)?.* 3 1 +NVIDIA GT 520M .*NVIDIA .*GT *52.(M)?.* 3 1 +NVIDIA GT 530M .*NVIDIA .*GT *530(M)?.* 3 1 +NVIDIA GT 540M .*NVIDIA .*GT *54.(M)?.* 3 1 +NVIDIA GT 550M .*NVIDIA .*GT *550(M)?.* 3 1 +NVIDIA GT 555M .*NVIDIA .*GT *555(M)?.* 3 1 +NVIDIA GTS 160M .*NVIDIA .*GT(S)? *160(M)?.* 2 1 +NVIDIA GTS 240 .*NVIDIA .*GTS *24.* 3 1 +NVIDIA GTS 250 .*NVIDIA .*GTS *25.* 3 1 +NVIDIA GTS 350M .*NVIDIA .*GTS *350M.* 3 1 +NVIDIA GTS 360M .*NVIDIA .*GTS *360M.* 3 1 +NVIDIA GTS 360 .*NVIDIA .*GTS *360.* 3 1 +NVIDIA GTS 450 .*NVIDIA .*GTS *45.* 3 1 +NVIDIA GTX 260 .*NVIDIA .*GTX *26.* 3 1 +NVIDIA GTX 275 .*NVIDIA .*GTX *275.* 3 1 +NVIDIA GTX 270 .*NVIDIA .*GTX *27.* 3 1 +NVIDIA GTX 285 .*NVIDIA .*GTX *285.* 3 1 +NVIDIA GTX 280 .*NVIDIA .*GTX *280.* 3 1 +NVIDIA GTX 290 .*NVIDIA .*GTX *290.* 3 1 +NVIDIA GTX 295 .*NVIDIA .*GTX *295.* 3 1 +NVIDIA GTX 460M .*NVIDIA .*GTX *460M.* 3 1 +NVIDIA GTX 465 .*NVIDIA .*GTX *465.* 3 1 +NVIDIA GTX 460 .*NVIDIA .*GTX *46.* 3 1 +NVIDIA GTX 470M .*NVIDIA .*GTX *470M.* 3 1 +NVIDIA GTX 470 .*NVIDIA .*GTX *47.* 3 1 +NVIDIA GTX 480M .*NVIDIA .*GTX *480M.* 3 1 +NVIDIA GTX 485M .*NVIDIA .*GTX *485M.* 3 1 +NVIDIA GTX 480 .*NVIDIA .*GTX *48.* 3 1 +NVIDIA GTX 530 .*NVIDIA .*GTX *53.* 3 1 +NVIDIA GTX 550 .*NVIDIA .*GTX *55.* 3 1 +NVIDIA GTX 560 .*NVIDIA .*GTX *56.* 3 1 +NVIDIA GTX 570 .*NVIDIA .*GTX *57.* 3 1 +NVIDIA GTX 580M .*NVIDIA .*GTX *580M.* 3 1 +NVIDIA GTX 580 .*NVIDIA .*GTX *58.* 3 1 +NVIDIA GTX 590 .*NVIDIA .*GTX *59.* 3 1 +NVIDIA C51 .*NVIDIA .*C51.* 0 1 +NVIDIA G72 .*NVIDIA .*G72.* 1 1 +NVIDIA G73 .*NVIDIA .*G73.* 1 1 +NVIDIA G84 .*NVIDIA .*G84.* 2 1 +NVIDIA G86 .*NVIDIA .*G86.* 3 1 +NVIDIA G92 .*NVIDIA .*G92.* 3 1 NVIDIA GeForce .*GeForce 256.* 0 0 NVIDIA GeForce 2 .*GeForce ?2 ?.* 0 1 NVIDIA GeForce 3 .*GeForce ?3 ?.* 0 1 NVIDIA GeForce 3 Ti .*GeForce ?3 Ti.* 0 1 -NVIDIA GeForce 4 .*NVIDIA.*GeForce ?4.* 0 1 -NVIDIA GeForce 4 Go .*NVIDIA.*GeForce ?4.*Go.* 0 1 -NVIDIA GeForce 4 MX .*NVIDIA.*GeForce ?4 MX.* 0 1 -NVIDIA GeForce 4 PCX .*NVIDIA.*GeForce ?4 PCX.* 0 1 -NVIDIA GeForce 4 Ti .*NVIDIA.*GeForce ?4 Ti.* 0 1 -NVIDIA GeForce 6100 .*NVIDIA.*GeForce 61.* 0 1 -NVIDIA GeForce 6200 .*NVIDIA.*GeForce 62.* 0 1 -NVIDIA GeForce 6500 .*NVIDIA.*GeForce 65.* 0 1 -NVIDIA GeForce 6600 .*NVIDIA.*GeForce 66.* 1 1 -NVIDIA GeForce 6700 .*NVIDIA.*GeForce 67.* 2 1 -NVIDIA GeForce 6800 .*NVIDIA.*GeForce 68.* 2 1 -NVIDIA GeForce 7000 .*NVIDIA.*GeForce 70.* 0 1 -NVIDIA GeForce 7100 .*NVIDIA.*GeForce 71.* 0 1 -NVIDIA GeForce 7200 .*NVIDIA.*GeForce 72.* 1 1 -NVIDIA GeForce 7300 .*NVIDIA.*GeForce 73.* 1 1 -NVIDIA GeForce 7500 .*NVIDIA.*GeForce 75.* 1 1 -NVIDIA GeForce 7600 .*NVIDIA.*GeForce 76.* 2 1 -NVIDIA GeForce 7800 .*NVIDIA.*GeForce 78.* 2 1 -NVIDIA GeForce 7900 .*NVIDIA.*GeForce 79.* 2 1 -NVIDIA GeForce 8100 .*NVIDIA.*GeForce 81.* 1 1 -NVIDIA GeForce 8200M .*NVIDIA.*GeForce 8200M.* 1 1 -NVIDIA GeForce 8200 .*NVIDIA.*GeForce 82.* 1 1 -NVIDIA GeForce 8300 .*NVIDIA.*GeForce 83.* 1 1 -NVIDIA GeForce 8400M .*NVIDIA.*GeForce 8400M.* 1 1 -NVIDIA GeForce 8400 .*NVIDIA.*GeForce 84.* 1 1 -NVIDIA GeForce 8500 .*NVIDIA.*GeForce 85.* 3 1 -NVIDIA GeForce 8600M .*NVIDIA.*GeForce 8600M.* 1 1 -NVIDIA GeForce 8600 .*NVIDIA.*GeForce 86.* 3 1 -NVIDIA GeForce 8700M .*NVIDIA.*GeForce 8700M.* 3 1 -NVIDIA GeForce 8700 .*NVIDIA.*GeForce 87.* 3 1 -NVIDIA GeForce 8800M .*NVIDIA.*GeForce 8800M.* 3 1 -NVIDIA GeForce 8800 .*NVIDIA.*GeForce 88.* 3 1 -NVIDIA GeForce 9100M .*NVIDIA.*GeForce 9100M.* 0 1 -NVIDIA GeForce 9100 .*NVIDIA.*GeForce 91.* 0 1 -NVIDIA GeForce 9200M .*NVIDIA.*GeForce 9200M.* 1 1 -NVIDIA GeForce 9200 .*NVIDIA.*GeForce 92.* 1 1 -NVIDIA GeForce 9300M .*NVIDIA.*GeForce 9300M.* 1 1 -NVIDIA GeForce 9300 .*NVIDIA.*GeForce 93.* 1 1 -NVIDIA GeForce 9400M .*NVIDIA.*GeForce 9400M.* 1 1 -NVIDIA GeForce 9400 .*NVIDIA.*GeForce 94.* 1 1 -NVIDIA GeForce 9500M .*NVIDIA.*GeForce 9500M.* 2 1 -NVIDIA GeForce 9500 .*NVIDIA.*GeForce 95.* 2 1 -NVIDIA GeForce 9600M .*NVIDIA.*GeForce 9600M.* 3 1 -NVIDIA GeForce 9600 .*NVIDIA.*GeForce 96.* 2 1 -NVIDIA GeForce 9700M .*NVIDIA.*GeForce 9700M.* 2 1 -NVIDIA GeForce 9800M .*NVIDIA.*GeForce 9800M.* 3 1 -NVIDIA GeForce 9800 .*NVIDIA.*GeForce 98.* 3 1 -NVIDIA GeForce FX 5100 .*NVIDIA.*GeForce FX 51.* 0 1 -NVIDIA GeForce FX 5200 .*NVIDIA.*GeForce FX 52.* 0 1 -NVIDIA GeForce FX 5300 .*NVIDIA.*GeForce FX 53.* 0 1 -NVIDIA GeForce FX 5500 .*NVIDIA.*GeForce FX 55.* 0 1 -NVIDIA GeForce FX 5600 .*NVIDIA.*GeForce FX 56.* 0 1 -NVIDIA GeForce FX 5700 .*NVIDIA.*GeForce FX 57.* 1 1 -NVIDIA GeForce FX 5800 .*NVIDIA.*GeForce FX 58.* 1 1 -NVIDIA GeForce FX 5900 .*NVIDIA.*GeForce FX 59.* 1 1 -NVIDIA GeForce FX Go5100 .*NVIDIA.*GeForce FX Go51.* 0 1 -NVIDIA GeForce FX Go5200 .*NVIDIA.*GeForce FX Go52.* 0 1 -NVIDIA GeForce FX Go5300 .*NVIDIA.*GeForce FX Go53.* 0 1 -NVIDIA GeForce FX Go5500 .*NVIDIA.*GeForce FX Go55.* 0 1 -NVIDIA GeForce FX Go5600 .*NVIDIA.*GeForce FX Go56.* 0 1 -NVIDIA GeForce FX Go5700 .*NVIDIA.*GeForce FX Go57.* 1 1 -NVIDIA GeForce FX Go5800 .*NVIDIA.*GeForce FX Go58.* 1 1 -NVIDIA GeForce FX Go5900 .*NVIDIA.*GeForce FX Go59.* 1 1 -NVIDIA GeForce FX Go5xxx .*NVIDIA.*GeForce FX Go.* 0 1 -NVIDIA GeForce Go 6100 .*NVIDIA.*GeForce Go 61.* 0 1 -NVIDIA GeForce Go 6200 .*NVIDIA.*GeForce Go 62.* 0 1 -NVIDIA GeForce Go 6400 .*NVIDIA.*GeForce Go 64.* 1 1 -NVIDIA GeForce Go 6500 .*NVIDIA.*GeForce Go 65.* 1 1 -NVIDIA GeForce Go 6600 .*NVIDIA.*GeForce Go 66.* 1 1 -NVIDIA GeForce Go 6700 .*NVIDIA.*GeForce Go 67.* 1 1 -NVIDIA GeForce Go 6800 .*NVIDIA.*GeForce Go 68.* 1 1 -NVIDIA GeForce Go 7200 .*NVIDIA.*GeForce Go 72.* 1 1 -NVIDIA GeForce Go 7300 LE .*NVIDIA.*GeForce Go 73.*LE.* 0 1 -NVIDIA GeForce Go 7300 .*NVIDIA.*GeForce Go 73.* 1 1 -NVIDIA GeForce Go 7400 .*NVIDIA.*GeForce Go 74.* 1 1 -NVIDIA GeForce Go 7600 .*NVIDIA.*GeForce Go 76.* 2 1 -NVIDIA GeForce Go 7700 .*NVIDIA.*GeForce Go 77.* 2 1 -NVIDIA GeForce Go 7800 .*NVIDIA.*GeForce Go 78.* 2 1 -NVIDIA GeForce Go 7900 .*NVIDIA.*GeForce Go 79.* 2 1 -NVIDIA D9M .*NVIDIA.*D9M.* 1 1 -NVIDIA G94 .*NVIDIA.*G94.* 3 1 +NVIDIA GeForce 4 .*NVIDIA .*GeForce ?4.* 0 1 +NVIDIA GeForce 4 Go .*NVIDIA .*GeForce ?4.*Go.* 0 1 +NVIDIA GeForce 4 MX .*NVIDIA .*GeForce ?4 MX.* 0 1 +NVIDIA GeForce 4 PCX .*NVIDIA .*GeForce ?4 PCX.* 0 1 +NVIDIA GeForce 4 Ti .*NVIDIA .*GeForce ?4 Ti.* 0 1 +NVIDIA GeForce 6100 .*NVIDIA .*GeForce 61.* 0 1 +NVIDIA GeForce 6200 .*NVIDIA .*GeForce 62.* 0 1 +NVIDIA GeForce 6500 .*NVIDIA .*GeForce 65.* 0 1 +NVIDIA GeForce 6600 .*NVIDIA .*GeForce 66.* 1 1 +NVIDIA GeForce 6700 .*NVIDIA .*GeForce 67.* 2 1 +NVIDIA GeForce 6800 .*NVIDIA .*GeForce 68.* 2 1 +NVIDIA GeForce 7000 .*NVIDIA .*GeForce 70.* 0 1 +NVIDIA GeForce 7100 .*NVIDIA .*GeForce 71.* 0 1 +NVIDIA GeForce 7200 .*NVIDIA .*GeForce 72.* 1 1 +NVIDIA GeForce 7300 .*NVIDIA .*GeForce 73.* 1 1 +NVIDIA GeForce 7500 .*NVIDIA .*GeForce 75.* 1 1 +NVIDIA GeForce 7600 .*NVIDIA .*GeForce 76.* 2 1 +NVIDIA GeForce 7800 .*NVIDIA .*GeForce 78.* 2 1 +NVIDIA GeForce 7900 .*NVIDIA .*GeForce 79.* 2 1 +NVIDIA GeForce 8100 .*NVIDIA .*GeForce 81.* 1 1 +NVIDIA GeForce 8200M .*NVIDIA .*GeForce 8200M.* 1 1 +NVIDIA GeForce 8200 .*NVIDIA .*GeForce 82.* 1 1 +NVIDIA GeForce 8300 .*NVIDIA .*GeForce 83.* 1 1 +NVIDIA GeForce 8400M .*NVIDIA .*GeForce 8400M.* 1 1 +NVIDIA GeForce 8400 .*NVIDIA .*GeForce 84.* 1 1 +NVIDIA GeForce 8500 .*NVIDIA .*GeForce 85.* 3 1 +NVIDIA GeForce 8600M .*NVIDIA .*GeForce 8600M.* 1 1 +NVIDIA GeForce 8600 .*NVIDIA .*GeForce 86.* 3 1 +NVIDIA GeForce 8700M .*NVIDIA .*GeForce 8700M.* 3 1 +NVIDIA GeForce 8700 .*NVIDIA .*GeForce 87.* 3 1 +NVIDIA GeForce 8800M .*NVIDIA .*GeForce 8800M.* 3 1 +NVIDIA GeForce 8800 .*NVIDIA .*GeForce 88.* 3 1 +NVIDIA GeForce 9100M .*NVIDIA .*GeForce 9100M.* 0 1 +NVIDIA GeForce 9100 .*NVIDIA .*GeForce 91.* 0 1 +NVIDIA GeForce 9200M .*NVIDIA .*GeForce 9200M.* 1 1 +NVIDIA GeForce 9200 .*NVIDIA .*GeForce 92.* 1 1 +NVIDIA GeForce 9300M .*NVIDIA .*GeForce 9300M.* 1 1 +NVIDIA GeForce 9300 .*NVIDIA .*GeForce 93.* 1 1 +NVIDIA GeForce 9400M .*NVIDIA .*GeForce 9400M.* 1 1 +NVIDIA GeForce 9400 .*NVIDIA .*GeForce 94.* 1 1 +NVIDIA GeForce 9500M .*NVIDIA .*GeForce 9500M.* 2 1 +NVIDIA GeForce 9500 .*NVIDIA .*GeForce 95.* 2 1 +NVIDIA GeForce 9600M .*NVIDIA .*GeForce 9600M.* 3 1 +NVIDIA GeForce 9600 .*NVIDIA .*GeForce 96.* 2 1 +NVIDIA GeForce 9700M .*NVIDIA .*GeForce 9700M.* 2 1 +NVIDIA GeForce 9800M .*NVIDIA .*GeForce 9800M.* 3 1 +NVIDIA GeForce 9800 .*NVIDIA .*GeForce 98.* 3 1 +NVIDIA GeForce FX 5100 .*NVIDIA .*GeForce FX 51.* 0 1 +NVIDIA GeForce FX 5200 .*NVIDIA .*GeForce FX 52.* 0 1 +NVIDIA GeForce FX 5300 .*NVIDIA .*GeForce FX 53.* 0 1 +NVIDIA GeForce FX 5500 .*NVIDIA .*GeForce FX 55.* 0 1 +NVIDIA GeForce FX 5600 .*NVIDIA .*GeForce FX 56.* 0 1 +NVIDIA GeForce FX 5700 .*NVIDIA .*GeForce FX 57.* 1 1 +NVIDIA GeForce FX 5800 .*NVIDIA .*GeForce FX 58.* 1 1 +NVIDIA GeForce FX 5900 .*NVIDIA .*GeForce FX 59.* 1 1 +NVIDIA GeForce FX Go5100 .*NVIDIA .*GeForce FX Go51.* 0 1 +NVIDIA GeForce FX Go5200 .*NVIDIA .*GeForce FX Go52.* 0 1 +NVIDIA GeForce FX Go5300 .*NVIDIA .*GeForce FX Go53.* 0 1 +NVIDIA GeForce FX Go5500 .*NVIDIA .*GeForce FX Go55.* 0 1 +NVIDIA GeForce FX Go5600 .*NVIDIA .*GeForce FX Go56.* 0 1 +NVIDIA GeForce FX Go5700 .*NVIDIA .*GeForce FX Go57.* 1 1 +NVIDIA GeForce FX Go5800 .*NVIDIA .*GeForce FX Go58.* 1 1 +NVIDIA GeForce FX Go5900 .*NVIDIA .*GeForce FX Go59.* 1 1 +NVIDIA GeForce FX Go5xxx .*NVIDIA .*GeForce FX Go.* 0 1 +NVIDIA GeForce Go 6100 .*NVIDIA .*GeForce Go 61.* 0 1 +NVIDIA GeForce Go 6200 .*NVIDIA .*GeForce Go 62.* 0 1 +NVIDIA GeForce Go 6400 .*NVIDIA .*GeForce Go 64.* 1 1 +NVIDIA GeForce Go 6500 .*NVIDIA .*GeForce Go 65.* 1 1 +NVIDIA GeForce Go 6600 .*NVIDIA .*GeForce Go 66.* 1 1 +NVIDIA GeForce Go 6700 .*NVIDIA .*GeForce Go 67.* 1 1 +NVIDIA GeForce Go 6800 .*NVIDIA .*GeForce Go 68.* 1 1 +NVIDIA GeForce Go 7200 .*NVIDIA .*GeForce Go 72.* 1 1 +NVIDIA GeForce Go 7300 LE .*NVIDIA .*GeForce Go 73.*LE.* 0 1 +NVIDIA GeForce Go 7300 .*NVIDIA .*GeForce Go 73.* 1 1 +NVIDIA GeForce Go 7400 .*NVIDIA .*GeForce Go 74.* 1 1 +NVIDIA GeForce Go 7600 .*NVIDIA .*GeForce Go 76.* 2 1 +NVIDIA GeForce Go 7700 .*NVIDIA .*GeForce Go 77.* 2 1 +NVIDIA GeForce Go 7800 .*NVIDIA .*GeForce Go 78.* 2 1 +NVIDIA GeForce Go 7900 .*NVIDIA .*GeForce Go 79.* 2 1 +NVIDIA D9M .*NVIDIA .*D9M.* 1 1 +NVIDIA G94 .*NVIDIA .*G94.* 3 1 NVIDIA GeForce Go 6 .*GeForce Go 6.* 1 1 -NVIDIA ION 2 .*NVIDIA ION 2.* 2 1 -NVIDIA ION .*NVIDIA ION.* 2 1 -NVIDIA NB9M .*GeForce NB9M.* 1 1 -NVIDIA NB9P .*GeForce NB9P.* 1 1 +NVIDIA ION 2 .*NVIDIA .* ION 2.* 2 1 +NVIDIA ION .*NVIDIA .* ION.* 2 1 +NVIDIA NB8M .*NVIDIA .*NB8M.* 1 1 +NVIDIA NB8P .*NVIDIA .*NB8P.* 2 1 +NVIDIA NB9E .*NVIDIA .*NB9E.* 3 1 +NVIDIA NB9M .*NVIDIA .*NB9M.* 1 1 +NVIDIA NB9P .*NVIDIA .*NB9P.* 2 1 +NVIDIA N10 .*NVIDIA .*N10.* 1 1 NVIDIA GeForce PCX .*GeForce PCX.* 0 1 -NVIDIA Generic .*NVIDIA.*Unknown.* 0 0 -NVIDIA NV17 .*GeForce NV17.* 0 1 -NVIDIA NV34 .*NVIDIA.*NV34.* 0 1 -NVIDIA NV35 .*NVIDIA.*NV35.* 0 1 -NVIDIA NV36 .*GeForce NV36.* 1 1 -NVIDIA NV43 .*NVIDIA *NV43.* 1 1 -NVIDIA NV44 .*NVIDIA *NV44.* 1 1 -NVIDIA nForce .*NVIDIA *nForce.* 0 0 -NVIDIA MCP78 .*NVIDIA *MCP78.* 1 1 +NVIDIA Generic .*NVIDIA .*Unknown.* 0 0 +NVIDIA NV17 .*NVIDIA .*NV17.* 0 1 +NVIDIA NV34 .*NVIDIA .*NV34.* 0 1 +NVIDIA NV35 .*NVIDIA .*NV35.* 0 1 +NVIDIA NV36 .*NVIDIA .*NV36.* 1 1 +NVIDIA NV41 .*NVIDIA .*NV41.* 1 1 +NVIDIA NV43 .*NVIDIA .*NV43.* 1 1 +NVIDIA NV44 .*NVIDIA .*NV44.* 1 1 +NVIDIA nForce .*NVIDIA .*nForce.* 0 0 +NVIDIA MCP51 .*NVIDIA .*MCP51.* 1 1 +NVIDIA MCP61 .*NVIDIA .*MCP61.* 1 1 +NVIDIA MCP67 .*NVIDIA .*MCP67.* 1 1 +NVIDIA MCP68 .*NVIDIA .*MCP68.* 1 1 +NVIDIA MCP73 .*NVIDIA .*MCP73.* 1 1 +NVIDIA MCP77 .*NVIDIA .*MCP77.* 1 1 +NVIDIA MCP78 .*NVIDIA .*MCP78.* 1 1 +NVIDIA MCP79 .*NVIDIA .*MCP79.* 1 1 +NVIDIA MCP7A .*NVIDIA .*MCP7A.* 1 1 NVIDIA Quadro2 .*Quadro2.* 0 1 NVIDIA Quadro 1000M .*Quadro.*1000M.* 2 1 NVIDIA Quadro 2000 M/D .*Quadro.*2000.* 3 1 +NVIDIA Quadro 3000M .*Quadro.*3000M.* 3 1 NVIDIA Quadro 4000M .*Quadro.*4000M.* 3 1 NVIDIA Quadro 4000 .*Quadro *4000.* 3 1 NVIDIA Quadro 50x0 M .*Quadro.*50.0.* 3 1 @@ -483,6 +500,7 @@ NVIDIA Quadro 400 .*Quadro.*400.* 2 1 NVIDIA Quadro 600 .*Quadro.*600.* 2 1 NVIDIA Quadro4 .*Quadro4.* 0 1 NVIDIA Quadro DCC .*Quadro DCC.* 0 1 +NVIDIA Quadro CX .*Quadro.*CX.* 3 1 NVIDIA Quadro FX 770M .*Quadro.*FX *770M.* 2 1 NVIDIA Quadro FX 1500M .*Quadro.*FX *1500M.* 1 1 NVIDIA Quadro FX 1600M .*Quadro.*FX *1600M.* 2 1 @@ -495,16 +513,16 @@ NVIDIA Quadro FX 3700 .*Quadro.*FX *3700.* 3 1 NVIDIA Quadro FX 3800 .*Quadro.*FX *3800.* 3 1 NVIDIA Quadro FX 4500 .*Quadro.*FX *45.* 3 1 NVIDIA Quadro FX 880M .*Quadro.*FX *880M.* 3 1 -NVIDIA Quadro FX 4800 .*NVIDIA.*Quadro *FX *4800.* 3 1 +NVIDIA Quadro FX 4800 .*NVIDIA .*Quadro *FX *4800.* 3 1 NVIDIA Quadro FX .*Quadro FX.* 1 1 NVIDIA Quadro NVS 1xxM .*Quadro NVS *1.[05]M.* 0 1 -NVIDIA Quadro NVS 300M .*NVIDIA.*NVS *300M.* 2 1 -NVIDIA Quadro NVS 320M .*NVIDIA.*NVS *320M.* 2 1 -NVIDIA Quadro NVS 2100M .*NVIDIA.*NVS *2100M.* 2 1 -NVIDIA Quadro NVS 3100M .*NVIDIA.*NVS *3100M.* 2 1 -NVIDIA Quadro NVS 4200M .*NVIDIA.*NVS *4200M.* 2 1 -NVIDIA Quadro NVS 5100M .*NVIDIA.*NVS *5100M.* 2 1 -NVIDIA Quadro NVS .*NVIDIA.*NVS 0 1 +NVIDIA Quadro NVS 300M .*NVIDIA .*NVS *300M.* 2 1 +NVIDIA Quadro NVS 320M .*NVIDIA .*NVS *320M.* 2 1 +NVIDIA Quadro NVS 2100M .*NVIDIA .*NVS *2100M.* 2 1 +NVIDIA Quadro NVS 3100M .*NVIDIA .*NVS *3100M.* 2 1 +NVIDIA Quadro NVS 4200M .*NVIDIA .*NVS *4200M.* 2 1 +NVIDIA Quadro NVS 5100M .*NVIDIA .*NVS *5100M.* 2 1 +NVIDIA Quadro NVS .*NVIDIA .*NVS 0 1 NVIDIA RIVA TNT .*RIVA TNT.* 0 0 S3 .*S3 Graphics.* 0 0 SiS SiS.* 0 0 -- cgit v1.3 From aa341e918e925aefd3481bb132896f3b0a980dba Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 7 Oct 2011 11:28:37 -0400 Subject: Duplicated XUI ID: floater_model_wizard.xml --- doc/contributions.txt | 1 + indra/newview/skins/default/xui/en/floater_model_wizard.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index bcdc5a63d2..f8f802548a 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -575,6 +575,7 @@ Jonathan Yap STORM-1567 STORM-1572 STORM-1574 + STORM-1638 Kadah Coba STORM-1060 Jondan Lundquist diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml index b5a5ff5342..9c0af7d9ba 100644 --- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml +++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml @@ -199,7 +199,7 @@ height="10" layout="topleft" left="10" - name="Cache location" + name="Model types" width="320"> Second Life supports COLLADA (.dae) files -- cgit v1.3 From 0a3628b66db2a89f5ae509c7e8836a51619f0bef Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 7 Oct 2011 14:35:54 -0400 Subject: STORM-1639 Duplicated XUI ID: floater_build_options.xml --- doc/contributions.txt | 1 + indra/newview/skins/default/xui/en/floater_build_options.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index bcdc5a63d2..064b157089 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -575,6 +575,7 @@ Jonathan Yap STORM-1567 STORM-1572 STORM-1574 + STORM-1639 Kadah Coba STORM-1060 Jondan Lundquist diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml index c247a12e7a..afb7917043 100644 --- a/indra/newview/skins/default/xui/en/floater_build_options.xml +++ b/indra/newview/skins/default/xui/en/floater_build_options.xml @@ -37,7 +37,7 @@ layout="topleft" left="10" tool_tip="Grid opacity" - name="grid_opacity_label" + name="grid_mode_label" top_pad="30" width="123"> Mode -- cgit v1.3 From 5cfd34df908572045fe3ff193e2f9242b9f2025b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 11 Oct 2011 18:18:02 -0400 Subject: STORM-976 Object muted by name still displays notification message when clicked --- doc/contributions.txt | 1 + indra/newview/llviewermessage.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index 693d4c37b8..c60e91c9e7 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -576,6 +576,7 @@ Jonathan Yap STORM-1567 STORM-1572 STORM-1574 + STORM-976 Kadah Coba STORM-1060 Jondan Lundquist diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 74ee918bfe..8f3163c0cf 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1809,8 +1809,11 @@ void LLOfferInfo::initRespondFunctionMap() void inventory_offer_handler(LLOfferInfo* info) { - //If muted, don't even go through the messaging stuff. Just curtail the offer here. - if (LLMuteList::getInstance()->isMuted(info->mFromID, info->mFromName)) + // If muted, don't even go through the messaging stuff. Just curtail the offer here. + // Passing in a null UUID handles the case of where you have muted one of your own objects by_name. + // The solution for STORM-1297 seems to handle the cases where the object is owned by someone else. + if (LLMuteList::getInstance()->isMuted(info->mFromID, info->mFromName) || + LLMuteList::getInstance()->isMuted(LLUUID::null, info->mFromName)) { info->forceResponse(IOR_MUTE); return; -- cgit v1.3 From 4331c112aba074562e9a8826fe6d271a94f790f0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 14 Oct 2011 11:52:40 -0500 Subject: Backed out changeset b782a75c99e6 --- doc/contributions.txt | 9 +- indra/llaudio/llaudioengine_fmod.cpp | 2 +- indra/llaudio/llvorbisencode.cpp | 9 +- indra/llcharacter/llbvhloader.cpp | 3 +- indra/llcharacter/llkeyframemotionparam.cpp | 3 +- indra/llcharacter/llstatemachine.cpp | 3 +- indra/llcommon/CMakeLists.txt | 3 - indra/llcommon/llapp.cpp | 4 + indra/llcommon/llapr.cpp | 445 +++++++++++++++++---- indra/llcommon/llapr.h | 107 ++++- indra/llcommon/llaprpool.cpp | 202 ---------- indra/llcommon/llaprpool.h | 256 ------------ indra/llcommon/llcommon.cpp | 13 + indra/llcommon/llcommon.h | 2 + indra/llcommon/llerror.cpp | 3 - indra/llcommon/llerror.h | 1 + indra/llcommon/llfixedbuffer.cpp | 3 +- indra/llcommon/llscopedvolatileaprpool.h | 52 --- indra/llcommon/llthread.cpp | 151 ++++--- indra/llcommon/llthread.h | 124 ++---- indra/llcommon/llthreadsafequeue.cpp | 15 +- indra/llcommon/llthreadsafequeue.h | 16 +- indra/llcommon/llworkerthread.cpp | 8 +- indra/llcommon/llworkerthread.h | 3 +- indra/llcrashlogger/llcrashlogger.cpp | 3 +- indra/llimage/llimage.cpp | 8 +- indra/llimage/llimagedimensionsinfo.cpp | 2 +- indra/llimage/llimagej2c.cpp | 3 +- indra/llimage/llimageworker.cpp | 8 +- indra/llimage/llimageworker.h | 2 +- indra/llmath/llvolumemgr.cpp | 4 +- indra/llmessage/llares.cpp | 17 +- indra/llmessage/llcurl.cpp | 2 +- indra/llmessage/lliohttpserver.cpp | 10 +- indra/llmessage/lliohttpserver.h | 2 +- indra/llmessage/lliosocket.cpp | 99 +++-- indra/llmessage/lliosocket.h | 33 +- indra/llmessage/llmail.cpp | 17 +- indra/llmessage/llmail.h | 4 +- indra/llmessage/llpumpio.cpp | 74 ++-- indra/llmessage/llpumpio.h | 31 +- indra/llmessage/llurlrequest.cpp | 25 +- indra/llmessage/message.cpp | 17 +- indra/llmessage/tests/networkio.h | 9 +- indra/llplugin/llplugininstance.cpp | 6 +- indra/llplugin/llplugininstance.h | 2 - indra/llplugin/llpluginmessagepipe.cpp | 2 + indra/llplugin/llpluginprocesschild.cpp | 2 +- indra/llplugin/llpluginprocessparent.cpp | 57 +-- indra/llplugin/llpluginprocessparent.h | 2 - indra/llplugin/llpluginsharedmemory.cpp | 9 +- indra/llplugin/llpluginsharedmemory.h | 3 - indra/llplugin/slplugin/slplugin.cpp | 4 + indra/llvfs/lllfsthread.cpp | 10 +- indra/llvfs/llvfs.cpp | 5 +- .../gstreamer010/llmediaimplgstreamer.h | 1 + .../gstreamer010/llmediaimplgstreamer_syms.cpp | 15 +- .../media_plugins/webkit/linux_volume_catcher.cpp | 14 +- indra/newview/llappviewer.cpp | 47 +-- indra/newview/llappviewer.h | 2 +- indra/newview/llappviewerlinux.cpp | 1 - indra/newview/llappviewerlinux_api_dbus.cpp | 14 +- indra/newview/llappviewermacosx.cpp | 1 - indra/newview/llfloateranimpreview.cpp | 3 +- indra/newview/llmainlooprepeater.cpp | 2 +- indra/newview/lltexturecache.cpp | 61 +-- indra/newview/lltexturecache.h | 3 + indra/newview/lltexturefetch.cpp | 3 + indra/newview/llviewermenufile.cpp | 3 +- indra/newview/llvoavatar.cpp | 3 +- indra/newview/llvocache.cpp | 54 +-- indra/newview/llvocache.h | 5 +- indra/newview/llvoicevivox.cpp | 2 +- indra/newview/llwatchdog.cpp | 4 +- indra/newview/tests/llworldmap_test.cpp | 1 + indra/test/lltemplatemessagebuilder_tut.cpp | 2 + indra/test/message_tut.cpp | 2 + indra/test/test.cpp | 17 +- indra/test_apps/llplugintest/llmediaplugintest.cpp | 4 + .../updater/llupdateinstaller.cpp | 4 +- 80 files changed, 1080 insertions(+), 1097 deletions(-) delete mode 100644 indra/llcommon/llaprpool.cpp delete mode 100644 indra/llcommon/llaprpool.h delete mode 100644 indra/llcommon/llscopedvolatileaprpool.h (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index 03e4978dd0..8765240caa 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -61,15 +61,11 @@ Aimee Trescothick Alejandro Rosenthal VWR-1184 Aleric Inglewood - SNOW-84 SNOW-240 - SNOW-477 SNOW-522 SNOW-626 - SNOW-744 SNOW-756 SNOW-764 - SNOW-766 VWR-10001 VWR-10579 VWR-10759 @@ -90,8 +86,11 @@ Aleric Inglewood VWR-24321 VWR-24354 VWR-24519 + SNOW-84 + SNOW-477 + SNOW-744 + SNOW-766 STORM-163 - STORM-864 Ales Beaumont VWR-9352 SNOW-240 diff --git a/indra/llaudio/llaudioengine_fmod.cpp b/indra/llaudio/llaudioengine_fmod.cpp index 88dfdb9c24..a40de9fa68 100644 --- a/indra/llaudio/llaudioengine_fmod.cpp +++ b/indra/llaudio/llaudioengine_fmod.cpp @@ -673,7 +673,7 @@ bool LLAudioBufferFMOD::loadWAV(const std::string& filename) return false; } - if (!LLAPRFile::isExist(filename, LL_APR_RPB)) + if (!LLAPRFile::isExist(filename, NULL, LL_APR_RPB)) { // File not found, abort. return false; diff --git a/indra/llaudio/llvorbisencode.cpp b/indra/llaudio/llvorbisencode.cpp index 44eeea0ca4..0e0c80a456 100644 --- a/indra/llaudio/llvorbisencode.cpp +++ b/indra/llaudio/llvorbisencode.cpp @@ -82,7 +82,8 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro error_msg.clear(); //******************************** - LLAPRFile infile(in_fname, LL_APR_RB); + LLAPRFile infile ; + infile.open(in_fname,LL_APR_RB); //******************************** if (!infile.getFileHandle()) { @@ -232,7 +233,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname S32 data_left = 0; - LLAPRFile infile(in_fname,LL_APR_RB); + LLAPRFile infile ; + infile.open(in_fname,LL_APR_RB); if (!infile.getFileHandle()) { llwarns << "Couldn't open temporary ogg file for writing: " << in_fname @@ -240,7 +242,8 @@ S32 encode_vorbis_file(const std::string& in_fname, const std::string& out_fname return(LLVORBISENC_SOURCE_OPEN_ERR); } - LLAPRFile outfile(out_fname, LL_APR_WPB); + LLAPRFile outfile ; + outfile.open(out_fname,LL_APR_WPB); if (!outfile.getFileHandle()) { llwarns << "Couldn't open upload sound file for reading: " << in_fname diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index a39a344684..532a2c1b0d 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -219,7 +219,8 @@ ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName) //-------------------------------------------------------------------- std::string path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,fileName); - LLAPRFile infile(path, LL_APR_R); + LLAPRFile infile ; + infile.open(path, LL_APR_R); apr_file_t *fp = infile.getFileHandle(); if (!fp) return E_ST_NO_XLT_FILE; diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp index c3d5dec875..82fe8971f5 100644 --- a/indra/llcharacter/llkeyframemotionparam.cpp +++ b/indra/llcharacter/llkeyframemotionparam.cpp @@ -351,7 +351,8 @@ BOOL LLKeyframeMotionParam::loadMotions() // open the file //------------------------------------------------------------------------- S32 fileSize = 0; - LLAPRFile infile(path, LL_APR_R, &fileSize); + LLAPRFile infile ; + infile.open(path, LL_APR_R, NULL, &fileSize); apr_file_t* fp = infile.getFileHandle() ; if (!fp || fileSize == 0) { diff --git a/indra/llcharacter/llstatemachine.cpp b/indra/llcharacter/llstatemachine.cpp index dcc4ff5f0e..e0454131a5 100644 --- a/indra/llcharacter/llstatemachine.cpp +++ b/indra/llcharacter/llstatemachine.cpp @@ -204,7 +204,8 @@ LLFSMState* LLStateDiagram::getState(U32 state_id) BOOL LLStateDiagram::saveDotFile(const std::string& filename) { - LLAPRFile outfile(filename, LL_APR_W); + LLAPRFile outfile ; + outfile.open(filename, LL_APR_W); apr_file_t* dot_file = outfile.getFileHandle() ; if (!dot_file) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index d5b0a67533..9342a22d46 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -32,7 +32,6 @@ set(llcommon_SOURCE_FILES llallocator_heap_profile.cpp llapp.cpp llapr.cpp - llaprpool.cpp llassettype.cpp llavatarname.cpp llbase32.cpp @@ -81,7 +80,6 @@ set(llcommon_SOURCE_FILES llrand.cpp llrefcount.cpp llrun.cpp - llscopedvolatileaprpool.h llsd.cpp llsdserialize.cpp llsdserialize_xml.cpp @@ -123,7 +121,6 @@ set(llcommon_HEADER_FILES llavatarname.h llapp.h llapr.h - llaprpool.h llassettype.h llassoclist.h llavatarconstants.h diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index e5bd2bfa3d..39daefd1ad 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -136,6 +136,10 @@ void LLApp::commonCtor() mOptions.append(sd); } + // Make sure we clean up APR when we exit + // Don't need to do this if we're cleaning up APR in the destructor + //atexit(ll_cleanup_apr); + // Set the application to this instance. sApplication = this; diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index 1e4a51102e..d1c44c9403 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -29,8 +29,212 @@ #include "linden_common.h" #include "llapr.h" #include "apr_dso.h" -#include "llscopedvolatileaprpool.h" +apr_pool_t *gAPRPoolp = NULL; // Global APR memory pool +LLVolatileAPRPool *LLAPRFile::sAPRFilePoolp = NULL ; //global volatile APR memory pool. +apr_thread_mutex_t *gLogMutexp = NULL; +apr_thread_mutex_t *gCallStacksLogMutexp = NULL; + +const S32 FULL_VOLATILE_APR_POOL = 1024 ; //number of references to LLVolatileAPRPool + +void ll_init_apr() +{ + if (!gAPRPoolp) + { + // Initialize APR and create the global pool + apr_initialize(); + apr_pool_create(&gAPRPoolp, NULL); + + // Initialize the logging mutex + apr_thread_mutex_create(&gLogMutexp, APR_THREAD_MUTEX_UNNESTED, gAPRPoolp); + apr_thread_mutex_create(&gCallStacksLogMutexp, APR_THREAD_MUTEX_UNNESTED, gAPRPoolp); + } + + if(!LLAPRFile::sAPRFilePoolp) + { + LLAPRFile::sAPRFilePoolp = new LLVolatileAPRPool(FALSE) ; + } +} + + +void ll_cleanup_apr() +{ + LL_INFOS("APR") << "Cleaning up APR" << LL_ENDL; + + if (gLogMutexp) + { + // Clean up the logging mutex + + // All other threads NEED to be done before we clean up APR, so this is okay. + apr_thread_mutex_destroy(gLogMutexp); + gLogMutexp = NULL; + } + if (gCallStacksLogMutexp) + { + // Clean up the logging mutex + + // All other threads NEED to be done before we clean up APR, so this is okay. + apr_thread_mutex_destroy(gCallStacksLogMutexp); + gCallStacksLogMutexp = NULL; + } + if (gAPRPoolp) + { + apr_pool_destroy(gAPRPoolp); + gAPRPoolp = NULL; + } + if (LLAPRFile::sAPRFilePoolp) + { + delete LLAPRFile::sAPRFilePoolp ; + LLAPRFile::sAPRFilePoolp = NULL ; + } + apr_terminate(); +} + +// +// +//LLAPRPool +// +LLAPRPool::LLAPRPool(apr_pool_t *parent, apr_size_t size, BOOL releasePoolFlag) + : mParent(parent), + mReleasePoolFlag(releasePoolFlag), + mMaxSize(size), + mPool(NULL) +{ + createAPRPool() ; +} + +LLAPRPool::~LLAPRPool() +{ + releaseAPRPool() ; +} + +void LLAPRPool::createAPRPool() +{ + if(mPool) + { + return ; + } + + mStatus = apr_pool_create(&mPool, mParent); + ll_apr_warn_status(mStatus) ; + + if(mMaxSize > 0) //size is the number of blocks (which is usually 4K), NOT bytes. + { + apr_allocator_t *allocator = apr_pool_allocator_get(mPool); + if (allocator) + { + apr_allocator_max_free_set(allocator, mMaxSize) ; + } + } +} + +void LLAPRPool::releaseAPRPool() +{ + if(!mPool) + { + return ; + } + + if(!mParent || mReleasePoolFlag) + { + apr_pool_destroy(mPool) ; + mPool = NULL ; + } +} + +//virtual +apr_pool_t* LLAPRPool::getAPRPool() +{ + return mPool ; +} + +LLVolatileAPRPool::LLVolatileAPRPool(BOOL is_local, apr_pool_t *parent, apr_size_t size, BOOL releasePoolFlag) + : LLAPRPool(parent, size, releasePoolFlag), + mNumActiveRef(0), + mNumTotalRef(0), + mMutexPool(NULL), + mMutexp(NULL) +{ + //create mutex + if(!is_local) //not a local apr_pool, that is: shared by multiple threads. + { + apr_pool_create(&mMutexPool, NULL); // Create a pool for mutex + apr_thread_mutex_create(&mMutexp, APR_THREAD_MUTEX_UNNESTED, mMutexPool); + } +} + +LLVolatileAPRPool::~LLVolatileAPRPool() +{ + //delete mutex + if(mMutexp) + { + apr_thread_mutex_destroy(mMutexp); + apr_pool_destroy(mMutexPool); + } +} + +// +//define this virtual function to avoid any mistakenly calling LLAPRPool::getAPRPool(). +// +//virtual +apr_pool_t* LLVolatileAPRPool::getAPRPool() +{ + return LLVolatileAPRPool::getVolatileAPRPool() ; +} + +apr_pool_t* LLVolatileAPRPool::getVolatileAPRPool() +{ + LLScopedLock lock(mMutexp) ; + + mNumTotalRef++ ; + mNumActiveRef++ ; + + if(!mPool) + { + createAPRPool() ; + } + + return mPool ; +} + +void LLVolatileAPRPool::clearVolatileAPRPool() +{ + LLScopedLock lock(mMutexp) ; + + if(mNumActiveRef > 0) + { + mNumActiveRef--; + if(mNumActiveRef < 1) + { + if(isFull()) + { + mNumTotalRef = 0 ; + + //destroy the apr_pool. + releaseAPRPool() ; + } + else + { + //This does not actually free the memory, + //it just allows the pool to re-use this memory for the next allocation. + apr_pool_clear(mPool) ; + } + } + } + else + { + llassert_always(mNumActiveRef > 0) ; + } + + //paranoia check if the pool is jammed. + //will remove the check before going to release. + llassert_always(mNumTotalRef < (FULL_VOLATILE_APR_POOL << 2)) ; +} + +BOOL LLVolatileAPRPool::isFull() +{ + return mNumTotalRef > FULL_VOLATILE_APR_POOL ; +} //--------------------------------------------------------------------- // // LLScopedLock @@ -109,17 +313,15 @@ void ll_apr_assert_status(apr_status_t status, apr_dso_handle_t *handle) // LLAPRFile::LLAPRFile() : mFile(NULL), - mVolatileFilePoolp(NULL), - mRegularFilePoolp(NULL) + mCurrentFilePoolp(NULL) { } -LLAPRFile::LLAPRFile(std::string const& filename, apr_int32_t flags, S32* sizep, access_t access_type) +LLAPRFile::LLAPRFile(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool) : mFile(NULL), - mVolatileFilePoolp(NULL), - mRegularFilePoolp(NULL) + mCurrentFilePoolp(NULL) { - open(filename, flags, access_type, sizep); + open(filename, flags, pool); } LLAPRFile::~LLAPRFile() @@ -136,58 +338,36 @@ apr_status_t LLAPRFile::close() mFile = NULL ; } - if (mVolatileFilePoolp) + if(mCurrentFilePoolp) { - mVolatileFilePoolp->clearVolatileAPRPool() ; - mVolatileFilePoolp = NULL ; - } - - if (mRegularFilePoolp) - { - delete mRegularFilePoolp; - mRegularFilePoolp = NULL; + mCurrentFilePoolp->clearVolatileAPRPool() ; + mCurrentFilePoolp = NULL ; } return ret ; } -apr_status_t LLAPRFile::open(std::string const& filename, apr_int32_t flags, access_t access_type, S32* sizep) +apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool, S32* sizep) { - llassert_always(!mFile); - llassert_always(!mVolatileFilePoolp && !mRegularFilePoolp); + apr_status_t s ; - apr_status_t status; - { - apr_pool_t* apr_file_open_pool; // The use of apr_pool_t is OK here. - // This is a temporary variable for a pool that is passed directly to apr_file_open below. - if (access_type == short_lived) - { - // Use a "volatile" thread-local pool. - mVolatileFilePoolp = &LLThreadLocalData::tldata().mVolatileAPRPool; - // Access the pool and increment its reference count. - // The reference count of LLVolatileAPRPool objects will be decremented - // again in LLAPRFile::close by calling mVolatileFilePoolp->clearVolatileAPRPool(). - apr_file_open_pool = mVolatileFilePoolp->getVolatileAPRPool(); - } - else - { - mRegularFilePoolp = new LLAPRPool(LLThreadLocalData::tldata().mRootPool); - apr_file_open_pool = (*mRegularFilePoolp)(); - } - status = apr_file_open(&mFile, filename.c_str(), flags, APR_OS_DEFAULT, apr_file_open_pool); - } - if (status != APR_SUCCESS || !mFile) + //check if already open some file + llassert_always(!mFile) ; + llassert_always(!mCurrentFilePoolp) ; + + apr_pool_t* apr_pool = pool ? pool->getVolatileAPRPool() : NULL ; + s = apr_file_open(&mFile, filename.c_str(), flags, APR_OS_DEFAULT, getAPRFilePool(apr_pool)); + + if (s != APR_SUCCESS || !mFile) { mFile = NULL ; - close() ; + if (sizep) { *sizep = 0; } - return status; } - - if (sizep) + else if (sizep) { S32 file_size = 0; apr_off_t offset = 0; @@ -201,7 +381,49 @@ apr_status_t LLAPRFile::open(std::string const& filename, apr_int32_t flags, acc *sizep = file_size; } - return status; + if(!mCurrentFilePoolp) + { + mCurrentFilePoolp = pool ; + + if(!mFile) + { + close() ; + } + } + + return s ; +} + +//use gAPRPoolp. +apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, BOOL use_global_pool) +{ + apr_status_t s; + + //check if already open some file + llassert_always(!mFile) ; + llassert_always(!mCurrentFilePoolp) ; + llassert_always(use_global_pool) ; //be aware of using gAPRPoolp. + + s = apr_file_open(&mFile, filename.c_str(), flags, APR_OS_DEFAULT, gAPRPoolp); + if (s != APR_SUCCESS || !mFile) + { + mFile = NULL ; + close() ; + return s; + } + + return s; +} + +apr_pool_t* LLAPRFile::getAPRFilePool(apr_pool_t* pool) +{ + if(!pool) + { + mCurrentFilePoolp = sAPRFilePoolp ; + return mCurrentFilePoolp->getVolatileAPRPool() ; + } + + return pool ; } // File I/O @@ -259,6 +481,45 @@ S32 LLAPRFile::seek(apr_seek_where_t where, S32 offset) //static components of LLAPRFile // +//static +apr_status_t LLAPRFile::close(apr_file_t* file_handle, LLVolatileAPRPool* pool) +{ + apr_status_t ret = APR_SUCCESS ; + if(file_handle) + { + ret = apr_file_close(file_handle); + file_handle = NULL ; + } + + if(pool) + { + pool->clearVolatileAPRPool() ; + } + + return ret ; +} + +//static +apr_file_t* LLAPRFile::open(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags) +{ + apr_status_t s; + apr_file_t* file_handle ; + + pool = pool ? pool : LLAPRFile::sAPRFilePoolp ; + + s = apr_file_open(&file_handle, filename.c_str(), flags, APR_OS_DEFAULT, pool->getVolatileAPRPool()); + if (s != APR_SUCCESS || !file_handle) + { + ll_apr_warn_status(s); + LL_WARNS("APR") << " Attempting to open filename: " << filename << LL_ENDL; + file_handle = NULL ; + close(file_handle, pool) ; + return NULL; + } + + return file_handle ; +} + //static S32 LLAPRFile::seek(apr_file_t* file_handle, apr_seek_where_t where, S32 offset) { @@ -292,15 +553,13 @@ S32 LLAPRFile::seek(apr_file_t* file_handle, apr_seek_where_t where, S32 offset) } //static -S32 LLAPRFile::readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes) +S32 LLAPRFile::readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool) { - apr_file_t* file_handle; - LLScopedVolatileAPRPool pool; - apr_status_t s = apr_file_open(&file_handle, filename.c_str(), APR_READ|APR_BINARY, APR_OS_DEFAULT, pool); - if (s != APR_SUCCESS || !file_handle) + //***************************************** + apr_file_t* file_handle = open(filename, pool, APR_READ|APR_BINARY); + //***************************************** + if (!file_handle) { - ll_apr_warn_status(s); - LL_WARNS("APR") << " while attempting to open file \"" << filename << '"' << LL_ENDL; return 0; } @@ -330,13 +589,14 @@ S32 LLAPRFile::readEx(const std::string& filename, void *buf, S32 offset, S32 nb } } - apr_file_close(file_handle); - + //***************************************** + close(file_handle, pool) ; + //***************************************** return (S32)bytes_read; } //static -S32 LLAPRFile::writeEx(const std::string& filename, void *buf, S32 offset, S32 nbytes) +S32 LLAPRFile::writeEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool) { apr_int32_t flags = APR_CREATE|APR_WRITE|APR_BINARY; if (offset < 0) @@ -345,13 +605,11 @@ S32 LLAPRFile::writeEx(const std::string& filename, void *buf, S32 offset, S32 n offset = 0; } - apr_file_t* file_handle; - LLScopedVolatileAPRPool pool; - apr_status_t s = apr_file_open(&file_handle, filename.c_str(), flags, APR_OS_DEFAULT, pool); - if (s != APR_SUCCESS || !file_handle) + //***************************************** + apr_file_t* file_handle = open(filename, pool, flags); + //***************************************** + if (!file_handle) { - ll_apr_warn_status(s); - LL_WARNS("APR") << " while attempting to open file \"" << filename << '"' << LL_ENDL; return 0; } @@ -381,18 +639,21 @@ S32 LLAPRFile::writeEx(const std::string& filename, void *buf, S32 offset, S32 n } } - apr_file_close(file_handle); + //***************************************** + LLAPRFile::close(file_handle, pool); + //***************************************** return (S32)bytes_written; } //static -bool LLAPRFile::remove(const std::string& filename) +bool LLAPRFile::remove(const std::string& filename, LLVolatileAPRPool* pool) { apr_status_t s; - LLScopedVolatileAPRPool pool; - s = apr_file_remove(filename.c_str(), pool); + pool = pool ? pool : LLAPRFile::sAPRFilePoolp ; + s = apr_file_remove(filename.c_str(), pool->getVolatileAPRPool()); + pool->clearVolatileAPRPool() ; if (s != APR_SUCCESS) { @@ -404,12 +665,13 @@ bool LLAPRFile::remove(const std::string& filename) } //static -bool LLAPRFile::rename(const std::string& filename, const std::string& newname) +bool LLAPRFile::rename(const std::string& filename, const std::string& newname, LLVolatileAPRPool* pool) { apr_status_t s; - LLScopedVolatileAPRPool pool; - s = apr_file_rename(filename.c_str(), newname.c_str(), pool); + pool = pool ? pool : LLAPRFile::sAPRFilePoolp ; + s = apr_file_rename(filename.c_str(), newname.c_str(), pool->getVolatileAPRPool()); + pool->clearVolatileAPRPool() ; if (s != APR_SUCCESS) { @@ -421,44 +683,49 @@ bool LLAPRFile::rename(const std::string& filename, const std::string& newname) } //static -bool LLAPRFile::isExist(const std::string& filename, apr_int32_t flags) +bool LLAPRFile::isExist(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags) { - apr_file_t* file_handle; + apr_file_t* apr_file; apr_status_t s; - LLScopedVolatileAPRPool pool; - s = apr_file_open(&file_handle, filename.c_str(), flags, APR_OS_DEFAULT, pool); + pool = pool ? pool : LLAPRFile::sAPRFilePoolp ; + s = apr_file_open(&apr_file, filename.c_str(), flags, APR_OS_DEFAULT, pool->getVolatileAPRPool()); - if (s != APR_SUCCESS || !file_handle) + if (s != APR_SUCCESS || !apr_file) { + pool->clearVolatileAPRPool() ; return false; } else { - apr_file_close(file_handle); + apr_file_close(apr_file) ; + pool->clearVolatileAPRPool() ; return true; } } //static -S32 LLAPRFile::size(const std::string& filename) +S32 LLAPRFile::size(const std::string& filename, LLVolatileAPRPool* pool) { - apr_file_t* file_handle; + apr_file_t* apr_file; apr_finfo_t info; apr_status_t s; - LLScopedVolatileAPRPool pool; - s = apr_file_open(&file_handle, filename.c_str(), APR_READ, APR_OS_DEFAULT, pool); + pool = pool ? pool : LLAPRFile::sAPRFilePoolp ; + s = apr_file_open(&apr_file, filename.c_str(), APR_READ, APR_OS_DEFAULT, pool->getVolatileAPRPool()); - if (s != APR_SUCCESS || !file_handle) + if (s != APR_SUCCESS || !apr_file) { + pool->clearVolatileAPRPool() ; + return 0; } else { - apr_status_t s = apr_file_info_get(&info, APR_FINFO_SIZE, file_handle); + apr_status_t s = apr_file_info_get(&info, APR_FINFO_SIZE, apr_file); - apr_file_close(file_handle) ; + apr_file_close(apr_file) ; + pool->clearVolatileAPRPool() ; if (s == APR_SUCCESS) { @@ -472,29 +739,31 @@ S32 LLAPRFile::size(const std::string& filename) } //static -bool LLAPRFile::makeDir(const std::string& dirname) +bool LLAPRFile::makeDir(const std::string& dirname, LLVolatileAPRPool* pool) { apr_status_t s; - LLScopedVolatileAPRPool pool; - s = apr_dir_make(dirname.c_str(), APR_FPROT_OS_DEFAULT, pool); + pool = pool ? pool : LLAPRFile::sAPRFilePoolp ; + s = apr_dir_make(dirname.c_str(), APR_FPROT_OS_DEFAULT, pool->getVolatileAPRPool()); + pool->clearVolatileAPRPool() ; if (s != APR_SUCCESS) { ll_apr_warn_status(s); - LL_WARNS("APR") << " while attempting to make directory: " << dirname << LL_ENDL; + LL_WARNS("APR") << " Attempting to make directory: " << dirname << LL_ENDL; return false; } return true; } //static -bool LLAPRFile::removeDir(const std::string& dirname) +bool LLAPRFile::removeDir(const std::string& dirname, LLVolatileAPRPool* pool) { apr_status_t s; - LLScopedVolatileAPRPool pool; - s = apr_file_remove(dirname.c_str(), pool); + pool = pool ? pool : LLAPRFile::sAPRFilePoolp ; + s = apr_file_remove(dirname.c_str(), pool->getVolatileAPRPool()); + pool->clearVolatileAPRPool() ; if (s != APR_SUCCESS) { diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 3f846f1314..af33ce666f 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -50,9 +50,71 @@ #include "apr_atomic.h" #include "llstring.h" +extern LL_COMMON_API apr_thread_mutex_t* gLogMutexp; +extern apr_thread_mutex_t* gCallStacksLogMutexp; + struct apr_dso_handle_t; -class LLAPRPool; -class LLVolatileAPRPool; + +/** + * @brief initialize the common apr constructs -- apr itself, the + * global pool, and a mutex. + */ +void LL_COMMON_API ll_init_apr(); + +/** + * @brief Cleanup those common apr constructs. + */ +void LL_COMMON_API ll_cleanup_apr(); + +// +//LL apr_pool +//manage apr_pool_t, destroy allocated apr_pool in the destruction function. +// +class LL_COMMON_API LLAPRPool +{ +public: + LLAPRPool(apr_pool_t *parent = NULL, apr_size_t size = 0, BOOL releasePoolFlag = TRUE) ; + virtual ~LLAPRPool() ; + + virtual apr_pool_t* getAPRPool() ; + apr_status_t getStatus() {return mStatus ; } + +protected: + void releaseAPRPool() ; + void createAPRPool() ; + +protected: + apr_pool_t* mPool ; //pointing to an apr_pool + apr_pool_t* mParent ; //parent pool + apr_size_t mMaxSize ; //max size of mPool, mPool should return memory to system if allocated memory beyond this limit. However it seems not to work. + apr_status_t mStatus ; //status when creating the pool + BOOL mReleasePoolFlag ; //if set, mPool is destroyed when LLAPRPool is deleted. default value is true. +}; + +// +//volatile LL apr_pool +//which clears memory automatically. +//so it can not hold static data or data after memory is cleared +// +class LL_COMMON_API LLVolatileAPRPool : public LLAPRPool +{ +public: + LLVolatileAPRPool(BOOL is_local = TRUE, apr_pool_t *parent = NULL, apr_size_t size = 0, BOOL releasePoolFlag = TRUE); + virtual ~LLVolatileAPRPool(); + + /*virtual*/ apr_pool_t* getAPRPool() ; //define this virtual function to avoid any mistakenly calling LLAPRPool::getAPRPool(). + apr_pool_t* getVolatileAPRPool() ; + void clearVolatileAPRPool() ; + + BOOL isFull() ; + +private: + S32 mNumActiveRef ; //number of active pointers pointing to the apr_pool. + S32 mNumTotalRef ; //number of total pointers pointing to the apr_pool since last creating. + + apr_thread_mutex_t *mMutexp; + apr_pool_t *mMutexPool; +} ; /** * @class LLScopedLock @@ -143,20 +205,15 @@ class LL_COMMON_API LLAPRFile : boost::noncopyable // make this non copyable since a copy closes the file private: apr_file_t* mFile ; - LLVolatileAPRPool* mVolatileFilePoolp; // (Thread local) APR pool currently in use. - LLAPRPool* mRegularFilePoolp; // ...or a regular pool. + LLVolatileAPRPool *mCurrentFilePoolp ; //currently in use apr_pool, could be one of them: sAPRFilePoolp, or a temp pool. public: - enum access_t { - long_lived, // Use a global pool for long-lived file accesses. - short_lived // Use a volatile pool for short-lived file accesses. - }; - LLAPRFile() ; - LLAPRFile(std::string const& filename, apr_int32_t flags, S32* sizep = NULL, access_t access_type = short_lived); + LLAPRFile(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL); ~LLAPRFile() ; - - apr_status_t open(const std::string& filename, apr_int32_t flags, access_t access_type, S32* sizep = NULL); + + apr_status_t open(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL, S32* sizep = NULL); + apr_status_t open(const std::string& filename, apr_int32_t flags, BOOL use_global_pool); //use gAPRPoolp. apr_status_t close() ; // Returns actual offset, -1 if seek fails @@ -169,24 +226,32 @@ public: apr_file_t* getFileHandle() {return mFile;} +private: + apr_pool_t* getAPRFilePool(apr_pool_t* pool) ; + // //******************************************************************************************************************************* //static components // +public: + static LLVolatileAPRPool *sAPRFilePoolp ; //a global apr_pool for APRFile, which is used only when local pool does not exist. + private: + static apr_file_t* open(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags); + static apr_status_t close(apr_file_t* file, LLVolatileAPRPool* pool) ; static S32 seek(apr_file_t* file, apr_seek_where_t where, S32 offset); public: // returns false if failure: - static bool remove(const std::string& filename); - static bool rename(const std::string& filename, const std::string& newname); - static bool isExist(const std::string& filename, apr_int32_t flags = APR_READ); - static S32 size(const std::string& filename); - static bool makeDir(const std::string& dirname); - static bool removeDir(const std::string& dirname); + static bool remove(const std::string& filename, LLVolatileAPRPool* pool = NULL); + static bool rename(const std::string& filename, const std::string& newname, LLVolatileAPRPool* pool = NULL); + static bool isExist(const std::string& filename, LLVolatileAPRPool* pool = NULL, apr_int32_t flags = APR_READ); + static S32 size(const std::string& filename, LLVolatileAPRPool* pool = NULL); + static bool makeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL); + static bool removeDir(const std::string& dirname, LLVolatileAPRPool* pool = NULL); // Returns bytes read/written, 0 if read/write fails: - static S32 readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes); - static S32 writeEx(const std::string& filename, void *buf, S32 offset, S32 nbytes); // offset<0 means append + static S32 readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL); + static S32 writeEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool = NULL); // offset<0 means append //******************************************************************************************************************************* }; @@ -202,4 +267,6 @@ bool LL_COMMON_API ll_apr_warn_status(apr_status_t status, apr_dso_handle_t* han void LL_COMMON_API ll_apr_assert_status(apr_status_t status); void LL_COMMON_API ll_apr_assert_status(apr_status_t status, apr_dso_handle_t* handle); +extern "C" LL_COMMON_API apr_pool_t* gAPRPoolp; // Global APR memory pool + #endif // LL_LLAPR_H diff --git a/indra/llcommon/llaprpool.cpp b/indra/llcommon/llaprpool.cpp deleted file mode 100644 index 6f21b61b65..0000000000 --- a/indra/llcommon/llaprpool.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/** - * @file llaprpool.cpp - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - * - * CHANGELOG - * and additional copyright holders. - * - * 04/04/2010 - * - Initial version, written by Aleric Inglewood @ SL - * - * 10/11/2010 - * - Added APR_HAS_THREADS #if's to allow creation and destruction - * of subpools by threads other than the parent pool owner. - */ - -#include "linden_common.h" - -#include "llerror.h" -#include "llaprpool.h" -#include "llthread.h" - -// Create a subpool from parent. -void LLAPRPool::create(LLAPRPool& parent) -{ - llassert(!mPool); // Must be non-initialized. - mParent = &parent; - if (!mParent) // Using the default parameter? - { - // By default use the root pool of the current thread. - mParent = &LLThreadLocalData::tldata().mRootPool; - } - llassert(mParent->mPool); // Parent must be initialized. -#if APR_HAS_THREADS - // As per the documentation of APR (ie http://apr.apache.org/docs/apr/1.4/apr__pools_8h.html): - // - // Note that most operations on pools are not thread-safe: a single pool should only be - // accessed by a single thread at any given time. The one exception to this rule is creating - // a subpool of a given pool: one or more threads can safely create subpools at the same - // time that another thread accesses the parent pool. - // - // In other words, it's safe for any thread to create a (sub)pool, independent of who - // owns the parent pool. - mOwner = apr_os_thread_current(); -#else - mOwner = mParent->mOwner; - llassert(apr_os_thread_equal(mOwner, apr_os_thread_current())); -#endif - apr_status_t const apr_pool_create_status = apr_pool_create(&mPool, mParent->mPool); - llassert_always(apr_pool_create_status == APR_SUCCESS); - llassert(mPool); // Initialized. - apr_pool_cleanup_register(mPool, this, &s_plain_cleanup, &apr_pool_cleanup_null); -} - -// Destroy the (sub)pool, if any. -void LLAPRPool::destroy(void) -{ - // Only do anything if we are not already (being) destroyed. - if (mPool) - { -#if !APR_HAS_THREADS - // If we are a root pool, then every thread may destruct us: in that case - // we have to assume that no other thread will use this pool concurrently, - // of course. Otherwise, if we are a subpool, only the thread that owns - // the parent may destruct us, since that is the pool that is still alive, - // possibly being used by others and being altered here. - llassert(!mParent || apr_os_thread_equal(mParent->mOwner, apr_os_thread_current())); -#endif - apr_pool_t* pool = mPool; // The use of apr_pool_t is OK here. - // Temporary store before destroying the pool. - mPool = NULL; // Mark that we are BEING destructed. - apr_pool_cleanup_kill(pool, this, &s_plain_cleanup); - apr_pool_destroy(pool); - } -} - -bool LLAPRPool::parent_is_being_destructed(void) -{ - return mParent && (!mParent->mPool || mParent->parent_is_being_destructed()); -} - -LLAPRInitialization::LLAPRInitialization(void) -{ - static bool apr_initialized = false; - - if (!apr_initialized) - { - apr_initialize(); - } - - apr_initialized = true; -} - -bool LLAPRRootPool::sCountInitialized = false; -apr_uint32_t volatile LLAPRRootPool::sCount; - -apr_thread_mutex_t* gLogMutexp; -apr_thread_mutex_t* gCallStacksLogMutexp; - -LLAPRRootPool::LLAPRRootPool(void) : LLAPRInitialization(), LLAPRPool(0) -{ - // sCountInitialized don't need locking because when we get here there is still only a single thread. - if (!sCountInitialized) - { - // Initialize the logging mutex - apr_thread_mutex_create(&gLogMutexp, APR_THREAD_MUTEX_UNNESTED, mPool); - apr_thread_mutex_create(&gCallStacksLogMutexp, APR_THREAD_MUTEX_UNNESTED, mPool); - - apr_status_t status = apr_atomic_init(mPool); - llassert_always(status == APR_SUCCESS); - apr_atomic_set32(&sCount, 1); // Set to 1 to account for the global root pool. - sCountInitialized = true; - - // Initialize thread-local APR pool support. - // Because this recursively calls LLAPRRootPool::LLAPRRootPool(void) - // it must be done last, so that sCount is already initialized. - LLThreadLocalData::init(); - } - apr_atomic_inc32(&sCount); -} - -LLAPRRootPool::~LLAPRRootPool() -{ - if (!apr_atomic_dec32(&sCount)) - { - // The last pool was destructed. Cleanup remainder of APR. - LL_INFOS("APR") << "Cleaning up APR" << LL_ENDL; - - if (gLogMutexp) - { - // Clean up the logging mutex - - // All other threads NEED to be done before we clean up APR, so this is okay. - apr_thread_mutex_destroy(gLogMutexp); - gLogMutexp = NULL; - } - if (gCallStacksLogMutexp) - { - // Clean up the logging mutex - - // All other threads NEED to be done before we clean up APR, so this is okay. - apr_thread_mutex_destroy(gCallStacksLogMutexp); - gCallStacksLogMutexp = NULL; - } - - // Must destroy ALL, and therefore this last LLAPRRootPool, before terminating APR. - static_cast(this)->destroy(); - - apr_terminate(); - } -} - -//static -// Return a global root pool that is independent of LLThreadLocalData. -// Normally you should NOT use this. Only use for early initialization -// (before main) and deinitialization (after main). -LLAPRRootPool& LLAPRRootPool::get(void) -{ - static LLAPRRootPool global_APRpool(0); - return global_APRpool; -} - -void LLVolatileAPRPool::clearVolatileAPRPool() -{ - llassert_always(mNumActiveRef > 0); - if (--mNumActiveRef == 0) - { - if (isOld()) - { - destroy(); - mNumTotalRef = 0 ; - } - else - { - // This does not actually free the memory, - // it just allows the pool to re-use this memory for the next allocation. - clear(); - } - } - - // Paranoia check if the pool is jammed. - llassert(mNumTotalRef < (FULL_VOLATILE_APR_POOL << 2)) ; -} diff --git a/indra/llcommon/llaprpool.h b/indra/llcommon/llaprpool.h deleted file mode 100644 index bf4102c584..0000000000 --- a/indra/llcommon/llaprpool.h +++ /dev/null @@ -1,256 +0,0 @@ -/** - * @file llaprpool.h - * @brief Implementation of LLAPRPool - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - * - * CHANGELOG - * and additional copyright holders. - * - * 04/04/2010 - * - Initial version, written by Aleric Inglewood @ SL - * - * 10/11/2010 - * - Added APR_HAS_THREADS #if's to allow creation and destruction - * of subpools by threads other than the parent pool owner. - * - * 05/02/2011 - * - Fixed compilation on windows: Suppress compile warning 4996 - * and include before including , - * by Merov Linden @ SL. - */ - -#ifndef LL_LLAPRPOOL_H -#define LL_LLAPRPOOL_H - -#ifdef LL_WINDOWS -#pragma warning(push) -#pragma warning(disable:4996) -#include -#include // Needed before including apr_portable.h -#pragma warning(pop) -#endif - -#include "apr_portable.h" -#include "apr_pools.h" -#include "llerror.h" - -extern void ll_init_apr(); - -/** - * @brief A wrapper around the APR memory pool API. - * - * Usage of this class should be restricted to passing it to libapr-1 function calls that need it. - * - */ -class LL_COMMON_API LLAPRPool -{ -protected: - //! Pointer to the underlaying pool. NULL if not initialized. - apr_pool_t* mPool; // The use of apr_pool_t is OK here. - // This is the wrapped pointer that it is all about! - //! Pointer to the parent pool, if any. Only valid when mPool is non-zero. - LLAPRPool* mParent; - //! The thread that owns this memory pool. Only valid when mPool is non-zero. - apr_os_thread_t mOwner; - -public: - /// Construct an uninitialized (destructed) pool. - LLAPRPool(void) : mPool(NULL) { } - - /// Construct a subpool from an existing pool. - /// This is not a copy-constructor, this class doesn't have one! - LLAPRPool(LLAPRPool& parent) : mPool(NULL) { create(parent); } - - /// Destruct the memory pool (free all of its subpools and allocated memory). - ~LLAPRPool() { destroy(); } - -protected: - /// Create a pool that is allocated from the Operating System. Only used by LLAPRRootPool. - LLAPRPool(int) : mPool(NULL), mParent(NULL), mOwner(apr_os_thread_current()) - { - apr_status_t const apr_pool_create_status = apr_pool_create(&mPool, NULL); - llassert_always(apr_pool_create_status == APR_SUCCESS); - llassert(mPool); - apr_pool_cleanup_register(mPool, this, &s_plain_cleanup, &apr_pool_cleanup_null); - } - -public: - /// Create a subpool from parent. May only be called for an uninitialized/destroyed pool. - /// The default parameter causes the root pool of the current thread to be used. - void create(LLAPRPool& parent = *static_cast(NULL)); - - /// Destroy the (sub)pool, if any. - void destroy(void); - - // Use some safebool idiom (http://www.artima.com/cppsource/safebool.html) rather than operator bool. - typedef LLAPRPool* const LLAPRPool::* const bool_type; - /// Return true if the pool is initialized. - operator bool_type() const { return mPool ? &LLAPRPool::mParent : 0; } - - /// Painful, but we have to either provide access to this, or wrap - /// every APR function call that needs an apr pool as argument. - /// NEVER destroy a pool that is returned by this function! - apr_pool_t* operator()(void) const // The use of apr_pool_t is OK here. - // This is the accessor for passing the pool to libapr-1 functions. - { - llassert(mPool); - llassert(apr_os_thread_equal(mOwner, apr_os_thread_current())); - return mPool; - } - - /// Free all memory without destructing the pool. - void clear(void) - { - llassert(mPool); - llassert(apr_os_thread_equal(mOwner, apr_os_thread_current())); - apr_pool_clear(mPool); - } - -// These methods would make this class 'complete' (as wrapper around the libapr -// pool functions), but we don't use memory pools in the viewer (only when -// we are forced to pass one to a libapr call), so don't define them in order -// not to encourage people to use them. -#if 0 - void* palloc(size_t size) - { - llassert(mPool); - llassert(apr_os_thread_equal(mOwner, apr_os_thread_current())); - return apr_palloc(mPool, size); - } - void* pcalloc(size_t size) - { - llassert(mPool); - llassert(apr_os_thread_equal(mOwner, apr_os_thread_current())); - return apr_pcalloc(mPool, size); - } -#endif - -private: - bool parent_is_being_destructed(void); - static apr_status_t s_plain_cleanup(void* userdata) { return static_cast(userdata)->plain_cleanup(); } - - apr_status_t plain_cleanup(void) - { - if (mPool && // We are not being destructed, - parent_is_being_destructed()) // but our parent is. - // This means the pool is being destructed recursively by libapr - // because one of its parents is being destructed. - { - mPool = NULL; // Stop destroy() from destructing the pool again. - } - return APR_SUCCESS; - } -}; - -class LLAPRInitialization -{ -public: - LLAPRInitialization(void); -}; - -/** - * @brief Root memory pool (allocates memory from the operating system). - * - * This class should only be used by LLThreadLocalData - * (and LLMutexRootPool when APR_HAS_THREADS isn't defined). - */ -class LL_COMMON_API LLAPRRootPool : public LLAPRInitialization, public LLAPRPool -{ -private: - /// Construct a root memory pool. Should only be used by LLThreadLocalData and LLMutexRootPool. - friend class LLThreadLocalData; -#if !APR_HAS_THREADS - friend class LLMutexRootPool; -#endif - /// Construct a root memory pool. - /// Should only be used by LLThreadLocalData. - LLAPRRootPool(void); - ~LLAPRRootPool(); - -private: - // Keep track of how many root pools exist and when the last one is destructed. - static bool sCountInitialized; - static apr_uint32_t volatile sCount; - -public: - // Return a global root pool that is independent of LLThreadLocalData. - // Normally you should not use this. Only use for early initialization - // (before main) and deinitialization (after main). - static LLAPRRootPool& get(void); - -#if APR_POOL_DEBUG - void grab_ownership(void) - { - // You need a patched libapr to use this. - // See http://web.archiveorange.com/archive/v/5XO9y2zoxUOMt6Gmi1OI - apr_pool_owner_set(mPool); - } -#endif - -private: - // Used for constructing the Special Global Root Pool (returned by LLAPRRootPool::get). - // It is the same as the default constructor but omits to increment sCount. As a result, - // we must be sure that at least one other LLAPRRootPool is created before termination - // of the application (which is the case: we create one LLAPRRootPool per thread). - LLAPRRootPool(int) : LLAPRInitialization(), LLAPRPool(0) { } -}; - -/** Volatile memory pool - * - * 'Volatile' APR memory pool which normally only clears memory, - * and does not destroy the pool (the same pool is reused) for - * greater efficiency. However, as a safe guard the apr pool - * is destructed every FULL_VOLATILE_APR_POOL uses to allow - * the system memory to be allocated more efficiently and not - * get scattered through RAM. - */ -class LL_COMMON_API LLVolatileAPRPool : protected LLAPRPool -{ -public: - LLVolatileAPRPool(void) : mNumActiveRef(0), mNumTotalRef(0) { } - - void clearVolatileAPRPool(void); - - bool isOld(void) const { return mNumTotalRef > FULL_VOLATILE_APR_POOL; } - bool isUnused() const { return mNumActiveRef == 0; } - -private: - friend class LLScopedVolatileAPRPool; - friend class LLAPRFile; - apr_pool_t* getVolatileAPRPool(void) // The use of apr_pool_t is OK here. - { - if (!mPool) create(); - ++mNumActiveRef; - ++mNumTotalRef; - return LLAPRPool::operator()(); - } - -private: - S32 mNumActiveRef; // Number of active uses of the pool. - S32 mNumTotalRef; // Number of total uses of the pool since last creation. - - // Maximum number of references to LLVolatileAPRPool until the pool is recreated. - static S32 const FULL_VOLATILE_APR_POOL = 1024; -}; - -#endif // LL_LLAPRPOOL_H diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index b8a7394852..8be9e4f4de 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -30,10 +30,18 @@ #include "llmemory.h" #include "llthread.h" +//static +BOOL LLCommon::sAprInitialized = FALSE; + //static void LLCommon::initClass() { LLMemory::initClass(); + if (!sAprInitialized) + { + ll_init_apr(); + sAprInitialized = TRUE; + } LLTimer::initClass(); LLThreadSafeRefCount::initThreadSafeRefCount(); // LLWorkerThread::initClass(); @@ -47,5 +55,10 @@ void LLCommon::cleanupClass() // LLWorkerThread::cleanupClass(); LLThreadSafeRefCount::cleanupThreadSafeRefCount(); LLTimer::cleanupClass(); + if (sAprInitialized) + { + ll_cleanup_apr(); + sAprInitialized = FALSE; + } LLMemory::cleanupClass(); } diff --git a/indra/llcommon/llcommon.h b/indra/llcommon/llcommon.h index 171590f3d8..ca9cad5d05 100644 --- a/indra/llcommon/llcommon.h +++ b/indra/llcommon/llcommon.h @@ -35,6 +35,8 @@ class LL_COMMON_API LLCommon public: static void initClass(); static void cleanupClass(); +private: + static BOOL sAprInitialized; }; #endif diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 75048073ca..bb64152407 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -866,9 +866,6 @@ You get: */ -extern apr_thread_mutex_t* gLogMutexp; -extern apr_thread_mutex_t* gCallStacksLogMutexp; - namespace { bool checkLevelMap(const LevelMap& map, const std::string& key, LLError::ELevel& level) diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 15d167c32e..4a42241c4f 100644 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -296,4 +296,5 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG; Such computation is done iff the message will be logged. */ + #endif // LL_LLERROR_H diff --git a/indra/llcommon/llfixedbuffer.cpp b/indra/llcommon/llfixedbuffer.cpp index 4b5cdbe288..d394f179fb 100644 --- a/indra/llcommon/llfixedbuffer.cpp +++ b/indra/llcommon/llfixedbuffer.cpp @@ -30,7 +30,8 @@ LLFixedBuffer::LLFixedBuffer(const U32 max_lines) : LLLineBuffer(), - mMaxLines(max_lines) + mMaxLines(max_lines), + mMutex(NULL) { mTimer.reset(); } diff --git a/indra/llcommon/llscopedvolatileaprpool.h b/indra/llcommon/llscopedvolatileaprpool.h deleted file mode 100644 index dbaf4edcad..0000000000 --- a/indra/llcommon/llscopedvolatileaprpool.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file llscopedvolatileaprpool.h - * @brief Implementation of LLScopedVolatileAPRPool - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLSCOPEDVOLATILEAPRPOOL_H -#define LL_LLSCOPEDVOLATILEAPRPOOL_H - -#include "llthread.h" - -/** Scoped volatile memory pool. - * - * As the LLVolatileAPRPool should never keep allocations very - * long, its most common use is for allocations with a lifetime - * equal to it's scope. - * - * This is a convenience class that makes just a little easier to type. - */ -class LL_COMMON_API LLScopedVolatileAPRPool -{ -private: - LLVolatileAPRPool& mPool; - apr_pool_t* mScopedAPRpool; // The use of apr_pool_t is OK here. -public: - LLScopedVolatileAPRPool() : mPool(LLThreadLocalData::tldata().mVolatileAPRPool), mScopedAPRpool(mPool.getVolatileAPRPool()) { } - ~LLScopedVolatileAPRPool() { mPool.clearVolatileAPRPool(); } - //! @attention Only use this to pass the underlaying pointer to a libapr-1 function that requires it. - operator apr_pool_t*() const { return mScopedAPRpool; } // The use of apr_pool_t is OK here. -}; - -#endif diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 4917e3b935..49d05ef411 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -63,9 +63,6 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap { LLThread *threadp = (LLThread *)datap; - // Create a thread local data. - LLThreadLocalData::create(threadp); - // Run the user supplied function threadp->run(); @@ -78,20 +75,38 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap } -LLThread::LLThread(std::string const& name) : - mPaused(false), +LLThread::LLThread(const std::string& name, apr_pool_t *poolp) : + mPaused(FALSE), mName(name), mAPRThreadp(NULL), - mStatus(STOPPED), - mThreadLocalData(NULL) + mStatus(STOPPED) { - mRunCondition = new LLCondition; + // Thread creation probably CAN be paranoid about APR being initialized, if necessary + if (poolp) + { + mIsLocalPool = FALSE; + mAPRPoolp = poolp; + } + else + { + mIsLocalPool = TRUE; + apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread + } + mRunCondition = new LLCondition(mAPRPoolp); + + mLocalAPRFilePoolp = NULL ; } LLThread::~LLThread() { shutdown(); + + if(mLocalAPRFilePoolp) + { + delete mLocalAPRFilePoolp ; + mLocalAPRFilePoolp = NULL ; + } } void LLThread::shutdown() @@ -128,7 +143,7 @@ void LLThread::shutdown() if (!isStopped()) { // This thread just wouldn't stop, even though we gave it time - llwarns << "LLThread::shutdown() exiting thread before clean exit!" << llendl; + llwarns << "LLThread::~LLThread() exiting thread before clean exit!" << llendl; // Put a stake in its heart. apr_thread_exit(mAPRThreadp, -1); return; @@ -138,8 +153,15 @@ void LLThread::shutdown() delete mRunCondition; mRunCondition = 0; + + if (mIsLocalPool && mAPRPoolp) + { + apr_pool_destroy(mAPRPoolp); + mAPRPoolp = 0; + } } + void LLThread::start() { llassert(isStopped()); @@ -148,7 +170,7 @@ void LLThread::start() mStatus = RUNNING; apr_status_t status = - apr_thread_create(&mAPRThreadp, NULL, staticRun, (void *)this, tldata().mRootPool()); + apr_thread_create(&mAPRThreadp, NULL, staticRun, (void *)this, mAPRPoolp); if(status == APR_SUCCESS) { @@ -173,7 +195,7 @@ void LLThread::pause() if (!mPaused) { // this will cause the thread to stop execution as soon as checkPause() is called - mPaused = true; // Does not need to be atomic since this is only set/unset from the main thread + mPaused = 1; // Does not need to be atomic since this is only set/unset from the main thread } } @@ -181,7 +203,7 @@ void LLThread::unpause() { if (mPaused) { - mPaused = false; + mPaused = 0; } wake(); // wake up the thread if necessary @@ -258,76 +280,85 @@ void LLThread::wakeLocked() } } -#ifdef SHOW_ASSERT -// This allows the use of llassert(is_main_thread()) to assure the current thread is the main thread. -static apr_os_thread_t main_thread_id; -LL_COMMON_API bool is_main_thread(void) { return apr_os_thread_equal(main_thread_id, apr_os_thread_current()); } -#endif - -// The thread private handle to access the LLThreadLocalData instance. -apr_threadkey_t* LLThreadLocalData::sThreadLocalDataKey; +//============================================================================ -//static -void LLThreadLocalData::init(void) +LLMutex::LLMutex(apr_pool_t *poolp) : + mAPRMutexp(NULL) { - // Only do this once. - if (sThreadLocalDataKey) + //if (poolp) + //{ + // mIsLocalPool = FALSE; + // mAPRPoolp = poolp; + //} + //else { - return; + mIsLocalPool = TRUE; + apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread } + apr_thread_mutex_create(&mAPRMutexp, APR_THREAD_MUTEX_UNNESTED, mAPRPoolp); +} - apr_status_t status = apr_threadkey_private_create(&sThreadLocalDataKey, &LLThreadLocalData::destroy, LLAPRRootPool::get()()); - ll_apr_assert_status(status); // Or out of memory, or system-imposed limit on the - // total number of keys per process {PTHREAD_KEYS_MAX} - // has been exceeded. - - // Create the thread-local data for the main thread (this function is called by the main thread). - LLThreadLocalData::create(NULL); -#ifdef SHOW_ASSERT - // This function is called by the main thread. - main_thread_id = apr_os_thread_current(); +LLMutex::~LLMutex() +{ +#if MUTEX_DEBUG + llassert_always(!isLocked()); // better not be locked! #endif + apr_thread_mutex_destroy(mAPRMutexp); + mAPRMutexp = NULL; + if (mIsLocalPool) + { + apr_pool_destroy(mAPRPoolp); + } } -// This is called once for every thread when the thread is destructed. -//static -void LLThreadLocalData::destroy(void* thread_local_data) + +void LLMutex::lock() { - delete static_cast(thread_local_data); + apr_thread_mutex_lock(mAPRMutexp); +#if MUTEX_DEBUG + // Have to have the lock before we can access the debug info + U32 id = LLThread::currentID(); + if (mIsLocked[id] != FALSE) + llerrs << "Already locked in Thread: " << id << llendl; + mIsLocked[id] = TRUE; +#endif } -//static -void LLThreadLocalData::create(LLThread* threadp) +void LLMutex::unlock() { - LLThreadLocalData* new_tld = new LLThreadLocalData; - if (threadp) - { - threadp->mThreadLocalData = new_tld; - } - apr_status_t status = apr_threadkey_private_set(new_tld, sThreadLocalDataKey); - llassert_always(status == APR_SUCCESS); +#if MUTEX_DEBUG + // Access the debug info while we have the lock + U32 id = LLThread::currentID(); + if (mIsLocked[id] != TRUE) + llerrs << "Not locked in Thread: " << id << llendl; + mIsLocked[id] = FALSE; +#endif + apr_thread_mutex_unlock(mAPRMutexp); } -//static -LLThreadLocalData& LLThreadLocalData::tldata(void) +bool LLMutex::isLocked() { - if (!sThreadLocalDataKey) + apr_status_t status = apr_thread_mutex_trylock(mAPRMutexp); + if (APR_STATUS_IS_EBUSY(status)) { - LLThreadLocalData::init(); + return true; + } + else + { + apr_thread_mutex_unlock(mAPRMutexp); + return false; } - - void* data; - apr_status_t status = apr_threadkey_private_get(&data, sThreadLocalDataKey); - llassert_always(status == APR_SUCCESS); - return *static_cast(data); } //============================================================================ -LLCondition::LLCondition(LLAPRPool& parent) : LLMutex(parent) +LLCondition::LLCondition(apr_pool_t *poolp) : + LLMutex(poolp) { - apr_thread_cond_create(&mAPRCondp, mPool()); + // base class (LLMutex) has already ensured that mAPRPoolp is set up. + + apr_thread_cond_create(&mAPRCondp, mAPRPoolp); } @@ -365,7 +396,7 @@ void LLThreadSafeRefCount::initThreadSafeRefCount() { if (!sMutex) { - sMutex = new LLMutex; + sMutex = new LLMutex(0); } } diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 757832b8ca..f1c6cd75af 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -29,34 +29,12 @@ #include "llapp.h" #include "llapr.h" -#include "llmemory.h" #include "apr_thread_cond.h" -#include "llaprpool.h" - -#ifdef SHOW_ASSERT -extern LL_COMMON_API bool is_main_thread(void); -#endif class LLThread; class LLMutex; class LLCondition; -class LL_COMMON_API LLThreadLocalData -{ -private: - static apr_threadkey_t* sThreadLocalDataKey; - -public: - // Thread-local memory pools. - LLAPRRootPool mRootPool; - LLVolatileAPRPool mVolatileAPRPool; - - static void init(void); - static void destroy(void* thread_local_data); - static void create(LLThread* pthread); - static LLThreadLocalData& tldata(void); -}; - class LL_COMMON_API LLThread { public: @@ -67,7 +45,7 @@ public: QUITTING= 2 // Someone wants this thread to quit } EThreadStatus; - LLThread(std::string const& name); + LLThread(const std::string& name, apr_pool_t *poolp = NULL); virtual ~LLThread(); // Warning! You almost NEVER want to destroy a thread unless it's in the STOPPED state. virtual void shutdown(); // stops the thread @@ -82,7 +60,7 @@ public: // Called from MAIN THREAD. void pause(); void unpause(); - bool isPaused() { return isStopped() || mPaused; } + bool isPaused() { return isStopped() || mPaused == TRUE; } // Cause the thread to wake up and check its condition void wake(); @@ -96,11 +74,11 @@ public: // this kicks off the apr thread void start(void); - // Return thread-local data for the current thread. - static LLThreadLocalData& tldata(void) { return LLThreadLocalData::tldata(); } + apr_pool_t *getAPRPool() { return mAPRPoolp; } + LLVolatileAPRPool* getLocalAPRFilePool() { return mLocalAPRFilePoolp ; } private: - bool mPaused; + BOOL mPaused; // static function passed to APR thread creation routine static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap); @@ -110,10 +88,14 @@ protected: LLCondition* mRunCondition; apr_thread_t *mAPRThreadp; + apr_pool_t *mAPRPoolp; + BOOL mIsLocalPool; EThreadStatus mStatus; - friend void LLThreadLocalData::create(LLThread* threadp); - LLThreadLocalData* mThreadLocalData; + //a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used. + //Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes. + // otherwise it will cause severe memory leaking!!! --bao + LLVolatileAPRPool *mLocalAPRFilePoolp ; void setQuitting(); @@ -143,80 +125,30 @@ protected: #define MUTEX_DEBUG (LL_DEBUG || LL_RELEASE_WITH_DEBUG_INFO) -#ifdef MUTEX_DEBUG -// We really shouldn't be using recursive locks. Make sure of that in debug mode. -#define MUTEX_FLAG APR_THREAD_MUTEX_UNNESTED -#else -// Use the fastest platform-optimal lock behavior (can be recursive or non-recursive). -#define MUTEX_FLAG APR_THREAD_MUTEX_DEFAULT -#endif - -class LL_COMMON_API LLMutexBase -{ -public: - void lock() { apr_thread_mutex_lock(mAPRMutexp); } - void unlock() { apr_thread_mutex_unlock(mAPRMutexp); } - // Returns true if lock was obtained successfully. - bool trylock() { return !APR_STATUS_IS_EBUSY(apr_thread_mutex_trylock(mAPRMutexp)); } - - // non-blocking, but does do a lock/unlock so not free - bool isLocked() { bool is_not_locked = trylock(); if (is_not_locked) unlock(); return !is_not_locked; } - -protected: - // mAPRMutexp is initialized and uninitialized in the derived class. - apr_thread_mutex_t* mAPRMutexp; -}; - -class LL_COMMON_API LLMutex : public LLMutexBase +class LL_COMMON_API LLMutex { public: - LLMutex(LLAPRPool& parent = LLThread::tldata().mRootPool) : mPool(parent) - { - apr_thread_mutex_create(&mAPRMutexp, MUTEX_FLAG, mPool()); - } - ~LLMutex() - { - llassert(!isLocked()); // better not be locked! - apr_thread_mutex_destroy(mAPRMutexp); - mAPRMutexp = NULL; - } - + LLMutex(apr_pool_t *apr_poolp); // NULL pool constructs a new pool for the mutex + virtual ~LLMutex(); + + void lock(); // blocks + void unlock(); + bool isLocked(); // non-blocking, but does do a lock/unlock so not free + protected: - LLAPRPool mPool; -}; - -#if APR_HAS_THREADS -// No need to use a root pool in this case. -typedef LLMutex LLMutexRootPool; -#else // APR_HAS_THREADS -class LL_COMMON_API LLMutexRootPool : public LLMutexBase -{ -public: - LLMutexRootPool(void) - { - apr_thread_mutex_create(&mAPRMutexp, MUTEX_FLAG, mRootPool()); - } - ~LLMutexRootPool() - { -#if APR_POOL_DEBUG - // It is allowed to destruct root pools from a different thread. - mRootPool.grab_ownership(); + apr_thread_mutex_t *mAPRMutexp; + apr_pool_t *mAPRPoolp; + BOOL mIsLocalPool; +#if MUTEX_DEBUG + std::map mIsLocked; #endif - llassert(!isLocked()); - apr_thread_mutex_destroy(mAPRMutexp); - mAPRMutexp = NULL; - } - -protected: - LLAPRRootPool mRootPool; }; -#endif // APR_HAS_THREADS // Actually a condition/mutex pair (since each condition needs to be associated with a mutex). class LL_COMMON_API LLCondition : public LLMutex { public: - LLCondition(LLAPRPool& parent = LLThread::tldata().mRootPool); + LLCondition(apr_pool_t *apr_poolp); // Defaults to global pool, could use the thread pool as well. ~LLCondition(); void wait(); // blocks @@ -227,10 +159,10 @@ protected: apr_thread_cond_t *mAPRCondp; }; -class LL_COMMON_API LLMutexLock +class LLMutexLock { public: - LLMutexLock(LLMutexBase* mutex) + LLMutexLock(LLMutex* mutex) { mMutex = mutex; mMutex->lock(); @@ -240,7 +172,7 @@ public: mMutex->unlock(); } private: - LLMutexBase* mMutex; + LLMutex* mMutex; }; //============================================================================ diff --git a/indra/llcommon/llthreadsafequeue.cpp b/indra/llcommon/llthreadsafequeue.cpp index 05d24944f3..8a73e632a9 100644 --- a/indra/llcommon/llthreadsafequeue.cpp +++ b/indra/llcommon/llthreadsafequeue.cpp @@ -34,11 +34,19 @@ //----------------------------------------------------------------------------- -LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(unsigned int capacity): +LLThreadSafeQueueImplementation::LLThreadSafeQueueImplementation(apr_pool_t * pool, unsigned int capacity): + mOwnsPool(pool == 0), + mPool(pool), mQueue(0) { - mPool.create(); - apr_status_t status = apr_queue_create(&mQueue, capacity, mPool()); + if(mOwnsPool) { + apr_status_t status = apr_pool_create(&mPool, 0); + if(status != APR_SUCCESS) throw LLThreadSafeQueueError("failed to allocate pool"); + } else { + ; // No op. + } + + apr_status_t status = apr_queue_create(&mQueue, capacity, mPool); if(status != APR_SUCCESS) throw LLThreadSafeQueueError("failed to allocate queue"); } @@ -51,6 +59,7 @@ LLThreadSafeQueueImplementation::~LLThreadSafeQueueImplementation() " elements;" << "memory will be leaked" << LL_ENDL; apr_queue_term(mQueue); } + if(mOwnsPool && (mPool != 0)) apr_pool_destroy(mPool); } diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h index 43d0b396f2..58cac38769 100644 --- a/indra/llcommon/llthreadsafequeue.h +++ b/indra/llcommon/llthreadsafequeue.h @@ -30,9 +30,9 @@ #include #include -#include "llaprpool.h" +struct apr_pool_t; // From apr_pools.h class LLThreadSafeQueueImplementation; // See below. @@ -75,7 +75,7 @@ struct apr_queue_t; // From apr_queue.h class LL_COMMON_API LLThreadSafeQueueImplementation { public: - LLThreadSafeQueueImplementation(unsigned int capacity); + LLThreadSafeQueueImplementation(apr_pool_t * pool, unsigned int capacity); ~LLThreadSafeQueueImplementation(); void pushFront(void * element); bool tryPushFront(void * element); @@ -84,7 +84,8 @@ public: size_t size(); private: - LLAPRPool mPool; // The pool used for mQueue. + bool mOwnsPool; + apr_pool_t * mPool; apr_queue_t * mQueue; }; @@ -98,8 +99,9 @@ class LLThreadSafeQueue public: typedef ElementT value_type; - // Constructor. - LLThreadSafeQueue(unsigned int capacity = 1024); + // If the pool is set to NULL one will be allocated and managed by this + // queue. + LLThreadSafeQueue(apr_pool_t * pool = 0, unsigned int capacity = 1024); // Add an element to the front of queue (will block if the queue has // reached capacity). @@ -137,8 +139,8 @@ private: template -LLThreadSafeQueue::LLThreadSafeQueue(unsigned int capacity) : - mImplementation(capacity) +LLThreadSafeQueue::LLThreadSafeQueue(apr_pool_t * pool, unsigned int capacity): + mImplementation(pool, capacity) { ; // No op. } diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp index 6b308bb917..3ac50832fd 100644 --- a/indra/llcommon/llworkerthread.cpp +++ b/indra/llcommon/llworkerthread.cpp @@ -37,7 +37,12 @@ LLWorkerThread::LLWorkerThread(const std::string& name, bool threaded) : LLQueuedThread(name, threaded) { - mDeleteMutex = new LLMutex; + mDeleteMutex = new LLMutex(NULL); + + if(!mLocalAPRFilePoolp) + { + mLocalAPRFilePoolp = new LLVolatileAPRPool() ; + } } LLWorkerThread::~LLWorkerThread() @@ -199,6 +204,7 @@ LLWorkerClass::LLWorkerClass(LLWorkerThread* workerthread, const std::string& na mWorkerClassName(name), mRequestHandle(LLWorkerThread::nullHandle()), mRequestPriority(LLWorkerThread::PRIORITY_NORMAL), + mMutex(NULL), mWorkFlags(0) { if (!mWorkerThread) diff --git a/indra/llcommon/llworkerthread.h b/indra/llcommon/llworkerthread.h index bef5ef53fe..9bff18303e 100644 --- a/indra/llcommon/llworkerthread.h +++ b/indra/llcommon/llworkerthread.h @@ -94,6 +94,7 @@ public: private: void deleteWorker(LLWorkerClass* workerclass); // schedule for deletion + }; //============================================================================ @@ -193,7 +194,7 @@ protected: U32 mRequestPriority; // last priority set private: - LLMutexRootPool mMutex; // Use LLMutexRootPool since this object is created and destructed by multiple threads. + LLMutex mMutex; LLAtomicU32 mWorkFlags; }; diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp index 8f7916f565..68e45f36e4 100644 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ b/indra/llcrashlogger/llcrashlogger.cpp @@ -390,7 +390,8 @@ bool LLCrashLogger::init() return false; } - gServicePump = new LLPumpIO; + gServicePump = new LLPumpIO(gAPRPoolp); + gServicePump->prime(gAPRPoolp); LLHTTPClient::setPump(*gServicePump); //If we've opened the crash logger, assume we can delete the marker file if it exists diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index f4399d4ed4..39211bf7fa 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -51,7 +51,7 @@ LLMutex* LLImage::sMutex = NULL; //static void LLImage::initClass() { - sMutex = new LLMutex; + sMutex = new LLMutex(NULL); } //static @@ -1557,7 +1557,8 @@ BOOL LLImageFormatted::load(const std::string &filename) resetLastError(); S32 file_size = 0; - LLAPRFile infile(filename, LL_APR_RB, &file_size); + LLAPRFile infile ; + infile.open(filename, LL_APR_RB, NULL, &file_size); apr_file_t* apr_file = infile.getFileHandle(); if (!apr_file) { @@ -1592,7 +1593,8 @@ BOOL LLImageFormatted::save(const std::string &filename) { resetLastError(); - LLAPRFile outfile(filename, LL_APR_WB); + LLAPRFile outfile ; + outfile.open(filename, LL_APR_WB); if (!outfile.getFileHandle()) { setLastError("Unable to open file for writing", filename); diff --git a/indra/llimage/llimagedimensionsinfo.cpp b/indra/llimage/llimagedimensionsinfo.cpp index 8a10956a5b..835664c60f 100644 --- a/indra/llimage/llimagedimensionsinfo.cpp +++ b/indra/llimage/llimagedimensionsinfo.cpp @@ -40,7 +40,7 @@ bool LLImageDimensionsInfo::load(const std::string& src_filename,U32 codec) mSrcFilename = src_filename; S32 file_size = 0; - apr_status_t s = mInfile.open(src_filename, LL_APR_RB, LLAPRFile::long_lived, &file_size); + apr_status_t s = mInfile.open(src_filename, LL_APR_RB, NULL, &file_size); if (s != APR_SUCCESS) { diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 5f488a6764..cb2a85fa91 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -358,7 +358,8 @@ BOOL LLImageJ2C::loadAndValidate(const std::string &filename) resetLastError(); S32 file_size = 0; - LLAPRFile infile(filename, LL_APR_RB, &file_size); + LLAPRFile infile ; + infile.open(filename, LL_APR_RB, NULL, &file_size); apr_file_t* apr_file = infile.getFileHandle() ; if (!apr_file) { diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index 2c6d6f31ea..28dc3bd313 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -35,18 +35,20 @@ LLImageDecodeThread::LLImageDecodeThread(bool threaded) : LLQueuedThread("imagedecode", threaded) { + mCreationMutex = new LLMutex(getAPRPool()); } //virtual LLImageDecodeThread::~LLImageDecodeThread() { + delete mCreationMutex ; } // MAIN THREAD // virtual S32 LLImageDecodeThread::update(U32 max_time_ms) { - LLMutexLock lock(&mCreationMutex); + LLMutexLock lock(mCreationMutex); for (creation_list_t::iterator iter = mCreationList.begin(); iter != mCreationList.end(); ++iter) { @@ -69,7 +71,7 @@ S32 LLImageDecodeThread::update(U32 max_time_ms) LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage(LLImageFormatted* image, U32 priority, S32 discard, BOOL needs_aux, Responder* responder) { - LLMutexLock lock(&mCreationMutex); + LLMutexLock lock(mCreationMutex); handle_t handle = generateHandle(); mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder)); return handle; @@ -79,7 +81,7 @@ LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage(LLImageFormatted* // Returns the size of the mutex guarded list as an indication of sanity S32 LLImageDecodeThread::tut_size() { - LLMutexLock lock(&mCreationMutex); + LLMutexLock lock(mCreationMutex); S32 res = mCreationList.size(); return res; } diff --git a/indra/llimage/llimageworker.h b/indra/llimage/llimageworker.h index 6a24b7522a..c684222fa5 100644 --- a/indra/llimage/llimageworker.h +++ b/indra/llimage/llimageworker.h @@ -98,7 +98,7 @@ private: }; typedef std::list creation_list_t; creation_list_t mCreationList; - LLMutex mCreationMutex; + LLMutex* mCreationMutex; }; #endif diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp index 734440d312..88c195936c 100644 --- a/indra/llmath/llvolumemgr.cpp +++ b/indra/llmath/llvolumemgr.cpp @@ -49,7 +49,7 @@ LLVolumeMgr::LLVolumeMgr() { // the LLMutex magic interferes with easy unit testing, // so you now must manually call useMutex() to use it - //mDataMutex = new LLMutex; + //mDataMutex = new LLMutex(gAPRPoolp); } LLVolumeMgr::~LLVolumeMgr() @@ -216,7 +216,7 @@ void LLVolumeMgr::useMutex() { if (!mDataMutex) { - mDataMutex = new LLMutex; + mDataMutex = new LLMutex(gAPRPoolp); } } diff --git a/indra/llmessage/llares.cpp b/indra/llmessage/llares.cpp index fab9858b69..5a67035ed1 100644 --- a/indra/llmessage/llares.cpp +++ b/indra/llmessage/llares.cpp @@ -28,7 +28,6 @@ #include "linden_common.h" #include "llares.h" -#include "llscopedvolatileaprpool.h" #include #include @@ -465,6 +464,11 @@ void LLAres::search(const std::string &query, LLResType type, bool LLAres::process(U64 timeout) { + if (!gAPRPoolp) + { + ll_init_apr(); + } + ares_socket_t socks[ARES_GETSOCK_MAXNUM]; apr_pollfd_t aprFds[ARES_GETSOCK_MAXNUM]; apr_int32_t nsds = 0; @@ -478,7 +482,10 @@ bool LLAres::process(U64 timeout) return nsds > 0; } - LLScopedVolatileAPRPool scoped_pool; + apr_status_t status; + LLAPRPool pool; + status = pool.getStatus() ; + ll_apr_assert_status(status); for (int i = 0; i < ARES_GETSOCK_MAXNUM; i++) { @@ -495,7 +502,7 @@ bool LLAres::process(U64 timeout) apr_socket_t *aprSock = NULL; - apr_status_t status = apr_os_sock_put(&aprSock, (apr_os_sock_t *) &socks[i], scoped_pool); + status = apr_os_sock_put(&aprSock, (apr_os_sock_t *) &socks[i], pool.getAPRPool()); if (status != APR_SUCCESS) { ll_apr_warn_status(status); @@ -504,7 +511,7 @@ bool LLAres::process(U64 timeout) aprFds[nactive].desc.s = aprSock; aprFds[nactive].desc_type = APR_POLL_SOCKET; - aprFds[nactive].p = scoped_pool; + aprFds[nactive].p = pool.getAPRPool(); aprFds[nactive].rtnevents = 0; aprFds[nactive].client_data = &socks[i]; @@ -513,7 +520,7 @@ bool LLAres::process(U64 timeout) if (nactive > 0) { - apr_status_t status = apr_poll(aprFds, nactive, &nsds, timeout); + status = apr_poll(aprFds, nactive, &nsds, timeout); if (status != APR_SUCCESS && status != APR_TIMEUP) { diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 4d3b382f7a..a485fa0160 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -1039,7 +1039,7 @@ void LLCurl::initClass() S32 mutex_count = CRYPTO_num_locks(); for (S32 i=0; i factory_ptr(factory); - LLIOServerSocket* server = new LLIOServerSocket(socket, factory_ptr); + LLIOServerSocket* server = new LLIOServerSocket(pool, socket, factory_ptr); LLPumpIO::chain_t chain; chain.push_back(LLIOPipe::ptr_t(server)); diff --git a/indra/llmessage/lliohttpserver.h b/indra/llmessage/lliohttpserver.h index 2294e4b8ae..5c1b0531ff 100644 --- a/indra/llmessage/lliohttpserver.h +++ b/indra/llmessage/lliohttpserver.h @@ -50,7 +50,7 @@ class LLIOHTTPServer public: typedef void (*timing_callback_t)(const char* hashed_name, F32 time, void* data); - static LLHTTPNode& create(LLPumpIO& pump, U16 port); + static LLHTTPNode& create(apr_pool_t* pool, LLPumpIO& pump, U16 port); /**< Creates an HTTP wire server on the pump for the given TCP port. * * Returns the root node of the new server. Add LLHTTPNode instances diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index e802d9b3a6..ca84fa8bb8 100644 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -35,7 +35,6 @@ #include "llhost.h" #include "llmemtype.h" #include "llpumpio.h" -#include "llthread.h" // // constants @@ -99,31 +98,51 @@ void ll_debug_socket(const char* msg, apr_socket_t* apr_sock) /// // static -LLSocket::ptr_t LLSocket::create(EType type, U16 port) +LLSocket::ptr_t LLSocket::create(apr_pool_t* pool, EType type, U16 port) { LLMemType m1(LLMemType::MTYPE_IO_TCP); + LLSocket::ptr_t rv; + apr_socket_t* socket = NULL; + apr_pool_t* new_pool = NULL; apr_status_t status = APR_EGENERAL; - LLSocket::ptr_t rv(new LLSocket); + + // create a pool for the socket + status = apr_pool_create(&new_pool, pool); + if(ll_apr_warn_status(status)) + { + if(new_pool) apr_pool_destroy(new_pool); + return rv; + } if(STREAM_TCP == type) { - status = apr_socket_create(&rv->mSocket, APR_INET, SOCK_STREAM, APR_PROTO_TCP, rv->mPool()); + status = apr_socket_create( + &socket, + APR_INET, + SOCK_STREAM, + APR_PROTO_TCP, + new_pool); } else if(DATAGRAM_UDP == type) { - status = apr_socket_create(&rv->mSocket, APR_INET, SOCK_DGRAM, APR_PROTO_UDP, rv->mPool()); + status = apr_socket_create( + &socket, + APR_INET, + SOCK_DGRAM, + APR_PROTO_UDP, + new_pool); } else { - rv.reset(); + if(new_pool) apr_pool_destroy(new_pool); return rv; } if(ll_apr_warn_status(status)) { - rv->mSocket = NULL; - rv.reset(); + if(new_pool) apr_pool_destroy(new_pool); return rv; } + rv = ptr_t(new LLSocket(socket, new_pool)); if(port > 0) { apr_sockaddr_t* sa = NULL; @@ -133,7 +152,7 @@ LLSocket::ptr_t LLSocket::create(EType type, U16 port) APR_UNSPEC, port, 0, - rv->mPool()); + new_pool); if(ll_apr_warn_status(status)) { rv.reset(); @@ -141,8 +160,8 @@ LLSocket::ptr_t LLSocket::create(EType type, U16 port) } // This allows us to reuse the address on quick down/up. This // is unlikely to create problems. - ll_apr_warn_status(apr_socket_opt_set(rv->mSocket, APR_SO_REUSEADDR, 1)); - status = apr_socket_bind(rv->mSocket, sa); + ll_apr_warn_status(apr_socket_opt_set(socket, APR_SO_REUSEADDR, 1)); + status = apr_socket_bind(socket, sa); if(ll_apr_warn_status(status)) { rv.reset(); @@ -156,7 +175,7 @@ LLSocket::ptr_t LLSocket::create(EType type, U16 port) // to keep a queue of incoming connections for ACCEPT. lldebugs << "Setting listen state for socket." << llendl; status = apr_socket_listen( - rv->mSocket, + socket, LL_DEFAULT_LISTEN_BACKLOG); if(ll_apr_warn_status(status)) { @@ -177,28 +196,21 @@ LLSocket::ptr_t LLSocket::create(EType type, U16 port) } // static -LLSocket::ptr_t LLSocket::create(apr_status_t& status, LLSocket::ptr_t& listen_socket) +LLSocket::ptr_t LLSocket::create(apr_socket_t* socket, apr_pool_t* pool) { LLMemType m1(LLMemType::MTYPE_IO_TCP); - if (!listen_socket->getSocket()) - { - status = APR_ENOSOCKET; - return LLSocket::ptr_t(); - } - LLSocket::ptr_t rv(new LLSocket); - lldebugs << "accepting socket" << llendl; - status = apr_socket_accept(&rv->mSocket, listen_socket->getSocket(), rv->mPool()); - if (status != APR_SUCCESS) + LLSocket::ptr_t rv; + if(!socket) { - rv->mSocket = NULL; - rv.reset(); return rv; } + rv = ptr_t(new LLSocket(socket, pool)); rv->mPort = PORT_EPHEMERAL; rv->setOptions(); return rv; } + bool LLSocket::blockingConnect(const LLHost& host) { if(!mSocket) return false; @@ -211,7 +223,7 @@ bool LLSocket::blockingConnect(const LLHost& host) APR_UNSPEC, host.getPort(), 0, - mPool()))) + mPool))) { return false; } @@ -222,11 +234,13 @@ bool LLSocket::blockingConnect(const LLHost& host) return true; } -LLSocket::LLSocket() : - mSocket(NULL), - mPool(LLThread::tldata().mRootPool), +LLSocket::LLSocket(apr_socket_t* socket, apr_pool_t* pool) : + mSocket(socket), + mPool(pool), mPort(PORT_INVALID) { + ll_debug_socket("Constructing wholely formed socket", mSocket); + LLMemType m1(LLMemType::MTYPE_IO_TCP); } LLSocket::~LLSocket() @@ -238,6 +252,10 @@ LLSocket::~LLSocket() ll_debug_socket("Destroying socket", mSocket); apr_socket_close(mSocket); } + if(mPool) + { + apr_pool_destroy(mPool); + } } void LLSocket::setOptions() @@ -498,8 +516,10 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl( /// LLIOServerSocket::LLIOServerSocket( + apr_pool_t* pool, LLIOServerSocket::socket_t listener, factory_t factory) : + mPool(pool), mListenSocket(listener), mReactor(factory), mInitialized(false), @@ -559,15 +579,21 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( lldebugs << "accepting socket" << llendl; PUMP_DEBUG; - apr_status_t status; - LLSocket::ptr_t llsocket(LLSocket::create(status, mListenSocket)); + apr_pool_t* new_pool = NULL; + apr_status_t status = apr_pool_create(&new_pool, mPool); + apr_socket_t* socket = NULL; + status = apr_socket_accept( + &socket, + mListenSocket->getSocket(), + new_pool); + LLSocket::ptr_t llsocket(LLSocket::create(socket, new_pool)); //EStatus rv = STATUS_ERROR; - if(llsocket && status == APR_SUCCESS) + if(llsocket) { PUMP_DEBUG; apr_sockaddr_t* remote_addr; - apr_socket_addr_get(&remote_addr, APR_REMOTE, llsocket->getSocket()); + apr_socket_addr_get(&remote_addr, APR_REMOTE, socket); char* remote_host_string; apr_sockaddr_ip_get(&remote_host_string, remote_addr); @@ -582,6 +608,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( { chain.push_back(LLIOPipe::ptr_t(new LLIOSocketWriter(llsocket))); pump->addChain(chain, mResponseTimeout); + status = STATUS_OK; } else { @@ -590,8 +617,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( } else { - char buf[256]; - llwarns << "Unable to accept linden socket: " << apr_strerror(status, buf, sizeof(buf)) << llendl; + llwarns << "Unable to create linden socket." << llendl; } PUMP_DEBUG; @@ -604,10 +630,11 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( #if 0 LLIODataSocket::LLIODataSocket( U16 suggested_port, - U16 start_discovery_port) : + U16 start_discovery_port, + apr_pool_t* pool) : mSocket(NULL) { - if(PORT_INVALID == suggested_port) return; + if(!pool || (PORT_INVALID == suggested_port)) return; if(ll_apr_warn_status(apr_socket_create(&mSocket, APR_INET, SOCK_DGRAM, APR_PROTO_UDP, pool))) return; apr_sockaddr_t* sa = NULL; if(ll_apr_warn_status(apr_sockaddr_info_get(&sa, APR_ANYADDR, APR_UNSPEC, suggested_port, 0, pool))) return; diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h index 1e35225512..6806e5084a 100644 --- a/indra/llmessage/lliosocket.h +++ b/indra/llmessage/lliosocket.h @@ -38,6 +38,7 @@ */ #include "lliopipe.h" +#include "apr_pools.h" #include "apr_network_io.h" #include "llchainio.h" @@ -87,22 +88,34 @@ public: * socket. If you intend the socket to be known to external * clients without prior port notification, do not use * PORT_EPHEMERAL. + * @param pool The apr pool to use. A child pool will be created + * and associated with the socket. * @param type The type of socket to create * @param port The port for the socket * @return A valid socket shared pointer if the call worked. */ static ptr_t create( + apr_pool_t* pool, EType type, U16 port = PORT_EPHEMERAL); /** - * @brief Create a LLSocket by accepting a connection from a listen socket. + * @brief Create a LLSocket when you already have an apr socket. * - * @param status Output. Status of the accept if a valid listen socket was passed. - * @param listen_socket The listen socket to use. + * This method assumes an ephemeral port. This is typically used + * by calls which spawn a socket such as a call to + * accept() as in the server socket. This call should + * not fail if you have a valid apr socket. + * Because of the nature of how accept() works, you are expected + * to create a new pool for the socket, use that pool for the + * accept, and pass it in here where it will be bound with the + * socket and destroyed at the same time. + * @param socket The apr socket to use + * @param pool The pool used to create the socket. *NOTE: The pool + * passed in will be DESTROYED. * @return A valid socket shared pointer if the call worked. */ - static ptr_t create(apr_status_t& status, ptr_t& listen_socket); + static ptr_t create(apr_socket_t* socket, apr_pool_t* pool); /** * @brief Perform a blocking connect to a host. Do not use in production. @@ -137,7 +150,7 @@ protected: * @brief Protected constructor since should only make sockets * with one of the two create() calls. */ - LLSocket(void); + LLSocket(apr_socket_t* socket, apr_pool_t* pool); /** * @brief Set default socket options. @@ -154,8 +167,8 @@ protected: // The apr socket. apr_socket_t* mSocket; - // Our memory pool. - LLAPRPool mPool; + // our memory pool + apr_pool_t* mPool; // The port if we know it. U16 mPort; @@ -280,7 +293,7 @@ class LLIOServerSocket : public LLIOPipe public: typedef LLSocket::ptr_t socket_t; typedef boost::shared_ptr factory_t; - LLIOServerSocket(socket_t listener, factory_t reactor); + LLIOServerSocket(apr_pool_t* pool, socket_t listener, factory_t reactor); virtual ~LLIOServerSocket(); /** @@ -312,6 +325,7 @@ protected: //@} protected: + apr_pool_t* mPool; socket_t mListenSocket; factory_t mReactor; bool mInitialized; @@ -345,7 +359,8 @@ public: */ LLIODataSocket( U16 suggested_port, - U16 start_discovery_port); + U16 start_discovery_port, + apr_pool_t* pool); virtual ~LLIODataSocket(); protected: diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp index 8a898ab1b0..08b31e9c7a 100644 --- a/indra/llmessage/llmail.cpp +++ b/indra/llmessage/llmail.cpp @@ -50,7 +50,6 @@ #include "llstring.h" #include "lluuid.h" #include "net.h" -#include "llaprpool.h" // // constants @@ -58,7 +57,7 @@ const size_t LL_MAX_KNOWN_GOOD_MAIL_SIZE = 4096; static bool gMailEnabled = true; -static LLAPRPool gMailPool; +static apr_pool_t* gMailPool; static apr_sockaddr_t* gSockAddr; static apr_socket_t* gMailSocket; @@ -83,7 +82,7 @@ bool connect_smtp() gSockAddr->sa.sin.sin_family, SOCK_STREAM, APR_PROTO_TCP, - gMailPool()); + gMailPool); if(ll_apr_warn_status(status)) return false; status = apr_socket_connect(gMailSocket, gSockAddr); if(ll_apr_warn_status(status)) @@ -140,19 +139,19 @@ BOOL LLMail::send( } // static -void LLMail::init(const std::string& hostname) +void LLMail::init(const std::string& hostname, apr_pool_t* pool) { gMailSocket = NULL; - if (hostname.empty()) + if(hostname.empty() || !pool) { + gMailPool = NULL; gSockAddr = NULL; - gMailPool.destroy(); } else { - gMailPool.create(); + gMailPool = pool; - // Collect all the information into a sockaddr structure. the + // collect all the information into a socaddr sturcture. the // documentation is a bit unclear, but I either have to // specify APR_UNSPEC or not specify any flags. I am not sure // which option is better. @@ -162,7 +161,7 @@ void LLMail::init(const std::string& hostname) APR_UNSPEC, 25, APR_IPV4_ADDR_OK, - gMailPool()); + gMailPool); ll_apr_warn_status(status); } } diff --git a/indra/llmessage/llmail.h b/indra/llmessage/llmail.h index 0a5c532088..3791714363 100644 --- a/indra/llmessage/llmail.h +++ b/indra/llmessage/llmail.h @@ -27,13 +27,15 @@ #ifndef LL_LLMAIL_H #define LL_LLMAIL_H +typedef struct apr_pool_t apr_pool_t; + #include "llsd.h" class LLMail { public: // if hostname is NULL, then the host is resolved as 'mail' - static void init(const std::string& hostname); + static void init(const std::string& hostname, apr_pool_t* pool); // Allow all email transmission to be disabled/enabled. static void enable(bool mail_enabled); diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 89cfd66e1b..a8d2a0a224 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -37,7 +37,6 @@ #include "llmemtype.h" #include "llstl.h" #include "llstat.h" -#include "llthread.h" // These should not be enabled in production, but they can be // intensely useful during development for finding certain kinds of @@ -163,12 +162,14 @@ struct ll_delete_apr_pollset_fd_client_data /** * LLPumpIO */ -LLPumpIO::LLPumpIO(void) : +LLPumpIO::LLPumpIO(apr_pool_t* pool) : mState(LLPumpIO::NORMAL), mRebuildPollset(false), mPollset(NULL), mPollsetClientID(0), mNextLock(0), + mPool(NULL), + mCurrentPool(NULL), mCurrentPoolReallocCount(0), mChainsMutex(NULL), mCallbackMutex(NULL), @@ -177,24 +178,21 @@ LLPumpIO::LLPumpIO(void) : mCurrentChain = mRunningChains.end(); LLMemType m1(LLMemType::MTYPE_IO_PUMP); - initialize(); + initialize(pool); } LLPumpIO::~LLPumpIO() { LLMemType m1(LLMemType::MTYPE_IO_PUMP); -#if LL_THREADS_APR - if (mChainsMutex) apr_thread_mutex_destroy(mChainsMutex); - if (mCallbackMutex) apr_thread_mutex_destroy(mCallbackMutex); -#endif - mChainsMutex = NULL; - mCallbackMutex = NULL; - if(mPollset) - { -// lldebugs << "cleaning up pollset" << llendl; - apr_pollset_destroy(mPollset); - mPollset = NULL; - } + cleanup(); +} + +bool LLPumpIO::prime(apr_pool_t* pool) +{ + LLMemType m1(LLMemType::MTYPE_IO_PUMP); + cleanup(); + initialize(pool); + return ((pool == NULL) ? false : true); } bool LLPumpIO::addChain(const chain_t& chain, F32 timeout) @@ -354,7 +352,8 @@ bool LLPumpIO::setConditional(LLIOPipe* pipe, const apr_pollfd_t* poll) { // each fd needs a pool to work with, so if one was // not specified, use this pool. - value.second.p = (*mCurrentChain).mDescriptorsPool->operator()(); + // *FIX: Should it always be this pool? + value.second.p = mPool; } value.second.client_data = new S32(++mPollsetClientID); (*mCurrentChain).mDescriptors.push_back(value); @@ -826,15 +825,39 @@ void LLPumpIO::control(LLPumpIO::EControl op) } } -void LLPumpIO::initialize(void) +void LLPumpIO::initialize(apr_pool_t* pool) { LLMemType m1(LLMemType::MTYPE_IO_PUMP); - mPool.create(); + if(!pool) return; #if LL_THREADS_APR // SJB: Windows defaults to NESTED and OSX defaults to UNNESTED, so use UNNESTED explicitly. - apr_thread_mutex_create(&mChainsMutex, APR_THREAD_MUTEX_UNNESTED, mPool()); - apr_thread_mutex_create(&mCallbackMutex, APR_THREAD_MUTEX_UNNESTED, mPool()); + apr_thread_mutex_create(&mChainsMutex, APR_THREAD_MUTEX_UNNESTED, pool); + apr_thread_mutex_create(&mCallbackMutex, APR_THREAD_MUTEX_UNNESTED, pool); +#endif + mPool = pool; +} + +void LLPumpIO::cleanup() +{ + LLMemType m1(LLMemType::MTYPE_IO_PUMP); +#if LL_THREADS_APR + if(mChainsMutex) apr_thread_mutex_destroy(mChainsMutex); + if(mCallbackMutex) apr_thread_mutex_destroy(mCallbackMutex); #endif + mChainsMutex = NULL; + mCallbackMutex = NULL; + if(mPollset) + { +// lldebugs << "cleaning up pollset" << llendl; + apr_pollset_destroy(mPollset); + mPollset = NULL; + } + if(mCurrentPool) + { + apr_pool_destroy(mCurrentPool); + mCurrentPool = NULL; + } + mPool = NULL; } void LLPumpIO::rebuildPollset() @@ -862,19 +885,21 @@ void LLPumpIO::rebuildPollset() if(mCurrentPool && (0 == (++mCurrentPoolReallocCount % POLLSET_POOL_RECYCLE_COUNT))) { - mCurrentPool.destroy(); + apr_pool_destroy(mCurrentPool); + mCurrentPool = NULL; mCurrentPoolReallocCount = 0; } if(!mCurrentPool) { - mCurrentPool.create(mPool); + apr_status_t status = apr_pool_create(&mCurrentPool, mPool); + (void)ll_apr_warn_status(status); } // add all of the file descriptors run_it = mRunningChains.begin(); LLChainInfo::conditionals_t::iterator fd_it; LLChainInfo::conditionals_t::iterator fd_end; - apr_pollset_create(&mPollset, size, mCurrentPool(), 0); + apr_pollset_create(&mPollset, size, mCurrentPool, 0); for(; run_it != run_end; ++run_it) { fd_it = (*run_it).mDescriptors.begin(); @@ -1132,8 +1157,7 @@ bool LLPumpIO::handleChainError( LLPumpIO::LLChainInfo::LLChainInfo() : mInit(false), mLock(0), - mEOS(false), - mDescriptorsPool(new LLAPRPool(LLThread::tldata().mRootPool)) + mEOS(false) { LLMemType m1(LLMemType::MTYPE_IO_PUMP); mTimer.setTimerExpirySec(DEFAULT_CHAIN_EXPIRY_SECS); diff --git a/indra/llmessage/llpumpio.h b/indra/llmessage/llpumpio.h index 75c35ae7ab..9303c9d7fc 100644 --- a/indra/llmessage/llpumpio.h +++ b/indra/llmessage/llpumpio.h @@ -30,12 +30,11 @@ #define LL_LLPUMPIO_H #include -#include #if LL_LINUX // needed for PATH_MAX in APR. #include #endif -#include "llaprpool.h" +#include "apr_pools.h" #include "llbuffer.h" #include "llframetimer.h" #include "lliopipe.h" @@ -59,8 +58,9 @@ extern const F32 NEVER_CHAIN_EXPIRY_SECS; * pump() on a thread used for IO and call * respond() on a thread that is expected to do higher * level processing. You can call almost any other method from any - * thread - see notes for each method for details. - * + * thread - see notes for each method for details. In order for the + * threading abstraction to work, you need to call prime() + * with a valid apr pool. * A pump instance manages much of the state for the pipe, including * the list of pipes in the chain, the channel for each element in the * chain, the buffer, and if any pipe has marked the stream or process @@ -79,13 +79,24 @@ public: /** * @brief Constructor. */ - LLPumpIO(void); + LLPumpIO(apr_pool_t* pool); /** * @brief Destructor. */ ~LLPumpIO(); + /** + * @brief Prepare this pump for usage. + * + * If you fail to call this method prior to use, the pump will + * try to work, but will not come with any thread locking + * mechanisms. + * @param pool The apr pool to use. + * @return Returns true if the pump is primed. + */ + bool prime(apr_pool_t* pool); + /** * @brief Typedef for having a chain of pipes. */ @@ -357,7 +368,6 @@ protected: typedef std::pair pipe_conditional_t; typedef std::vector conditionals_t; conditionals_t mDescriptors; - boost::shared_ptr mDescriptorsPool; }; // All the running chains & info @@ -376,9 +386,9 @@ protected: callbacks_t mPendingCallbacks; callbacks_t mCallbacks; - // Memory pool for pollsets & mutexes. - LLAPRPool mPool; - LLAPRPool mCurrentPool; + // memory allocator for pollsets & mutexes. + apr_pool_t* mPool; + apr_pool_t* mCurrentPool; S32 mCurrentPoolReallocCount; #if LL_THREADS_APR @@ -390,7 +400,8 @@ protected: #endif protected: - void initialize(); + void initialize(apr_pool_t* pool); + void cleanup(); /** * @brief Given the internal state of the chains, rebuild the pollset diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 83b6f7cf71..cb9d1c3731 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -40,7 +40,6 @@ #include "llstring.h" #include "apr_env.h" #include "llapr.h" -#include "llscopedvolatileaprpool.h" static const U32 HTTP_STATUS_PIPE_ERROR = 499; /** @@ -211,31 +210,27 @@ void LLURLRequest::setCallback(LLURLRequestComplete* callback) // is called with use_proxy = FALSE void LLURLRequest::useProxy(bool use_proxy) { - static std::string env_proxy; + static char *env_proxy; - if (use_proxy && env_proxy.empty()) + if (use_proxy && (env_proxy == NULL)) { - char* env_proxy_str; - LLScopedVolatileAPRPool scoped_pool; - apr_status_t status = apr_env_get(&env_proxy_str, "ALL_PROXY", scoped_pool); + apr_status_t status; + LLAPRPool pool; + status = apr_env_get(&env_proxy, "ALL_PROXY", pool.getAPRPool()); if (status != APR_SUCCESS) { - status = apr_env_get(&env_proxy_str, "http_proxy", scoped_pool); + status = apr_env_get(&env_proxy, "http_proxy", pool.getAPRPool()); } if (status != APR_SUCCESS) { - use_proxy = false; + use_proxy = FALSE; } - else - { - // env_proxy_str is stored in the scoped_pool, so we have to make a copy. - env_proxy = env_proxy_str; - } } - lldebugs << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = \"" << env_proxy << "\"" << llendl; - if (use_proxy) + lldebugs << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = " << (env_proxy ? env_proxy : "(null)") << llendl; + + if (env_proxy && use_proxy) { mDetail->mCurlRequest->setoptString(CURLOPT_PROXY, env_proxy); } diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 302cfc7ca2..2f0d815be5 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -97,10 +97,8 @@ std::string get_shared_secret(); class LLMessagePollInfo { public: - LLMessagePollInfo(void) : mPool(LLThread::tldata().mRootPool) { } apr_socket_t *mAPRSocketp; apr_pollfd_t mPollFD; - LLAPRPool mPool; }; namespace @@ -289,13 +287,20 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port, } // LL_DEBUGS("Messaging") << << "*** port: " << mPort << llendl; - mPollInfop = new LLMessagePollInfo; - + // + // Create the data structure that we can poll on + // + if (!gAPRPoolp) + { + LL_ERRS("Messaging") << "No APR pool before message system initialization!" << llendl; + ll_init_apr(); + } apr_socket_t *aprSocketp = NULL; - apr_os_sock_put(&aprSocketp, (apr_os_sock_t*)&mSocket, mPollInfop->mPool()); + apr_os_sock_put(&aprSocketp, (apr_os_sock_t*)&mSocket, gAPRPoolp); + mPollInfop = new LLMessagePollInfo; mPollInfop->mAPRSocketp = aprSocketp; - mPollInfop->mPollFD.p = mPollInfop->mPool(); + mPollInfop->mPollFD.p = gAPRPoolp; mPollInfop->mPollFD.desc_type = APR_POLL_SOCKET; mPollInfop->mPollFD.reqevents = APR_POLLIN; mPollInfop->mPollFD.rtnevents = 0; diff --git a/indra/llmessage/tests/networkio.h b/indra/llmessage/tests/networkio.h index 23e1c791f4..2aff90ca1e 100644 --- a/indra/llmessage/tests/networkio.h +++ b/indra/llmessage/tests/networkio.h @@ -30,6 +30,7 @@ #define LL_NETWORKIO_H #include "llmemory.h" // LLSingleton +#include "llapr.h" #include "llares.h" #include "llpumpio.h" #include "llhttpclient.h" @@ -47,8 +48,14 @@ public: mServicePump(NULL), mDone(false) { + ll_init_apr(); + if (! gAPRPoolp) + { + throw std::runtime_error("Can't initialize APR"); + } + // Create IO Pump to use for HTTP Requests. - mServicePump = new LLPumpIO; + mServicePump = new LLPumpIO(gAPRPoolp); LLHTTPClient::setPump(*mServicePump); if (ll_init_ares() == NULL || !gAres->isInitialized()) { diff --git a/indra/llplugin/llplugininstance.cpp b/indra/llplugin/llplugininstance.cpp index 9c9909a017..c326961db4 100644 --- a/indra/llplugin/llplugininstance.cpp +++ b/indra/llplugin/llplugininstance.cpp @@ -29,7 +29,8 @@ #include "linden_common.h" #include "llplugininstance.h" -#include "llthread.h" // Needed for LLThread::tldata().mRootPool + +#include "llapr.h" /** Virtual destructor. */ LLPluginInstanceMessageListener::~LLPluginInstanceMessageListener() @@ -47,7 +48,6 @@ const char *LLPluginInstance::PLUGIN_INIT_FUNCTION_NAME = "LLPluginInitEntryPoin * @param[in] owner Plugin instance. TODO:DOC is this a good description of what "owner" is? */ LLPluginInstance::LLPluginInstance(LLPluginInstanceMessageListener *owner) : - mDSOHandlePool(LLThread::tldata().mRootPool), mDSOHandle(NULL), mPluginUserData(NULL), mPluginSendMessageFunction(NULL) @@ -79,7 +79,7 @@ int LLPluginInstance::load(std::string &plugin_file) int result = apr_dso_load(&mDSOHandle, plugin_file.c_str(), - mDSOHandlePool()); + gAPRPoolp); if(result != APR_SUCCESS) { char buf[1024]; diff --git a/indra/llplugin/llplugininstance.h b/indra/llplugin/llplugininstance.h index 1c3898e2e7..50531ca77f 100644 --- a/indra/llplugin/llplugininstance.h +++ b/indra/llplugin/llplugininstance.h @@ -30,7 +30,6 @@ #include "llstring.h" #include "llapr.h" -#include "llaprpool.h" #include "apr_dso.h" @@ -89,7 +88,6 @@ private: static void staticReceiveMessage(const char *message_string, void **user_data); void receiveMessage(const char *message_string); - LLAPRPool mDSOHandlePool; apr_dso_handle_t *mDSOHandle; void *mPluginUserData; diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp index dd47300b9c..8d13e38ad5 100644 --- a/indra/llplugin/llpluginmessagepipe.cpp +++ b/indra/llplugin/llpluginmessagepipe.cpp @@ -92,6 +92,8 @@ void LLPluginMessagePipeOwner::killMessagePipe(void) } LLPluginMessagePipe::LLPluginMessagePipe(LLPluginMessagePipeOwner *owner, LLSocket::ptr_t socket): + mInputMutex(gAPRPoolp), + mOutputMutex(gAPRPoolp), mOwner(owner), mSocket(socket) { diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index 2fa5dcdd01..45a86476ac 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -40,7 +40,7 @@ LLPluginProcessChild::LLPluginProcessChild() { mState = STATE_UNINITIALIZED; mInstance = NULL; - mSocket = LLSocket::create(LLSocket::STREAM_TCP); + mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); mSleepTime = PLUGIN_IDLE_SECONDS; // default: send idle messages at 100Hz mCPUElapsed = 0.0f; mBlockingRequest = false; diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index eaf7ec4bf3..c002de0462 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -33,7 +33,6 @@ #include "llpluginmessageclasses.h" #include "llapr.h" -#include "llscopedvolatileaprpool.h" //virtual LLPluginProcessParentOwner::~LLPluginProcessParentOwner() @@ -43,7 +42,6 @@ LLPluginProcessParentOwner::~LLPluginProcessParentOwner() bool LLPluginProcessParent::sUseReadThread = false; apr_pollset_t *LLPluginProcessParent::sPollSet = NULL; -LLAPRPool LLPluginProcessParent::sPollSetPool; bool LLPluginProcessParent::sPollsetNeedsRebuild = false; LLMutex *LLPluginProcessParent::sInstancesMutex; std::list LLPluginProcessParent::sInstances; @@ -54,7 +52,7 @@ class LLPluginProcessParentPollThread: public LLThread { public: LLPluginProcessParentPollThread() : - LLThread("LLPluginProcessParentPollThread") + LLThread("LLPluginProcessParentPollThread", gAPRPoolp) { } protected: @@ -79,11 +77,12 @@ protected: }; -LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner* owner) +LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner): + mIncomingQueueMutex(gAPRPoolp) { if(!sInstancesMutex) { - sInstancesMutex = new LLMutex; + sInstancesMutex = new LLMutex(gAPRPoolp); } mOwner = owner; @@ -96,7 +95,6 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner* owner) mBlocked = false; mPolledInput = false; mPollFD.client_data = NULL; - mPollFDPool.create(); mPluginLaunchTimeout = 60.0f; mPluginLockupTimeout = 15.0f; @@ -171,28 +169,44 @@ void LLPluginProcessParent::init(const std::string &launcher_filename, const std bool LLPluginProcessParent::accept() { bool result = false; + apr_status_t status = APR_EGENERAL; + apr_socket_t *new_socket = NULL; + + status = apr_socket_accept( + &new_socket, + mListenSocket->getSocket(), + gAPRPoolp); - mSocket = LLSocket::create(status, mListenSocket); if(status == APR_SUCCESS) { // llinfos << "SUCCESS" << llendl; // Success. Create a message pipe on the new socket + + // we MUST create a new pool for the LLSocket, since it will take ownership of it and delete it in its destructor! + apr_pool_t* new_pool = NULL; + status = apr_pool_create(&new_pool, gAPRPoolp); + + mSocket = LLSocket::create(new_socket, new_pool); new LLPluginMessagePipe(this, mSocket); result = true; } + else if(APR_STATUS_IS_EAGAIN(status)) + { +// llinfos << "EAGAIN" << llendl; + + // No incoming connections. This is not an error. + status = APR_SUCCESS; + } else { - mSocket.reset(); - // EAGAIN means "No incoming connections". This is not an error. - if (!APR_STATUS_IS_EAGAIN(status)) - { - // Some other error. - ll_apr_warn_status(status); - errorState(); - } +// llinfos << "Error:" << llendl; + ll_apr_warn_status(status); + + // Some other error. + errorState(); } return result; @@ -258,10 +272,10 @@ void LLPluginProcessParent::idle(void) case STATE_INITIALIZED: { + apr_status_t status = APR_SUCCESS; - LLScopedVolatileAPRPool addr_pool; apr_sockaddr_t* addr = NULL; - mListenSocket = LLSocket::create(LLSocket::STREAM_TCP); + mListenSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); mBoundPort = 0; // This code is based on parts of LLSocket::create() in lliosocket.cpp. @@ -272,7 +286,7 @@ void LLPluginProcessParent::idle(void) APR_INET, 0, // port 0 = ephemeral ("find me a port") 0, - addr_pool); + gAPRPoolp); if(ll_apr_warn_status(status)) { @@ -584,7 +598,7 @@ void LLPluginProcessParent::setMessagePipe(LLPluginMessagePipe *message_pipe) if(message_pipe != NULL) { // Set up the apr_pollfd_t - mPollFD.p = mPollFDPool(); + mPollFD.p = gAPRPoolp; mPollFD.desc_type = APR_POLL_SOCKET; mPollFD.reqevents = APR_POLLIN|APR_POLLERR|APR_POLLHUP; mPollFD.rtnevents = 0; @@ -631,7 +645,6 @@ void LLPluginProcessParent::updatePollset() // delete the existing pollset. apr_pollset_destroy(sPollSet); sPollSet = NULL; - sPollSetPool.destroy(); } std::list::iterator iter; @@ -654,14 +667,12 @@ void LLPluginProcessParent::updatePollset() { #ifdef APR_POLLSET_NOCOPY // The pollset doesn't exist yet. Create it now. - sPollSetPool.create(); - apr_status_t status = apr_pollset_create(&sPollSet, count, sPollSetPool(), APR_POLLSET_NOCOPY); + apr_status_t status = apr_pollset_create(&sPollSet, count, gAPRPoolp, APR_POLLSET_NOCOPY); if(status != APR_SUCCESS) { #endif // APR_POLLSET_NOCOPY LL_WARNS("PluginPoll") << "Couldn't create pollset. Falling back to non-pollset mode." << LL_ENDL; sPollSet = NULL; - sPollSetPool.destroy(); #ifdef APR_POLLSET_NOCOPY } else diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 6beeb64c7e..32394809ef 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -176,9 +176,7 @@ private: static bool sUseReadThread; apr_pollfd_t mPollFD; - LLAPRPool mPollFDPool; static apr_pollset_t *sPollSet; - static LLAPRPool sPollSetPool; static bool sPollsetNeedsRebuild; static LLMutex *sInstancesMutex; static std::list sInstances; diff --git a/indra/llplugin/llpluginsharedmemory.cpp b/indra/llplugin/llpluginsharedmemory.cpp index e2ff645a9c..63ff5085c6 100644 --- a/indra/llplugin/llpluginsharedmemory.cpp +++ b/indra/llplugin/llpluginsharedmemory.cpp @@ -187,8 +187,7 @@ bool LLPluginSharedMemory::create(size_t size) mName += createName(); mSize = size; - mPool.create(); - apr_status_t status = apr_shm_create( &(mImpl->mAprSharedMemory), mSize, mName.c_str(), mPool()); + apr_status_t status = apr_shm_create( &(mImpl->mAprSharedMemory), mSize, mName.c_str(), gAPRPoolp ); if(ll_apr_warn_status(status)) { @@ -211,7 +210,7 @@ bool LLPluginSharedMemory::destroy(void) } mImpl->mAprSharedMemory = NULL; } - mPool.destroy(); + return true; } @@ -220,8 +219,7 @@ bool LLPluginSharedMemory::attach(const std::string &name, size_t size) mName = name; mSize = size; - mPool.create(); - apr_status_t status = apr_shm_attach( &(mImpl->mAprSharedMemory), mName.c_str(), mPool() ); + apr_status_t status = apr_shm_attach( &(mImpl->mAprSharedMemory), mName.c_str(), gAPRPoolp ); if(ll_apr_warn_status(status)) { @@ -243,7 +241,6 @@ bool LLPluginSharedMemory::detach(void) } mImpl->mAprSharedMemory = NULL; } - mPool.destroy(); return true; } diff --git a/indra/llplugin/llpluginsharedmemory.h b/indra/llplugin/llpluginsharedmemory.h index 84b7a58c32..c6cd49cabb 100644 --- a/indra/llplugin/llpluginsharedmemory.h +++ b/indra/llplugin/llpluginsharedmemory.h @@ -28,8 +28,6 @@ #ifndef LL_LLPLUGINSHAREDMEMORY_H #define LL_LLPLUGINSHAREDMEMORY_H -#include "llaprpool.h" - class LLPluginSharedMemoryPlatformImpl; /** @@ -110,7 +108,6 @@ private: bool close(void); bool unlink(void); - LLAPRPool mPool; std::string mName; size_t mSize; void *mMappedAddress; diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index ff86e4e135..516a58db88 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -176,6 +176,8 @@ int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL int main(int argc, char **argv) #endif { + ll_init_apr(); + // Set up llerror logging { LLError::initForApplication("."); @@ -391,6 +393,8 @@ int main(int argc, char **argv) delete plugin; + ll_cleanup_apr(); + return 0; } diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp index bf49b9668e..3d3ed9f6d4 100644 --- a/indra/llvfs/lllfsthread.cpp +++ b/indra/llvfs/lllfsthread.cpp @@ -67,6 +67,10 @@ LLLFSThread::LLLFSThread(bool threaded) : LLQueuedThread("LFS", threaded), mPriorityCounter(PRIORITY_LOWBITS) { + if(!mLocalAPRFilePoolp) + { + mLocalAPRFilePoolp = new LLVolatileAPRPool() ; + } } LLLFSThread::~LLLFSThread() @@ -178,7 +182,8 @@ bool LLLFSThread::Request::processRequest() if (mOperation == FILE_READ) { llassert(mOffset >= 0); - LLAPRFile infile(mFileName, LL_APR_RB); + LLAPRFile infile ; // auto-closes + infile.open(mFileName, LL_APR_RB, mThread->getLocalAPRFilePool()); if (!infile.getFileHandle()) { llwarns << "LLLFS: Unable to read file: " << mFileName << llendl; @@ -200,7 +205,8 @@ bool LLLFSThread::Request::processRequest() apr_int32_t flags = APR_CREATE|APR_WRITE|APR_BINARY; if (mOffset < 0) flags |= APR_APPEND; - LLAPRFile outfile(mFileName, flags); + LLAPRFile outfile ; // auto-closes + outfile.open(mFileName, flags, mThread->getLocalAPRFilePool()); if (!outfile.getFileHandle()) { llwarns << "LLLFS: Unable to write file: " << mFileName << llendl; diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp index 1a64623028..c1fe21c57d 100644 --- a/indra/llvfs/llvfs.cpp +++ b/indra/llvfs/llvfs.cpp @@ -234,7 +234,7 @@ LLVFS::LLVFS(const std::string& index_filename, const std::string& data_filename mDataFP(NULL), mIndexFP(NULL) { - mDataMutex = new LLMutex; + mDataMutex = new LLMutex(0); S32 i; for (i = 0; i < VFSLOCK_COUNT; i++) @@ -2094,7 +2094,8 @@ void LLVFS::dumpFiles() std::string filename = id.asString() + extension; llinfos << " Writing " << filename << llendl; - LLAPRFile outfile(filename, LL_APR_WB); + LLAPRFile outfile; + outfile.open(filename, LL_APR_WB); outfile.write(&buffer[0], size); outfile.close(); diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h index 77d6d19663..6bc272c009 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h +++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamer.h @@ -37,6 +37,7 @@ extern "C" { #include #include +#include "apr_pools.h" #include "apr_dso.h" } diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp index 93a10424dd..2e4baaa9eb 100644 --- a/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp +++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp @@ -28,18 +28,16 @@ #if LL_GSTREAMER010_ENABLED -#include "linden_common.h" - #include extern "C" { #include +#include "apr_pools.h" #include "apr_dso.h" } #include "llmediaimplgstreamertriviallogging.h" -#include "llaprpool.h" #define LL_GST_SYM(REQ, GSTSYM, RTN, ...) RTN (*ll##GSTSYM)(__VA_ARGS__) = NULL #include "llmediaimplgstreamer_syms_raw.inc" @@ -58,7 +56,7 @@ void ll_gst_debug_register_funcptr(GstDebugFuncPtr func, gchar* ptrname) } static bool sSymsGrabbed = false; -static LLAPRPool sSymGSTDSOMemoryPool; +static apr_pool_t *sSymGSTDSOMemoryPool = NULL; static apr_dso_handle_t *sSymGSTDSOHandleG = NULL; static apr_dso_handle_t *sSymGSTDSOHandleV = NULL; @@ -80,11 +78,11 @@ bool grab_gst_syms(std::string gst_dso_name, #define LL_GST_SYM(REQ, GSTSYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##GSTSYM, sSymGSTDSOHandle, #GSTSYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #GSTSYM); if (REQ) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #GSTSYM, (void*)ll##GSTSYM);}while(0) //attempt to load the shared libraries - sSymGSTDSOMemoryPool.create(); + apr_pool_create(&sSymGSTDSOMemoryPool, NULL); if ( APR_SUCCESS == (rv = apr_dso_load(&sSymGSTDSOHandle, gst_dso_name.c_str(), - sSymGSTDSOMemoryPool()) )) + sSymGSTDSOMemoryPool) )) { INFOMSG("Found DSO: %s", gst_dso_name.c_str()); #include "llmediaimplgstreamer_syms_raw.inc" @@ -98,7 +96,7 @@ bool grab_gst_syms(std::string gst_dso_name, if ( APR_SUCCESS == (rv = apr_dso_load(&sSymGSTDSOHandle, gst_dso_name_vid.c_str(), - sSymGSTDSOMemoryPool()) )) + sSymGSTDSOMemoryPool) )) { INFOMSG("Found DSO: %s", gst_dso_name_vid.c_str()); #include "llmediaimplgstreamer_syms_rawv.inc" @@ -152,7 +150,8 @@ void ungrab_gst_syms() if ( sSymGSTDSOMemoryPool ) { - sSymGSTDSOMemoryPool.destroy(); + apr_pool_destroy(sSymGSTDSOMemoryPool); + sSymGSTDSOMemoryPool = NULL; } // NULL-out all of the symbols we'd grabbed diff --git a/indra/media_plugins/webkit/linux_volume_catcher.cpp b/indra/media_plugins/webkit/linux_volume_catcher.cpp index 94dfd80700..91be3a89e9 100644 --- a/indra/media_plugins/webkit/linux_volume_catcher.cpp +++ b/indra/media_plugins/webkit/linux_volume_catcher.cpp @@ -65,7 +65,7 @@ extern "C" { #undef LL_PA_SYM static bool sSymsGrabbed = false; -static LLAPRPool sSymPADSOMemoryPool; +static apr_pool_t *sSymPADSOMemoryPool = NULL; static apr_dso_handle_t *sSymPADSOHandleG = NULL; bool grab_pa_syms(std::string pulse_dso_name) @@ -84,11 +84,11 @@ bool grab_pa_syms(std::string pulse_dso_name) #define LL_PA_SYM(REQUIRED, PASYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##PASYM, sSymPADSOHandle, #PASYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #PASYM); if (REQUIRED) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #PASYM, (void*)ll##PASYM);}while(0) //attempt to load the shared library - sSymPADSOMemoryPool.create(); + apr_pool_create(&sSymPADSOMemoryPool, NULL); if ( APR_SUCCESS == (rv = apr_dso_load(&sSymPADSOHandle, pulse_dso_name.c_str(), - sSymPADSOMemoryPool()) )) + sSymPADSOMemoryPool) )) { INFOMSG("Found DSO: %s", pulse_dso_name.c_str()); @@ -130,8 +130,12 @@ void ungrab_pa_syms() apr_dso_unload(sSymPADSOHandleG); sSymPADSOHandleG = NULL; } - - sSymPADSOMemoryPool.destroy(); + + if ( sSymPADSOMemoryPool ) + { + apr_pool_destroy(sSymPADSOMemoryPool); + sSymPADSOMemoryPool = NULL; + } // NULL-out all of the symbols we'd grabbed #define LL_PA_SYM(REQUIRED, PASYM, RTN, ...) do{ll##PASYM = NULL;}while(0) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1f76e2af40..a23f809b71 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1026,7 +1026,7 @@ bool LLAppViewer::mainLoop() //------------------------------------------- // Create IO Pump to use for HTTP Requests. - gServicePump = new LLPumpIO; + gServicePump = new LLPumpIO(gAPRPoolp); LLHTTPClient::setPump(*gServicePump); LLCurl::setCAFile(gDirUtilp->getCAFile()); @@ -1387,16 +1387,16 @@ bool LLAppViewer::cleanup() } // *TODO - generalize this and move DSO wrangling to a helper class -brad - for(std::map >::iterator plugin = mPlugins.begin(); - plugin != mPlugins.end(); ++plugin) + std::set::const_iterator i; + for(i = mPlugins.begin(); i != mPlugins.end(); ++i) { int (*ll_plugin_stop_func)(void) = NULL; - apr_status_t rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_stop_func, plugin->first, "ll_plugin_stop"); + apr_status_t rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_stop_func, *i, "ll_plugin_stop"); ll_plugin_stop_func(); - rv = apr_dso_unload(plugin->first); + rv = apr_dso_unload(*i); } - mPlugins.clear(); // Forget handles and destroy all memory pools. + mPlugins.clear(); //flag all elements as needing to be destroyed immediately // to ensure shutdown order @@ -1828,7 +1828,7 @@ bool LLAppViewer::initThreads() if (LLFastTimer::sLog || LLFastTimer::sMetricLog) { - LLFastTimer::sLogLock = new LLMutex; + LLFastTimer::sLogLock = new LLMutex(NULL); mFastTimerLogThread = new LLFastTimerLogThread(LLFastTimer::sLogName); mFastTimerLogThread->start(); } @@ -2969,7 +2969,8 @@ void LLAppViewer::handleViewerCrash() else crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,ERROR_MARKER_FILE_NAME); llinfos << "Creating crash marker file " << crash_file_name << llendl; - LLAPRFile crash_file(crash_file_name, LL_APR_W); + LLAPRFile crash_file ; + crash_file.open(crash_file_name, LL_APR_W); if (crash_file.getFileHandle()) { LL_INFOS("MarkerFile") << "Created crash marker file " << crash_file_name << LL_ENDL; @@ -3033,10 +3034,11 @@ bool LLAppViewer::anotherInstanceRunning() LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL; //Freeze case checks - if (LLAPRFile::isExist(marker_file, LL_APR_RB)) + if (LLAPRFile::isExist(marker_file, NULL, LL_APR_RB)) { // File exists, try opening with write permissions - LLAPRFile outfile(marker_file, LL_APR_WB); + LLAPRFile outfile ; + outfile.open(marker_file, LL_APR_WB); apr_file_t* fMarker = outfile.getFileHandle() ; if (!fMarker) { @@ -3075,25 +3077,25 @@ void LLAppViewer::initMarkerFile() std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME); std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME); - if (LLAPRFile::isExist(mMarkerFileName, LL_APR_RB) && !anotherInstanceRunning()) + if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB) && !anotherInstanceRunning()) { gLastExecEvent = LAST_EXEC_FROZE; LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL; } - if(LLAPRFile::isExist(logout_marker_file, LL_APR_RB)) + if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB)) { gLastExecEvent = LAST_EXEC_LOGOUT_FROZE; LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; LLAPRFile::remove(logout_marker_file); } - if(LLAPRFile::isExist(llerror_marker_file, LL_APR_RB)) + if(LLAPRFile::isExist(llerror_marker_file, NULL, LL_APR_RB)) { if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; else gLastExecEvent = LAST_EXEC_LLERROR_CRASH; LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; LLAPRFile::remove(llerror_marker_file); } - if(LLAPRFile::isExist(error_marker_file, LL_APR_RB)) + if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) { if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; else gLastExecEvent = LAST_EXEC_OTHER_CRASH; @@ -3109,7 +3111,7 @@ void LLAppViewer::initMarkerFile() // Create the marker file for this execution & lock it apr_status_t s; - s = mMarkerFile.open(mMarkerFileName, LL_APR_W, LLAPRFile::long_lived); + s = mMarkerFile.open(mMarkerFileName, LL_APR_W, TRUE); if (s == APR_SUCCESS && mMarkerFile.getFileHandle()) { @@ -4325,7 +4327,8 @@ void LLAppViewer::sendLogoutRequest() gLogoutInProgress = TRUE; mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME); - LLAPRFile outfile(mLogoutMarkerFileName, LL_APR_W); + LLAPRFile outfile ; + outfile.open(mLogoutMarkerFileName, LL_APR_W); mLogoutMarkerFile = outfile.getFileHandle() ; if (mLogoutMarkerFile) { @@ -4775,15 +4778,14 @@ void LLAppViewer::loadEventHostModule(S32 listen_port) } #endif // LL_WINDOWS - boost::shared_ptr eventhost_dso_memory_pool_ptr(new LLAPRPool); - LLAPRPool& eventhost_dso_memory_pool(*eventhost_dso_memory_pool_ptr); - apr_dso_handle_t* eventhost_dso_handle = NULL; + apr_dso_handle_t * eventhost_dso_handle = NULL; + apr_pool_t * eventhost_dso_memory_pool = NULL; //attempt to load the shared library - eventhost_dso_memory_pool.create(); + apr_pool_create(&eventhost_dso_memory_pool, NULL); apr_status_t rv = apr_dso_load(&eventhost_dso_handle, dso_path.c_str(), - eventhost_dso_memory_pool()); + eventhost_dso_memory_pool); llassert_always(! ll_apr_warn_status(rv, eventhost_dso_handle)); llassert_always(eventhost_dso_handle != NULL); @@ -4803,8 +4805,7 @@ void LLAppViewer::loadEventHostModule(S32 listen_port) llerrs << "problem loading eventhost plugin, status: " << status << llendl; } - // Store the handle and link it to the pool that was used to allocate it. - mPlugins[eventhost_dso_handle] = eventhost_dso_memory_pool_ptr; + mPlugins.insert(eventhost_dso_handle); } void LLAppViewer::launchUpdater() diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 00b12d50ae..a18e6cbb02 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -266,7 +266,7 @@ private: LLAllocator mAlloc; - std::map > mPlugins; + std::set mPlugins; U32 mAvailPhysicalMemInKB ; U32 mAvailVirtualMemInKB ; diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index d4c6131c80..898cc1c0ba 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -110,7 +110,6 @@ int main( int argc, char **argv ) } delete viewer_app_ptr; viewer_app_ptr = NULL; - return 0; } diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp index 1ae469dfcf..32e7e0a83d 100644 --- a/indra/newview/llappviewerlinux_api_dbus.cpp +++ b/indra/newview/llappviewerlinux_api_dbus.cpp @@ -27,11 +27,11 @@ #if LL_DBUS_ENABLED #include "linden_common.h" -#include "llaprpool.h" extern "C" { #include +#include "apr_pools.h" #include "apr_dso.h" } @@ -44,7 +44,7 @@ extern "C" { #undef LL_DBUS_SYM static bool sSymsGrabbed = false; -static LLAPRPool sSymDBUSDSOMemoryPool; +static apr_pool_t *sSymDBUSDSOMemoryPool = NULL; static apr_dso_handle_t *sSymDBUSDSOHandleG = NULL; bool grab_dbus_syms(std::string dbus_dso_name) @@ -63,11 +63,11 @@ bool grab_dbus_syms(std::string dbus_dso_name) #define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##DBUSSYM, sSymDBUSDSOHandle, #DBUSSYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #DBUSSYM); if (REQUIRED) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #DBUSSYM, (void*)ll##DBUSSYM);}while(0) //attempt to load the shared library - sSymDBUSDSOMemoryPool.create(); + apr_pool_create(&sSymDBUSDSOMemoryPool, NULL); if ( APR_SUCCESS == (rv = apr_dso_load(&sSymDBUSDSOHandle, dbus_dso_name.c_str(), - sSymDBUSDSOMemoryPool()) )) + sSymDBUSDSOMemoryPool) )) { INFOMSG("Found DSO: %s", dbus_dso_name.c_str()); @@ -109,7 +109,11 @@ void ungrab_dbus_syms() sSymDBUSDSOHandleG = NULL; } - sSymDBUSDSOMemoryPool.destroy(); + if ( sSymDBUSDSOMemoryPool ) + { + apr_pool_destroy(sSymDBUSDSOMemoryPool); + sSymDBUSDSOMemoryPool = NULL; + } // NULL-out all of the symbols we'd grabbed #define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) do{ll##DBUSSYM = NULL;}while(0) diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 13c8745eaf..1cd80986d8 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -113,7 +113,6 @@ int main( int argc, char **argv ) } delete viewer_app_ptr; viewer_app_ptr = NULL; - return 0; } diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 9b96332c10..deebd69ec1 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -223,7 +223,8 @@ BOOL LLFloaterAnimPreview::postBuild() // now load bvh file S32 file_size; - LLAPRFile infile(mFilenameAndPath, LL_APR_RB, &file_size); + LLAPRFile infile ; + infile.open(mFilenameAndPath, LL_APR_RB, NULL, &file_size); if (!infile.getFileHandle()) { diff --git a/indra/newview/llmainlooprepeater.cpp b/indra/newview/llmainlooprepeater.cpp index d73048a28b..5c020e6d98 100644 --- a/indra/newview/llmainlooprepeater.cpp +++ b/indra/newview/llmainlooprepeater.cpp @@ -46,7 +46,7 @@ void LLMainLoopRepeater::start(void) { if(mQueue != 0) return; - mQueue = new LLThreadSafeQueue(1024); + mQueue = new LLThreadSafeQueue(gAPRPoolp, 1024); mMainLoopConnection = LLEventPumps::instance(). obtain("mainloop").listen(LLEventPump::inventName(), boost::bind(&LLMainLoopRepeater::onMainLoop, this, _1)); mRepeaterConnection = LLEventPumps::instance(). diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index a47ea8581a..f54214b95c 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -176,7 +176,7 @@ private: bool LLTextureCacheLocalFileWorker::doRead() { - S32 local_size = LLAPRFile::size(mFileName); + S32 local_size = LLAPRFile::size(mFileName, mCache->getLocalAPRFilePool()); if (local_size > 0 && mFileName.size() > 4) { @@ -250,7 +250,7 @@ bool LLTextureCacheLocalFileWorker::doRead() } mReadData = new U8[mDataSize]; - S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize); + S32 bytes_read = LLAPRFile::readEx(mFileName, mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); if (bytes_read != mDataSize) { @@ -331,7 +331,7 @@ bool LLTextureCacheRemoteWorker::doRead() // Is it a JPEG2000 file? { local_filename = filename + ".j2c"; - local_size = LLAPRFile::size(local_filename); + local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); if (local_size > 0) { mImageFormat = IMG_CODEC_J2C; @@ -341,7 +341,7 @@ bool LLTextureCacheRemoteWorker::doRead() if (local_size == 0) { local_filename = filename + ".jpg"; - local_size = LLAPRFile::size(local_filename); + local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); if (local_size > 0) { mImageFormat = IMG_CODEC_JPEG; @@ -352,7 +352,7 @@ bool LLTextureCacheRemoteWorker::doRead() if (local_size == 0) { local_filename = filename + ".tga"; - local_size = LLAPRFile::size(local_filename); + local_size = LLAPRFile::size(local_filename, mCache->getLocalAPRFilePool()); if (local_size > 0) { mImageFormat = IMG_CODEC_TGA; @@ -378,7 +378,8 @@ bool LLTextureCacheRemoteWorker::doRead() } // Allocate read buffer mReadData = new U8[mDataSize]; - S32 bytes_read = LLAPRFile::readEx(local_filename, mReadData, mOffset, mDataSize); + S32 bytes_read = LLAPRFile::readEx(local_filename, + mReadData, mOffset, mDataSize, mCache->getLocalAPRFilePool()); if (bytes_read != mDataSize) { llwarns << "Error reading file from local cache: " << local_filename @@ -429,7 +430,8 @@ bool LLTextureCacheRemoteWorker::doRead() size = llmin(size, mDataSize); // Allocate the read buffer mReadData = new U8[size]; - S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, mReadData, offset, size); + S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, + mReadData, offset, size, mCache->getLocalAPRFilePool()); if (bytes_read != size) { llwarns << "LLTextureCacheWorker: " << mID @@ -455,7 +457,7 @@ bool LLTextureCacheRemoteWorker::doRead() if (!done && (mState == BODY)) { std::string filename = mCache->getTextureFileName(mID); - S32 filesize = LLAPRFile::size(filename); + S32 filesize = LLAPRFile::size(filename, mCache->getLocalAPRFilePool()); if (filesize && (filesize + TEXTURE_CACHE_ENTRY_SIZE) > mOffset) { @@ -497,7 +499,8 @@ bool LLTextureCacheRemoteWorker::doRead() // Read the data at last S32 bytes_read = LLAPRFile::readEx(filename, mReadData + data_offset, - file_offset, file_size); + file_offset, file_size, + mCache->getLocalAPRFilePool()); if (bytes_read != file_size) { llwarns << "LLTextureCacheWorker: " << mID @@ -598,13 +601,13 @@ bool LLTextureCacheRemoteWorker::doWrite() U8* padBuffer = new U8[TEXTURE_CACHE_ENTRY_SIZE]; memset(padBuffer, 0, TEXTURE_CACHE_ENTRY_SIZE); // Init with zeros memcpy(padBuffer, mWriteData, mDataSize); // Copy the write buffer - bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, padBuffer, offset, size); + bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, padBuffer, offset, size, mCache->getLocalAPRFilePool()); delete [] padBuffer; } else { // Write the header record (== first TEXTURE_CACHE_ENTRY_SIZE bytes of the raw file) in the header file - bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, mWriteData, offset, size); + bytes_written = LLAPRFile::writeEx(mCache->mHeaderDataFileName, mWriteData, offset, size, mCache->getLocalAPRFilePool()); } if (bytes_written <= 0) @@ -639,7 +642,8 @@ bool LLTextureCacheRemoteWorker::doWrite() // llinfos << "Writing Body: " << filename << " Bytes: " << file_offset+file_size << llendl; S32 bytes_written = LLAPRFile::writeEx( filename, mWriteData + TEXTURE_CACHE_ENTRY_SIZE, - 0, file_size); + 0, file_size, + mCache->getLocalAPRFilePool()); if (bytes_written <= 0) { llwarns << "LLTextureCacheWorker: " << mID @@ -736,6 +740,9 @@ void LLTextureCacheWorker::endWork(S32 param, bool aborted) LLTextureCache::LLTextureCache(bool threaded) : LLWorkerThread("TextureCache", threaded), + mWorkersMutex(NULL), + mHeaderMutex(NULL), + mListMutex(NULL), mHeaderAPRFile(NULL), mReadOnly(TRUE), //do not allow to change the texture cache until setReadOnly() is called. mTexturesSizeTotal(0), @@ -839,7 +846,7 @@ BOOL LLTextureCache::isInLocal(const LLUUID& id) // Is it a JPEG2000 file? { local_filename = filename + ".j2c"; - local_size = LLAPRFile::size(local_filename); + local_size = LLAPRFile::size(local_filename, getLocalAPRFilePool()); if (local_size > 0) { return TRUE ; @@ -849,7 +856,7 @@ BOOL LLTextureCache::isInLocal(const LLUUID& id) // If not, is it a jpeg file? { local_filename = filename + ".jpg"; - local_size = LLAPRFile::size(local_filename); + local_size = LLAPRFile::size(local_filename, getLocalAPRFilePool()); if (local_size > 0) { return TRUE ; @@ -859,7 +866,7 @@ BOOL LLTextureCache::isInLocal(const LLUUID& id) // Hmm... What about a targa file? (used for UI texture mostly) { local_filename = filename + ".tga"; - local_size = LLAPRFile::size(local_filename); + local_size = LLAPRFile::size(local_filename, getLocalAPRFilePool()); if (local_size > 0) { return TRUE ; @@ -905,10 +912,10 @@ void LLTextureCache::purgeCache(ELLPath location) if(LLFile::isdir(mTexturesDirName)) { std::string file_name = gDirUtilp->getExpandedFilename(location, entries_filename); - LLAPRFile::remove(file_name); + LLAPRFile::remove(file_name, getLocalAPRFilePool()); file_name = gDirUtilp->getExpandedFilename(location, cache_filename); - LLAPRFile::remove(file_name); + LLAPRFile::remove(file_name, getLocalAPRFilePool()); purgeAllTextures(true); } @@ -984,9 +991,7 @@ LLAPRFile* LLTextureCache::openHeaderEntriesFile(bool readonly, S32 offset) { llassert_always(mHeaderAPRFile == NULL); apr_int32_t flags = readonly ? APR_READ|APR_BINARY : APR_READ|APR_WRITE|APR_BINARY; - // All code calling openHeaderEntriesFile, immediately calls closeHeaderEntriesFile, - // so this file is very short-lived. - mHeaderAPRFile = new LLAPRFile(mHeaderEntriesFileName, flags); + mHeaderAPRFile = new LLAPRFile(mHeaderEntriesFileName, flags, getLocalAPRFilePool()); if(offset > 0) { mHeaderAPRFile->seek(APR_SET, offset); @@ -1009,9 +1014,10 @@ void LLTextureCache::readEntriesHeader() { // mHeaderEntriesInfo initializes to default values so safe not to read it llassert_always(mHeaderAPRFile == NULL); - if (LLAPRFile::isExist(mHeaderEntriesFileName)) + if (LLAPRFile::isExist(mHeaderEntriesFileName, getLocalAPRFilePool())) { - LLAPRFile::readEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo)); + LLAPRFile::readEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), + getLocalAPRFilePool()); } else //create an empty entries header. { @@ -1026,7 +1032,8 @@ void LLTextureCache::writeEntriesHeader() llassert_always(mHeaderAPRFile == NULL); if (!mReadOnly) { - LLAPRFile::writeEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo)); + LLAPRFile::writeEx(mHeaderEntriesFileName, (U8*)&mHeaderEntriesInfo, 0, sizeof(EntriesInfo), + getLocalAPRFilePool()); } } @@ -1616,7 +1623,7 @@ void LLTextureCache::purgeTextures(bool validate) if (uuididx == validate_idx) { LL_DEBUGS("TextureCache") << "Validating: " << filename << "Size: " << entries[idx].mBodySize << LL_ENDL; - S32 bodysize = LLAPRFile::size(filename); + S32 bodysize = LLAPRFile::size(filename, getLocalAPRFilePool()); if (bodysize != entries[idx].mBodySize) { LL_WARNS("TextureCache") << "TEXTURE CACHE BODY HAS BAD SIZE: " << bodysize << " != " << entries[idx].mBodySize @@ -1851,7 +1858,7 @@ void LLTextureCache::removeCachedTexture(const LLUUID& id) mTexturesSizeMap.erase(id); } mHeaderIDMap.erase(id); - LLAPRFile::remove(getTextureFileName(id)); + LLAPRFile::remove(getTextureFileName(id), getLocalAPRFilePool()); } //called after mHeaderMutex is locked. @@ -1863,7 +1870,7 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename) { if (entry.mBodySize == 0) // Always attempt to remove when mBodySize > 0. { - if (LLAPRFile::isExist(filename)) // Sanity check. Shouldn't exist when body size is 0. + if (LLAPRFile::isExist(filename, getLocalAPRFilePool())) // Sanity check. Shouldn't exist when body size is 0. { LL_WARNS("TextureCache") << "Entry has body size of zero but file " << filename << " exists. Deleting this file, too." << LL_ENDL; } @@ -1884,7 +1891,7 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename) if (file_maybe_exists) { - LLAPRFile::remove(filename); + LLAPRFile::remove(filename, getLocalAPRFilePool()); } } diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 79f5ba5835..64e3a2658c 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -142,6 +142,9 @@ protected: std::string getTextureFileName(const LLUUID& id); void addCompleted(Responder* responder, bool success); +protected: + //void setFileAPRPool(apr_pool_t* pool) { mFileAPRPool = pool ; } + private: void setDirNames(ELLPath location); void readHeaderCache(); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 139b434aeb..18c3a3b87d 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -674,6 +674,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mRetryAttempt(0), mActiveCount(0), mGetStatus(0), + mWorkMutex(NULL), mFirstPacket(0), mLastPacket(-1), mTotalPackets(0), @@ -1815,6 +1816,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mDebugPause(FALSE), mPacketCount(0), mBadPacketCount(0), + mQueueMutex(getAPRPool()), + mNetworkQueueMutex(getAPRPool()), mTextureCache(cache), mImageDecodeThread(imagedecodethread), mTextureBandwidth(0), diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 6bee7556cd..fda291f3c1 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -736,7 +736,8 @@ void upload_new_resource(const std::string& src_filename, std::string name, uuid = tid.makeAssetID(gAgent.getSecureSessionID()); // copy this file into the vfs for upload S32 file_size; - LLAPRFile infile(filename, LL_APR_RB, &file_size); + LLAPRFile infile ; + infile.open(filename, LL_APR_RB, NULL, &file_size); if (infile.getFileHandle()) { LLVFile file(gVFS, uuid, asset_type, LLVFile::WRITE); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2cd9b09932..fd89044995 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7190,7 +7190,8 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) // static void LLVOAvatar::dumpArchetypeXML( void* ) { - LLAPRFile outfile(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER, "new archetype.xml"), LL_APR_WB); + LLAPRFile outfile; + outfile.open(gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,"new archetype.xml"), LL_APR_WB ); apr_file_t* file = outfile.getFileHandle() ; if (!file) { diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index d25831b4f1..a933500706 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -30,14 +30,14 @@ #include "llregionhandle.h" #include "llviewercontrol.h" -static BOOL check_read(LLAPRFile& apr_file, void* src, S32 n_bytes) +BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes) { - return apr_file.read(src, n_bytes) == n_bytes ; + return apr_file->read(src, n_bytes) == n_bytes ; } -static BOOL check_write(LLAPRFile& apr_file, void* src, S32 n_bytes) +BOOL check_write(LLAPRFile* apr_file, void* src, S32 n_bytes) { - return apr_file.write(src, n_bytes) == n_bytes ; + return apr_file->write(src, n_bytes) == n_bytes ; } @@ -70,7 +70,7 @@ LLVOCacheEntry::LLVOCacheEntry() mDP.assignBuffer(mBuffer, 0); } -LLVOCacheEntry::LLVOCacheEntry(LLAPRFile& apr_file) +LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) { S32 size = -1; BOOL success; @@ -185,7 +185,7 @@ void LLVOCacheEntry::dump() const << llendl; } -BOOL LLVOCacheEntry::writeToFile(LLAPRFile& apr_file) const +BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const { BOOL success; success = check_write(apr_file, (void*)&mLocalID, sizeof(U32)); @@ -266,6 +266,7 @@ LLVOCache::LLVOCache(): mCacheSize(1) { mEnabled = gSavedSettings.getBOOL("ObjectCacheEnabled"); + mLocalAPRFilePoolp = new LLVolatileAPRPool() ; } LLVOCache::~LLVOCache() @@ -275,6 +276,7 @@ LLVOCache::~LLVOCache() writeCacheHeader(); clearCacheInMemory(); } + delete mLocalAPRFilePoolp; } void LLVOCache::setDirNames(ELLPath location) @@ -435,7 +437,7 @@ void LLVOCache::removeFromCache(HeaderEntryInfo* entry) std::string filename; getObjectCacheFilename(entry->mHandle, filename); - LLAPRFile::remove(filename); + LLAPRFile::remove(filename, mLocalAPRFilePoolp); entry->mTime = INVALID_TIME ; updateEntry(entry) ; //update the head file. } @@ -452,12 +454,12 @@ void LLVOCache::readCacheHeader() clearCacheInMemory(); bool success = true ; - if (LLAPRFile::isExist(mHeaderFileName)) + if (LLAPRFile::isExist(mHeaderFileName, mLocalAPRFilePoolp)) { - LLAPRFile apr_file(mHeaderFileName, APR_READ|APR_BINARY); + LLAPRFile apr_file(mHeaderFileName, APR_READ|APR_BINARY, mLocalAPRFilePoolp); //read the meta element - success = check_read(apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; + success = check_read(&apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; if(success) { @@ -470,7 +472,7 @@ void LLVOCache::readCacheHeader() { entry = new HeaderEntryInfo() ; } - success = check_read(apr_file, entry, sizeof(HeaderEntryInfo)); + success = check_read(&apr_file, entry, sizeof(HeaderEntryInfo)); if(!success) //failed { @@ -539,17 +541,17 @@ void LLVOCache::writeCacheHeader() bool success = true ; { - LLAPRFile apr_file(mHeaderFileName, APR_CREATE|APR_WRITE|APR_BINARY); + LLAPRFile apr_file(mHeaderFileName, APR_CREATE|APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); //write the meta element - success = check_write(apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; + success = check_write(&apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; mNumEntries = 0 ; for(header_entry_queue_t::iterator iter = mHeaderEntryQueue.begin() ; success && iter != mHeaderEntryQueue.end(); ++iter) { (*iter)->mIndex = mNumEntries++ ; - success = check_write(apr_file, (void*)*iter, sizeof(HeaderEntryInfo)); + success = check_write(&apr_file, (void*)*iter, sizeof(HeaderEntryInfo)); } mNumEntries = mHeaderEntryQueue.size() ; @@ -560,7 +562,7 @@ void LLVOCache::writeCacheHeader() for(S32 i = mNumEntries ; success && i < MAX_NUM_OBJECT_ENTRIES ; i++) { //fill the cache with the default entry. - success = check_write(apr_file, entry, sizeof(HeaderEntryInfo)) ; + success = check_write(&apr_file, entry, sizeof(HeaderEntryInfo)) ; } delete entry ; @@ -577,10 +579,10 @@ void LLVOCache::writeCacheHeader() BOOL LLVOCache::updateEntry(const HeaderEntryInfo* entry) { - LLAPRFile apr_file(mHeaderFileName, APR_WRITE|APR_BINARY); - apr_file.seek(APR_SET, entry->mIndex * sizeof(HeaderEntryInfo) + sizeof(HeaderMetaInfo)); + LLAPRFile apr_file(mHeaderFileName, APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); + apr_file.seek(APR_SET, entry->mIndex * sizeof(HeaderEntryInfo) + sizeof(HeaderMetaInfo)) ; - return check_write(apr_file, (void*)entry, sizeof(HeaderEntryInfo)) ; + return check_write(&apr_file, (void*)entry, sizeof(HeaderEntryInfo)) ; } void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) @@ -603,10 +605,10 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca { std::string filename; getObjectCacheFilename(handle, filename); - LLAPRFile apr_file(filename, APR_READ|APR_BINARY); + LLAPRFile apr_file(filename, APR_READ|APR_BINARY, mLocalAPRFilePoolp); LLUUID cache_id ; - success = check_read(apr_file, cache_id.mData, UUID_BYTES) ; + success = check_read(&apr_file, cache_id.mData, UUID_BYTES) ; if(success) { @@ -619,11 +621,11 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca if(success) { S32 num_entries; - success = check_read(apr_file, &num_entries, sizeof(S32)) ; + success = check_read(&apr_file, &num_entries, sizeof(S32)) ; for (S32 i = 0; success && i < num_entries; i++) { - LLVOCacheEntry* entry = new LLVOCacheEntry(apr_file); + LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file); if (!entry->getLocalID()) { llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl; @@ -722,19 +724,19 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: { std::string filename; getObjectCacheFilename(handle, filename); - LLAPRFile apr_file(filename, APR_CREATE|APR_WRITE|APR_BINARY); + LLAPRFile apr_file(filename, APR_CREATE|APR_WRITE|APR_BINARY, mLocalAPRFilePoolp); - success = check_write(apr_file, (void*)id.mData, UUID_BYTES) ; + success = check_write(&apr_file, (void*)id.mData, UUID_BYTES) ; if(success) { S32 num_entries = cache_entry_map.size() ; - success = check_write(apr_file, &num_entries, sizeof(S32)); + success = check_write(&apr_file, &num_entries, sizeof(S32)); for (LLVOCacheEntry::vocache_entry_map_t::const_iterator iter = cache_entry_map.begin(); success && iter != cache_entry_map.end(); ++iter) { - success = iter->second->writeToFile(apr_file) ; + success = iter->second->writeToFile(&apr_file) ; } } } diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 76456b9e98..14e3b4c793 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -41,7 +41,7 @@ class LLVOCacheEntry { public: LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp); - LLVOCacheEntry(LLAPRFile& apr_file); + LLVOCacheEntry(LLAPRFile* apr_file); LLVOCacheEntry(); ~LLVOCacheEntry(); @@ -51,7 +51,7 @@ public: S32 getCRCChangeCount() const { return mCRCChangeCount; } void dump() const; - BOOL writeToFile(LLAPRFile& apr_file) const; + BOOL writeToFile(LLAPRFile* apr_file) const; void assignCRC(U32 crc, LLDataPackerBinaryBuffer &dp); LLDataPackerBinaryBuffer *getDP(U32 crc); void recordHit(); @@ -142,6 +142,7 @@ private: U32 mNumEntries; std::string mHeaderFileName ; std::string mObjectCacheDirName; + LLVolatileAPRPool* mLocalAPRFilePoolp ; header_entry_queue_t mHeaderEntryQueue; handle_entry_map_t mHandleEntryMap; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 828207ce1a..08e242af8e 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -961,7 +961,7 @@ void LLVivoxVoiceClient::stateMachine() if(!mSocket) { - mSocket = LLSocket::create(LLSocket::STREAM_TCP); + mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); } mConnected = mSocket->blockingConnect(mDaemonHost); diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp index d982ca5020..1694126802 100644 --- a/indra/newview/llwatchdog.cpp +++ b/indra/newview/llwatchdog.cpp @@ -178,8 +178,8 @@ void LLWatchdog::init(killer_event_callback func) mKillerCallback = func; if(!mSuspectsAccessMutex && !mTimer) { - mSuspectsAccessMutex = new LLMutex; - mTimer = new LLWatchdogTimerThread; + mSuspectsAccessMutex = new LLMutex(NULL); + mTimer = new LLWatchdogTimerThread(); mTimer->setSleepTime(WATCHDOG_SLEEP_TIME_USEC / 1000); mLastClockCount = LLTimer::getTotalTime(); diff --git a/indra/newview/tests/llworldmap_test.cpp b/indra/newview/tests/llworldmap_test.cpp index 102294959a..acc6e814bc 100644 --- a/indra/newview/tests/llworldmap_test.cpp +++ b/indra/newview/tests/llworldmap_test.cpp @@ -27,6 +27,7 @@ // Dependencies #include "linden_common.h" +#include "llapr.h" #include "llsingleton.h" #include "lltrans.h" #include "lluistring.h" diff --git a/indra/test/lltemplatemessagebuilder_tut.cpp b/indra/test/lltemplatemessagebuilder_tut.cpp index 532f26ee60..09beb53869 100644 --- a/indra/test/lltemplatemessagebuilder_tut.cpp +++ b/indra/test/lltemplatemessagebuilder_tut.cpp @@ -29,6 +29,7 @@ #include "linden_common.h" #include "lltut.h" +#include "llapr.h" #include "llmessagetemplate.h" #include "llquaternion.h" #include "lltemplatemessagebuilder.h" @@ -52,6 +53,7 @@ namespace tut static bool init = false; if(! init) { + ll_init_apr(); const F32 circuit_heartbeat_interval=5; const F32 circuit_timeout=100; diff --git a/indra/test/message_tut.cpp b/indra/test/message_tut.cpp index 9a6ccd4d68..d971b33475 100644 --- a/indra/test/message_tut.cpp +++ b/indra/test/message_tut.cpp @@ -29,6 +29,7 @@ #include "linden_common.h" #include "lltut.h" +#include "llapr.h" #include "llmessageconfig.h" #include "llsdserialize.h" #include "llversionserver.h" @@ -61,6 +62,7 @@ namespace tut static bool init = false; if(!init) { + ll_init_apr(); //init_prehash_data(); init = true; } diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 45e8aef99a..ffdb0cb976 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -37,8 +37,8 @@ #include "linden_common.h" #include "llerrorcontrol.h" #include "lltut.h" -#include "llaprpool.h" +#include "apr_pools.h" #include "apr_getopt.h" // the CTYPE_WORKAROUND is needed for linux dev stations that don't @@ -349,12 +349,17 @@ int main(int argc, char **argv) ctype_workaround(); #endif - LLAPRPool pool; - pool.create(); + apr_initialize(); + apr_pool_t* pool = NULL; + if(APR_SUCCESS != apr_pool_create(&pool, NULL)) + { + std::cerr << "Unable to initialize pool" << std::endl; + return 1; + } apr_getopt_t* os = NULL; - if(APR_SUCCESS != apr_getopt_init(&os, pool(), argc, argv)) + if(APR_SUCCESS != apr_getopt_init(&os, pool, argc, argv)) { - std::cerr << "Unable to initialize the arguments for parsing by apr_getopt()." << std::endl; + std::cerr << "Unable to pool" << std::endl; return 1; } @@ -472,6 +477,8 @@ int main(int argc, char **argv) s.close(); } + apr_terminate(); + int retval = (success ? 0 : 1); return retval; diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp index fd46626ff1..4a2272032b 100644 --- a/indra/test_apps/llplugintest/llmediaplugintest.cpp +++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp @@ -27,6 +27,7 @@ #include "linden_common.h" #include "indra_constants.h" +#include "llapr.h" #include "llerrorcontrol.h" #include @@ -185,6 +186,9 @@ LLMediaPluginTest::LLMediaPluginTest( int app_window, int window_width, int wind std::cout << "Unable to read bookmarks from file: " << bookmarks_filename << std::endl; }; + // initialize linden lab APR module + ll_init_apr(); + // Set up llerror logging { LLError::initForApplication("."); diff --git a/indra/viewer_components/updater/llupdateinstaller.cpp b/indra/viewer_components/updater/llupdateinstaller.cpp index 6aa87d1be6..d450c068ad 100644 --- a/indra/viewer_components/updater/llupdateinstaller.cpp +++ b/indra/viewer_components/updater/llupdateinstaller.cpp @@ -26,7 +26,6 @@ #include "linden_common.h" #include #include "llapr.h" -#include "llscopedvolatileaprpool.h" #include "llprocesslauncher.h" #include "llupdateinstaller.h" #include "lldir.h" @@ -46,8 +45,7 @@ namespace { { std::string scriptFile = gDirUtilp->getBaseFileName(path); std::string newPath = gDirUtilp->getExpandedFilename(LL_PATH_TEMP, scriptFile); - LLScopedVolatileAPRPool pool; - apr_status_t status = apr_file_copy(path.c_str(), newPath.c_str(), APR_FILE_SOURCE_PERMS, pool); + apr_status_t status = apr_file_copy(path.c_str(), newPath.c_str(), APR_FILE_SOURCE_PERMS, gAPRPoolp); if(status != APR_SUCCESS) throw RelocateError(); return newPath; -- cgit v1.3 From 04eb6f0ef4e5b00103ea9f2b011ca709be8a1ef2 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 14 Oct 2011 17:55:04 -0400 Subject: STORM-910 Text formatting issues in Land/Assets accordion --- doc/contributions.txt | 3 ++- indra/newview/llpanelgrouplandmoney.cpp | 5 +++-- indra/newview/skins/default/xui/en/panel_group_land_money.xml | 1 + indra/newview/skins/default/xui/en/strings.xml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index e85fc32f18..00fea501f0 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -578,8 +578,9 @@ Jonathan Yap STORM-1574 STORM-1579 STORM-1639 + STORM-910 Kadah Coba - STORM-1060 + STORM-1060 Jondan Lundquist Josef Munster Josette Windlow diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index eddd6e554d..8477219f87 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -1435,6 +1435,7 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, LLStringUtil::format (time_str, substitution); text.append(time_str); + text.append(". "); if (current_interval == 0) { @@ -1445,8 +1446,8 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, LLStringUtil::format (time_str, substitution); text.append(time_str); - text.append("\n\n"); - text.append(llformat("%-24sL$%6d\n", LLTrans::getString("GroupMoneyBalance").c_str(), balance )); + text.append(".\n\n"); + text.append(llformat("%-23sL$%6d\n", LLTrans::getString("GroupMoneyBalance").c_str(), balance )); text.append(1, '\n'); } diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml index eff674c628..d4da55e32e 100644 --- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -272,6 +272,7 @@ top="0" width="313"> [mthnum,datetime,utc]/[day,datetime,utc]/[year,datetime,utc] - + Balance Credits Debits -- cgit v1.3 From 9cb8e959af89c16b083bf80baecb1bc98d33c1f4 Mon Sep 17 00:00:00 2001 From: Vex Streeter Date: Fri, 14 Oct 2011 20:49:46 -0400 Subject: STORM-1642 Typos in keywords.ini With repo-making help from Jonathan Yap --- doc/contributions.txt | 2 + indra/newview/app_settings/keywords.ini | 82 ++++++++++++++++----------------- 2 files changed, 43 insertions(+), 41 deletions(-) (limited to 'doc') diff --git a/doc/contributions.txt b/doc/contributions.txt index e85fc32f18..93c9211e2e 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -578,6 +578,7 @@ Jonathan Yap STORM-1574 STORM-1579 STORM-1639 + STORM-1642 Kadah Coba STORM-1060 Jondan Lundquist @@ -1137,6 +1138,7 @@ Vector Hastings VWR-8726 Veritas Raymaker Vex Streeter + STORM-1642 Viaticus Speculaas Vick Forcella Villain Baroque diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 9fa4046fdf..b5f105439c 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -10,7 +10,7 @@ state Keyword to indicate state block or state transition integer Integer type float Floating-point type string String type -key Key type. Use NULL_KEY to test for empty keys. +key Key type. Use NULL_KEY to test for empty keys vector Vector type of 3 floats. Used to represent 3D motion, Euler angles, and color.:Access components by .x, .y. or .z rotation Rotation type of 4 floats. Used to represent rotation.:Access components by .x, .y., .z, or .w list List of various data types @@ -28,7 +28,7 @@ collision_end collision_end(integer num_detected):Triggered when task stops coll land_collision_start land_collision_start(vector pos):Triggered when task starts colliding with land land_collision land_collision(vector pos):Triggered when task is colliding with land land_collision_end land_collision_end(vector pos):Triggered when task stops colliding with land -timer timer():Result of the llSetTimerEvent library function call. +timer timer():Result of the llSetTimerEvent library function call listen listen(integer channel, string name, key id, string message):Result of the llListen library function call sensor sensor(integer num_detected):Result of the llSensor library function call no_sensor no_sensor():Result of the llSensor library function call @@ -44,8 +44,8 @@ attach attach(key id):Triggered when task attaches or detaches from agent dataserver dataserver(key queryid, string data):Triggered when task receives asynchronous data moving_start moving_start():Triggered when task begins moving moving_end moving_end():Triggered when task stops moving -on_rez on_rez(integer start_param):Triggered when task is rezed in from inventory or another task -object_rez object_rez(key id):Triggered when task rezes in another task +on_rez on_rez(integer start_param):Triggered when task is rezzed in from inventory or another task +object_rez object_rez(key id):Triggered when task rezzes in another task link_message link_message(integer sender_num, integer num, string str, key id):Triggered when task receives a link message via LLMessageLinked library function call changed changed( integer change ):Triggered various event change the task:(test change with CHANGED_INVENTORY, CHANGED_COLOR, CHANGED_SHAPE, CHANGED_SCALE, CHANGED_TEXTURE, CHANGED_LINK, CHANGED_ALLOWED_DROP, CHANGED_OWNER, CHANGED_REGION, CHANGED_TELEPORT, CHANGED_REGION_START, CHANGED_MEDIA) remote_data remote_data(integer event_type, key channel, key message_id, string sender,integer idata, string sdata):Triggered by various XML-RPC calls (event_type will be one of REMOTE_DATA_CHANNEL, REMOTE_DATA_REQUEST, REMOTE_DATA_REPLY) @@ -151,15 +151,15 @@ PSYS_SRC_PATTERN_ANGLE PSYS_SRC_PATTERN_ANGLE_CONE PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY -OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type. -OBJECT_NAME Used with llGetObjectDetails to get an object's name. -OBJECT_DESC Used with llGetObjectDetails to get an object's description. -OBJECT_POS Used with llGetObjectDetails to get an object's position. -OBJECT_ROT Used with llGetObjectDetails to get an object's rotation. -OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity. -OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned. -OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key. -OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key. +OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type +OBJECT_NAME Used with llGetObjectDetails to get an object's name +OBJECT_DESC Used with llGetObjectDetails to get an object's description +OBJECT_POS Used with llGetObjectDetails to get an object's position +OBJECT_ROT Used with llGetObjectDetails to get an object's rotation +OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity +OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned +OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key +OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key # some vehicle params VEHICLE_TYPE_NONE @@ -198,7 +198,7 @@ VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY A slider between 0 (bouncy) and 1 (critic VEHICLE_VERTICAL_ATTRACTION_TIMESCALE The exponential timescale for the vehicle to align its z-axis to the world z-axis (vertical) VEHICLE_BANKING_EFFICIENCY A slider between -1 (leans out of turns), 0 (no banking), and +1 (leans into turns) -VEHICLE_BANKING_MIX A slider betwen 0 (static banking) and 1 (dynamic banking) +VEHICLE_BANKING_MIX A slider between 0 (static banking) and 1 (dynamic banking) VEHICLE_BANKING_TIMESCALE The exponential timescale for the banking behavior to take full effect VEHICLE_FLAG_NO_DEFLECTION_UP Prevents linear deflection along world-z axis @@ -208,9 +208,9 @@ VEHICLE_FLAG_HOVER_TERRAIN_ONLY Hover only pays attention to terrain height VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT Hover only pays attention to global height VEHICLE_FLAG_HOVER_UP_ONLY Hover only pushes up VEHICLE_FLAG_LIMIT_MOTOR_UP Prevents ground vehicles from motoring into the sky -VEHICLE_FLAG_MOUSELOOK_STEER Makes vehicle try to turn toward mouselook direction. -VEHICLE_FLAG_MOUSELOOK_BANK Makes vehicle try to turn toward mouselook direction assuming banking is enabled. -VEHICLE_FLAG_CAMERA_DECOUPLED Causes the camera look-at axis to NOT move when the vehicle rotates. +VEHICLE_FLAG_MOUSELOOK_STEER Makes vehicle try to turn toward mouselook direction +VEHICLE_FLAG_MOUSELOOK_BANK Makes vehicle try to turn toward mouselook direction assuming banking is enabled +VEHICLE_FLAG_CAMERA_DECOUPLED Causes the camera look-at axis to NOT move when the vehicle rotates CAMERA_PITCH (-45 to 80) (Adjusts the angular amount that the camera aims straight ahead vs. straight down, maintaining the same distance. Analogous to 'incidence'.") CAMERA_FOCUS_OFFSET (-10 to 10) A vector that adjusts the position of the camera focus position relative to the subject @@ -238,7 +238,7 @@ INVENTORY_BODYPART Passed to task inventory library functions to reference body INVENTORY_ANIMATION Passed to task inventory library functions to reference animations INVENTORY_GESTURE Passed to task inventory library functions to reference gestures INVENTORY_ALL Passed to task inventory library functions to reference all inventory items -INVENTORY_NONE Returned by llGetInventoryType when no item is found. +INVENTORY_NONE Returned by llGetInventoryType when no item is found ATTACH_CHEST Passed to llAttachToAvatar to attach task to chest ATTACH_HEAD Passed to llAttachToAvatar to attach task to head @@ -256,7 +256,7 @@ ATTACH_LEAR Passed to llAttachToAvatar to attach task to left ear ATTACH_REAR Passed to llAttachToAvatar to attach task to right ear ATTACH_LEYE Passed to llAttachToAvatar to attach task to left eye ATTACH_REYE Passed to llAttachToAvatar to attach task to right eye -ATTACH_NOSE Passed to llAttachToAvatar to attach task to noce +ATTACH_NOSE Passed to llAttachToAvatar to attach task to nose ATTACH_RUARM Passed to llAttachToAvatar to attach task to right upper arm ATTACH_RLARM Passed to llAttachToAvatar to attach task to right lower arm ATTACH_LUARM Passed to llAttachToAvatar to attach task to left upper arm @@ -296,7 +296,7 @@ PAYMENT_INFO_USED Used with llRequestAgentData to tell if Agent is of "Payment I ANIM_ON Enable texture animation LOOP Loop when animating textures REVERSE Animate in the reverse direction -PING_PONG Animate forward, then reverse. +PING_PONG Animate forward, then reverse SMOOTH Textures slides, instead of stepping ROTATE Rotates the texture, instead of using frames SCALE Scales the texture, instead of using frames @@ -343,7 +343,7 @@ PRIM_FLEXIBLE Followed by TRUE or FALSE, integer softness, float gravity, float PRIM_POINT_LIGHT Followed by TRUE or FALSE, vector color, float intensity, float radius, float falloff PRIM_TEMP_ON_REZ Sets temporay on rez to TRUE or FALSE PRIM_PHANTOM Sets phantom to TRUE or FALSE -PRIM_CAST_SHADOWS DEPRECATED. Takes 1 parameter, an integer, but has no effect when set and always returns 0 if used in llGetPrimitiveParams. +PRIM_CAST_SHADOWS DEPRECATED. Takes 1 parameter, an integer, but has no effect when set and always returns 0 if used in llGetPrimitiveParams PRIM_POSITION Sets primitive position to a vector position PRIM_SIZE Sets primitive size to a vector size PRIM_ROTATION Sets primitive rotation @@ -363,10 +363,10 @@ PRIM_TYPE_TUBE Followed by integer hole shape, vector cut, float hollow, vector PRIM_TYPE_RING Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew PRIM_TYPE_SCULPT Followed by a key/string texture uuid, and one of PRIM_SCULPT_TYPE_SPHERE, PRIM_SCULPT_TYPE_TORUS, PRIM_SCULPT_TYPE_PLANE, or PRIM_SCULPT_TYPE_CYLINDER -PRIM_HOLE_DEFAULT Sets hole type to match the prim type. -PRIM_HOLE_SQUARE Sets hole type to square. -PRIM_HOLE_CIRCLE Sets hole type to circle. -PRIM_HOLE_TRIANGLE Sets hole type to triangle. +PRIM_HOLE_DEFAULT Sets hole type to match the prim type +PRIM_HOLE_SQUARE Sets hole type to square +PRIM_HOLE_CIRCLE Sets hole type to circle +PRIM_HOLE_TRIANGLE Sets hole type to triangle PRIM_MATERIAL_STONE Sets material to stone PRIM_MATERIAL_METAL Sets material to metal @@ -436,7 +436,7 @@ PARCEL_MEDIA_COMMAND_TIME Set media stream to specific time PARCEL_MEDIA_COMMAND_SIZE Get or set the parcel's media pixel resolution PARCEL_MEDIA_COMMAND_AGENT Allows media stream commands to apply to only one agent PARCEL_MEDIA_COMMAND_UNLOAD Unloads the media stream -PARCEL_MEDIA_COMMAND_AUTO_ALIGN Auto aligns the media stream to the texture size. May cause a performance hit and loss of some visual quality. +PARCEL_MEDIA_COMMAND_AUTO_ALIGN Auto aligns the media stream to the texture size. May cause a performance hit and loss of some visual quality PAY_HIDE Used with llSetPayPrice to hide a button PAY_DEFAULT Used with llSetPayPrice to use the default price for a button @@ -481,7 +481,7 @@ REGION_FLAG_RESTRICT_PUSHOBJECT Used with llGetRegionFlags to find if a region HTTP_METHOD Used with llHTTPRequest to specify the method, such as "GET" or "POST" HTTP_MIMETYPE Used with llHTTPRequest to specify the MIME type, defaults to "text/plain" -HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maxium reponse body to return +HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maximum response body to return HTTP_VERIFY_CERT Used with llHTTPRequest to specify SSL certificate verification HTTP_BODY_TRUNCATED Used with http_response to indicate truncation point in bytes @@ -492,17 +492,17 @@ PARCEL_COUNT_OTHER Used with llGetParcelPrimCount to get the number of prims on PARCEL_COUNT_SELECTED Used with llGetParcelPrimCount to get the number of prims on the parcel currently selected or sat upon PARCEL_COUNT_TEMP Used with llGetParcelPrimCount to get the number of prims on the parcel that are temp on rez -PARCEL_DETAILS_NAME Used with llGetParcelDetails to get the parcel name. -PARCEL_DETAILS_DESC Used with llGetParcelDetails to get the parcel description. -PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id. -PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id. -PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters. -PARCEL_DETAILS_ID Used with llGetParcelDetails to get the parcel id. -PARCEL_DETAILS_SEE_AVATARS Used with llGetParcelDetails to get the avatars visibility setting. +PARCEL_DETAILS_NAME Used with llGetParcelDetails to get the parcel name +PARCEL_DETAILS_DESC Used with llGetParcelDetails to get the parcel description +PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id +PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id +PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters +PARCEL_DETAILS_ID Used with llGetParcelDetails to get the parcel id +PARCEL_DETAILS_SEE_AVATARS Used with llGetParcelDetails to get the avatars visibility setting -STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string. -STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string. -STRING_TRIM Used with llStringTrim to trim both leading and trailing spaces from a string. +STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string +STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string +STRING_TRIM Used with llStringTrim to trim both leading and trailing spaces from a string CLICK_ACTION_NONE Used with llSetClickAction to disable the click action CLICK_ACTION_TOUCH Used with llSetClickAction to set touch as the default action when object is clicked @@ -514,9 +514,9 @@ CLICK_ACTION_PLAY Used with llSetClickAction to set play as the default ac CLICK_ACTION_OPEN_MEDIA Used with llSetClickAction to set open-media as the default action when object is clicked CLICK_ACTION_ZOOM Used with llSetClickAction to set zoom in as the default action when object is clicked -TOUCH_INVALID_TEXCOORD Value returned by llDetectedTouchUV() and llDetectedTouchST() when the touch position is not valid. -TOUCH_INVALID_VECTOR Value returned by llDetectedTouchPos(), llDetectedTouchNormal(), and llDetectedTouchBinormal() when the touch position is not valid. -TOUCH_INVALID_FACE Value returned by llDetectedTouchFace() when the touch position is not valid. +TOUCH_INVALID_TEXCOORD Value returned by llDetectedTouchUV() and llDetectedTouchST() when the touch position is not valid +TOUCH_INVALID_VECTOR Value returned by llDetectedTouchPos(), llDetectedTouchNormal(), and llDetectedTouchBinormal() when the touch position is not valid +TOUCH_INVALID_FACE Value returned by llDetectedTouchFace() when the touch position is not valid PRIM_MEDIA_ALT_IMAGE_ENABLE Used with ll{Get,Set}PrimMediaParams to enable the default alt image for media PRIM_MEDIA_CONTROLS Used with ll{Get,Set}PrimMediaParams to determine the controls shown for media @@ -608,4 +608,4 @@ return Leave current function or event handler [two_sided_delimiter 0, .2, 0] " String literal -#functions are supplied by the program now. +#functions are supplied by the program now -- cgit v1.3