Skip to content

Instantly share code, notes, and snippets.

@mkevac
Created July 5, 2017 12:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkevac/6e473b995dee44467b556ddbeb334abb to your computer and use it in GitHub Desktop.
Save mkevac/6e473b995dee44467b556ddbeb334abb to your computer and use it in GitHub Desktop.
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index 6f07731a49..30d64531db 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -587,7 +587,7 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
}
// Charge the allocation against the G. We'll account
// for internal fragmentation at the end of mallocgc.
- assistG.gcAssistBytes -= int64(size)
+ assistG.gcAssistBytes = 1024
if assistG.gcAssistBytes < 0 {
// This G is in debt. Assist the GC to correct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment