Message ID | mcrk37v2618.fsf@iant-glaptop.roam.corp.google.com |
---|---|
State | New |
Headers | show |
diff -r a45b1aa17901 libgo/runtime/go-map-delete.c --- a/libgo/runtime/go-map-delete.c Tue Jul 01 16:18:58 2014 -0700 +++ b/libgo/runtime/go-map-delete.c Wed Jul 02 07:20:02 2014 -0700 @@ -8,6 +8,7 @@ #include <stdlib.h> #include "runtime.h" +#include "malloc.h" #include "go-alloc.h" #include "go-assert.h" #include "map.h" @@ -47,7 +48,8 @@ if (equalfn (key, entry + key_offset, key_size)) { *pentry = *(void **) entry; - __go_free (entry); + if (descriptor->__entry_size >= TinySize) + __go_free (entry); map->__element_count -= 1; break; }