[2020-02] Fix leak in assembly-specific dllmap lookups (#21053)
[mono-project.git] / mono / metadata / external-only.h
blobca4e2ffef8b41c2efda5c14658ffb5a040b0e697
1 /**
2 * \file
3 * Shorthand and markers for functions only used by embedders.
4 * MONO_ENTER_GC_UNSAFE is also a good indication of external_only.
6 * Author:
7 * Jay Krell (jaykrell@microsoft.com)
9 * Copyright 2018 Microsoft
10 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
13 #ifndef MONO_EXTERNAL_ONLY
15 #define MONO_EXTERNAL_ONLY_GC_UNSAFE(t, expr) \
16 t result; \
17 MONO_ENTER_GC_UNSAFE; \
18 result = expr; \
19 MONO_EXIT_GC_UNSAFE; \
20 return result;
22 #define MONO_EXTERNAL_ONLY_GC_UNSAFE_VOID(expr) \
23 MONO_ENTER_GC_UNSAFE; \
24 expr; \
25 MONO_EXIT_GC_UNSAFE; \
27 #define MONO_EXTERNAL_ONLY(t, expr) return expr;
28 #define MONO_EXTERNAL_ONLY_VOID(expr) expr;
30 #endif /* MONO_EXTERNAL_ONLY */