diff options
author | Marek Safar <marek.safar@gmail.com> | 2015-05-09 13:24:20 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2015-05-09 13:24:20 +0300 |
commit | ffb5c90e08d2f619b207c07c25b8551f52e9913e (patch) | |
tree | 9b575bbffbd883b61f09fbc5364fd0cf5e1b1ac2 /mcs/class | |
parent | a8e603f055e88efb07577b9a3244f911fb687211 (diff) |
[system.runtime.caching] Remove inappropropriate use of Marshal.SizeOf. Fixes #29667
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/System.Runtime.Caching/ReferenceSources/SRef.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mcs/class/System.Runtime.Caching/ReferenceSources/SRef.cs b/mcs/class/System.Runtime.Caching/ReferenceSources/SRef.cs index ce0812bcc1c..644a2fc0b22 100644 --- a/mcs/class/System.Runtime.Caching/ReferenceSources/SRef.cs +++ b/mcs/class/System.Runtime.Caching/ReferenceSources/SRef.cs @@ -11,14 +11,17 @@ namespace System.Runtime.Caching { */ internal class SRef { - private Object _sizedRef; +// private Object _sizedRef; internal SRef (Object target) { - _sizedRef = target; +// _sizedRef = target; } internal long ApproximateSize { - get { return (long) Marshal.SizeOf (_sizedRef.GetType ()); } + get { + // TODO: .net uses System.SizedReference which contains approximate size after Gen 2 collection + return 16; + } } internal void Dispose() { |