Implemeneted imprecise.
authorNathan Ricci <naricc@microsoft.com>
Wed, 21 Aug 2019 15:20:27 +0000 (11:20 -0400)
committerNathan Ricci <naricc@microsoft.com>
Wed, 21 Aug 2019 15:20:27 +0000 (11:20 -0400)
Commit migrated from https://github.com/mono/mono/commit/53939d0790896a527abec02b42cfaa42b0a269d5

src/mono/mono/metadata/icall.c
src/mono/mono/metadata/sgen-mono.c
src/mono/netcore/sample/HelloWorld/Program.cs

index fc5ccf3..bd1aea2 100644 (file)
@@ -9329,7 +9329,7 @@ ves_icall_System_GC_GetAllocatedBytesForCurrentThread (void)
 gint64
 ves_icall_System_GC_GetTotalAllocatedBytes (MonoBoolean precise, MonoError* error)
 {
-       return 0;
+       return mono_gc_get_total_allocated_bytes (precise);
 }
 
 void
index bdeeb19..7ed40c7 100644 (file)
@@ -2502,7 +2502,7 @@ mono_gc_get_los_limit (void)
 void
 sgen_set_total_bytes_allocated(guint64 bytes)
 {
-       total_bytes_allocated += total_bytes_allocated;
+       total_bytes_allocated = bytes;
 }
 
 guint64
index 4d0f989..45d83b3 100644 (file)
@@ -11,8 +11,6 @@ namespace HelloWorld
             Console.WriteLine(typeof(object).Assembly.FullName);
             Console.WriteLine(System.Reflection.Assembly.GetEntryAssembly ());
             Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription);
-           Console.WriteLine("Gibbbabhafsgs");
-           Console.WriteLine(GC.GetTotalAllocatedBytes(false));
         }
     }
 }