diff --git a/src/deemon/objects/list.c b/src/deemon/objects/list.c index bd4d3ae5c..3eee1dbbe 100644 --- a/src/deemon/objects/list.c +++ b/src/deemon/objects/list.c @@ -106,7 +106,10 @@ list_assign(List *me, DeeObject *other) { DeeList_LockEndWrite(me); /* Free the list state that got created while we loaded `other' */ - if unlikely(old_elemv) { +#ifndef __OPTIMIZE_SIZE__ + if unlikely(old_elemv) +#endif /* !__OPTIMIZE_SIZE__ */ + { Dee_Decrefv(old_elemv, old_elemc); Dee_Free(old_elemv); } diff --git a/src/deemon/objects/seq/fastseq.c b/src/deemon/objects/seq/fastseq.c index b6d1daa24..bad4491af 100644 --- a/src/deemon/objects/seq/fastseq.c +++ b/src/deemon/objects/seq/fastseq.c @@ -436,7 +436,7 @@ DeeSeq_AsHeapVectorWithAllocReuse(DeeObject *__restrict self, DeeObject **new_elemv, **elemv = *p_vector; DREF DeeObject *iterator, *elem; #ifdef Dee_MallocUsableSize - size_t elema = Dee_MallocUsableSize(elemv); + size_t elema = Dee_MallocUsableSize(elemv) / sizeof(DREF DeeObject *); #else /* Dee_MallocUsableSize */ size_t elema = *p_allocated; #endif /* !Dee_MallocUsableSize */ @@ -553,7 +553,7 @@ DeeSeq_AsHeapVectorWithAllocReuseOffset(DeeObject *__restrict self, DeeObject **new_elemv, **elemv = *p_vector; DREF DeeObject *iterator, *elem; #ifdef Dee_MallocUsableSize - size_t elema = Dee_MallocUsableSize(elemv); + size_t elema = Dee_MallocUsableSize(elemv) / sizeof(DREF DeeObject **); #else /* Dee_MallocUsableSize */ size_t elema = *p_allocated; #endif /* !Dee_MallocUsableSize */ @@ -572,7 +572,7 @@ DeeSeq_AsHeapVectorWithAllocReuseOffset(DeeObject *__restrict self, elemv = new_elemv; *p_vector = new_elemv; #ifndef Dee_MallocUsableSize - *p_allocated = offset + elemc; + *p_allocated = offset + elemc; #endif /* !Dee_MallocUsableSize */ } for (i = 0; i < elemc; ++i) {