summaryrefslogtreecommitdiff
path: root/libinterp
diff options
context:
space:
mode:
authorforsyth <forsyth@vitanuova.com>2011-10-03 19:15:19 +0100
committerforsyth <forsyth@vitanuova.com>2011-10-03 19:15:19 +0100
commit4d5741c99d03109e40fcb809811368ccd4aa911b (patch)
treefed61508666398be97aad69b8fb39095289155ef /libinterp
parent48cb024ae0359615b78f436c402069348cf5f332 (diff)
20111003-1915
Diffstat (limited to 'libinterp')
-rw-r--r--libinterp/heap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libinterp/heap.c b/libinterp/heap.c
index 1ac715f7..7da4b2df 100644
--- a/libinterp/heap.c
+++ b/libinterp/heap.c
@@ -158,7 +158,7 @@ freelist(Heap *h, int swept)
l = l->tail;
while(l != (List*)H) {
t = l->t;
- th = D2H((ulong)l);
+ th = D2H(l);
if(th->ref-- != 1)
break;
th->t->ref--; /* should be &Tlist and ref shouldn't go to 0 here nor be 0 already */
@@ -242,7 +242,7 @@ dtype(void (*destroy)(Heap*, int), int size, uchar *map, int mapsize)
{
Type *t;
- t = malloc(sizeof(Type)+mapsize);
+ t = malloc(sizeof(Type)-sizeof(t->map)+mapsize);
if(t != nil) {
t->ref = 1;
t->free = destroy;