Skip to content

Commit 4cb51d2

Browse files
author
Atul Katti
committed
[1.10>master] [MERGE #5539 @atulkatti] MSFT:18210422 Remove the dummy field in NoResizeLock that adds 8 bytes to all BaseDictionary instances using NoResizeLock.
Merge pull request #5539 from atulkatti:Bug18210422.RevertBaseDictionarySizeChange.1 This was added only to help with prefast analysis. I will need to add some prefast ignore statements after looking at the failures.
2 parents 128fc62 + 1840596 commit 4cb51d2

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

lib/Common/DataStructures/BaseDictionary.h

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
#include "DictionaryStats.h"
3131
#endif
3232

33+
#pragma warning(push)
34+
#pragma warning(disable:__WARNING_FAILING_TO_ACQUIRE_MEDIUM_CONFIDENCE)
35+
#pragma warning(disable:__WARNING_CALLER_FAILING_TO_HOLD_MEDIUM_CONFIDENCE)
36+
3337
namespace Js
3438
{
3539
template <class TDictionary>
@@ -44,20 +48,11 @@ namespace JsDiag
4448

4549
namespace JsUtil
4650
{
47-
struct contentStruct
48-
{
49-
Field(int) cs;
50-
};
5151
class NoResizeLock
5252
{
5353
public:
54-
#pragma prefast(suppress:__WARNING_FAILING_TO_ACQUIRE_MEDIUM_CONFIDENCE)
55-
void _Acquires_lock_(cs.cs) BeginResize() {}
56-
#pragma prefast(suppress:__WARNING_FAILING_TO_RELEASE_MEDIUM_CONFIDENCE)
57-
void _Releases_lock_(cs.cs) EndResize() {}
58-
private:
59-
// For prefast analysis, we need to have a somewhat similar shape for both locks
60-
Field(contentStruct) cs;
54+
void BeginResize() {}
55+
void EndResize() {}
6156
};
6257

6358
class AsymetricResizeLock
@@ -126,10 +121,8 @@ namespace JsUtil
126121
class AutoDoResize
127122
{
128123
public:
129-
#pragma prefast(suppress:__WARNING_FAILING_TO_ACQUIRE_MEDIUM_CONFIDENCE)
130-
_Acquires_lock_(this->lock.cs.cs) AutoDoResize(Lock& lock) : lock(lock) { this->lock.BeginResize(); };
131-
#pragma prefast(suppress:__WARNING_CALLER_FAILING_TO_HOLD_MEDIUM_CONFIDENCE)
132-
_Releases_lock_(this->lock.cs.cs) ~AutoDoResize() { this->lock.EndResize(); };
124+
AutoDoResize(Lock& lock) : lock(lock) { this->lock.BeginResize(); };
125+
~AutoDoResize() { this->lock.EndResize(); };
133126
private:
134127
Lock& lock;
135128
};
@@ -1863,3 +1856,5 @@ namespace JsUtil
18631856
PREVENT_COPY(SynchronizedDictionary);
18641857
};
18651858
}
1859+
1860+
#pragma warning(pop)

0 commit comments

Comments
 (0)