| 1 | // Licensed to the .NET Foundation under one or more agreements. | 
|---|---|
| 2 | // The .NET Foundation licenses this file to you under the MIT license. | 
| 3 | // See the LICENSE file in the project root for more information. | 
| 4 | |
| 5 | #ifndef __COMReflectionCache_inl__ | 
| 6 | #define __COMReflectionCache_inl__ | 
| 7 | |
| 8 | #ifndef DACCESS_COMPILE | 
| 9 | |
| 10 | template <class Element, class CacheType, int CacheSize> | 
| 11 | void ReflectionCache<Element, CacheType, CacheSize>::Init() | 
| 12 | { | 
| 13 | CONTRACTL | 
| 14 | { | 
| 15 | THROWS; | 
| 16 | GC_NOTRIGGER; | 
| 17 | MODE_ANY; | 
| 18 | } | 
| 19 | CONTRACTL_END; | 
| 20 | |
| 21 | m_pResult = (CacheTable *)(void *) ::GetAppDomain()->GetLowFrequencyHeap()->AllocMem(S_SIZE_T(CacheSize) * S_SIZE_T(sizeof(CacheTable))); | 
| 22 | m_pHashTable = (HashTable *)(void *) ::GetAppDomain()->GetLowFrequencyHeap()->AllocMem(S_SIZE_T(CacheSize) * S_SIZE_T(sizeof(HashTable))); | 
| 23 | |
| 24 | |
| 25 | for (int i = 0; i < CacheSize; i ++) | 
| 26 | m_pHashTable[i].slot = -1; | 
| 27 | } | 
| 28 | |
| 29 | #endif //!DACCESS_COMPILE | 
| 30 | |
| 31 | #endif // __COMReflectionCache_inl__ | 
| 32 | 
