| 1 | // | 
|---|---|
| 2 | // Copyright (c) Microsoft. All rights reserved. | 
| 3 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. | 
| 4 | // | 
| 5 | |
| 6 | #include "standardpch.h" | 
| 7 | #include "runtimedetails.h" | 
| 8 | #include "spmiutil.h" | 
| 9 | #include "methodcallsummarizer.h" | 
| 10 | #include "jithost.h" | 
| 11 | |
| 12 | JitHost* g_ourJitHost; | 
| 13 | |
| 14 | JitHost::JitHost(ICorJitHost* wrappedHost) : wrappedHost(wrappedHost), mcs(nullptr) | 
| 15 | { | 
| 16 | } | 
| 17 | |
| 18 | void JitHost::setMethodCallSummarizer(MethodCallSummarizer* methodCallSummarizer) | 
| 19 | { | 
| 20 | this->mcs = methodCallSummarizer; | 
| 21 | } | 
| 22 | |
| 23 | void* JitHost::allocateMemory(size_t size) | 
| 24 | { | 
| 25 | return wrappedHost->allocateMemory(size); | 
| 26 | } | 
| 27 | |
| 28 | void JitHost::freeMemory(void* block) | 
| 29 | { | 
| 30 | return wrappedHost->freeMemory(block); | 
| 31 | } | 
| 32 | |
| 33 | int JitHost::getIntConfigValue(const wchar_t* key, int defaultValue) | 
| 34 | { | 
| 35 |     mcs->AddCall("getIntConfigValue");  | 
| 36 | return wrappedHost->getIntConfigValue(key, defaultValue); | 
| 37 | } | 
| 38 | |
| 39 | const wchar_t* JitHost::getStringConfigValue(const wchar_t* key) | 
| 40 | { | 
| 41 |     mcs->AddCall("getStringConfigValue");  | 
| 42 | return wrappedHost->getStringConfigValue(key); | 
| 43 | } | 
| 44 | |
| 45 | void JitHost::freeStringConfigValue(const wchar_t* value) | 
| 46 | { | 
| 47 |     mcs->AddCall("freeStringConfigValue");  | 
| 48 | wrappedHost->freeStringConfigValue(value); | 
| 49 | } | 
| 50 |