aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2014-07-02 14:23:45 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-07-02 14:23:45 +0000
commit9490fda67a801ad2618849b2d3a60b920d3713ca (patch)
treeb1f7f5b6fb32131dd3b18b057a6e9ac979581aca /libgo
parent513c5c74ce490ee5fb4ca88585808f44065ec57a (diff)
downloadgcc-9490fda67a801ad2618849b2d3a60b920d3713ca.zip
gcc-9490fda67a801ad2618849b2d3a60b920d3713ca.tar.gz
gcc-9490fda67a801ad2618849b2d3a60b920d3713ca.tar.bz2
re PR go/61620 (FAIL: go.test/test/fixedbugs/bug242.go execution, -O2 -g)
PR go/61620 runtime: Don't free tiny blocks in map deletion. The memory allocator now has a special case for tiny blocks (smaller than 16 bytes) and they can not be explicitly freed. From-SVN: r212233
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-map-delete.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgo/runtime/go-map-delete.c b/libgo/runtime/go-map-delete.c
index f8f8907..de8b046 100644
--- a/libgo/runtime/go-map-delete.c
+++ b/libgo/runtime/go-map-delete.c
@@ -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 @@ __go_map_delete (struct __go_map *map, const void *key)
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;
}