From 4d5741c99d03109e40fcb809811368ccd4aa911b Mon Sep 17 00:00:00 2001 From: forsyth Date: Mon, 3 Oct 2011 19:15:19 +0100 Subject: 20111003-1915 --- libinterp/heap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libinterp') 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; -- cgit v1.2.3