• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisãob7b45c1d2af2dd18e0d703faafe62a1bfb69948a (tree)
Hora2013-08-06 19:26:03
AutorMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Mensagem de Log

Refactoring MallocerFreer::AddCurrentMalloced to speed up. #31814

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1460 1136aad2-a195-0410-b898-f5ea1d11b9d8

Mudança Sumário

Diff

--- a/src/base/MallocerFreer.cpp
+++ b/src/base/MallocerFreer.cpp
@@ -95,13 +95,19 @@ void MallocerFreer::DeleteInstance(){
9595 }
9696
9797 void MallocerFreer::AddCurrentMalloced(double amount){
98-#pragma omp critical
99- {
100- MallocerFreer::currentMalloced += amount;
101- if(0 < amount && MallocerFreer::maxMalloced < MallocerFreer::currentMalloced){
102- MallocerFreer::maxMalloced = MallocerFreer::currentMalloced;
103- }
104- }
98+ #pragma omp atomic
99+ MallocerFreer::currentMalloced += amount;
100+ if(0 < amount){
101+ #pragma omp flush(MallocerFreer::maxMalloced, MallocerFreer::currentMalloced)
102+ if(MallocerFreer::maxMalloced < MallocerFreer::currentMalloced){
103+ #pragma omp critical
104+ {
105+ if(MallocerFreer::maxMalloced < MallocerFreer::currentMalloced){
106+ MallocerFreer::maxMalloced = MallocerFreer::currentMalloced;
107+ }
108+ }
109+ }
110+ }
105111 }
106112
107113 }