Skip to content

Commit

Permalink
Disable ref cnt instructions for weak ptrs
Browse files Browse the repository at this point in the history
  • Loading branch information
vtereshkov committed May 21, 2024
1 parent 1d8c313 commit c7d905e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion playground/umka.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/umka_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ int typeAlignment(Types *types, Type *type)

bool typeGarbageCollected(Type *type)
{
if (type->kind == TYPE_PTR || type->kind == TYPE_WEAKPTR || type->kind == TYPE_STR || type->kind == TYPE_MAP ||
if (type->kind == TYPE_PTR || type->kind == TYPE_STR || type->kind == TYPE_MAP ||
type->kind == TYPE_DYNARRAY || type->kind == TYPE_INTERFACE || type->kind == TYPE_CLOSURE || type->kind == TYPE_FIBER)
return true;

Expand Down
2 changes: 1 addition & 1 deletion src/umka_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static inline bool typeStructured(Type *type)

static inline bool typeKindGarbageCollected(TypeKind typeKind)
{
return typeKind == TYPE_PTR || typeKind == TYPE_WEAKPTR ||
return typeKind == TYPE_PTR ||
typeKind == TYPE_STR || typeKind == TYPE_ARRAY || typeKind == TYPE_DYNARRAY || typeKind == TYPE_MAP ||
typeKind == TYPE_STRUCT || typeKind == TYPE_INTERFACE || typeKind == TYPE_CLOSURE || typeKind == TYPE_FIBER;
}
Expand Down
3 changes: 0 additions & 3 deletions src/umka_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,9 +817,6 @@ static FORCE_INLINE void doBasicChangeRefCnt(Fiber *fiber, HeapPages *pages, voi
break;
}

case TYPE_WEAKPTR:
break;

case TYPE_STR:
{
doCheckStr((char *)ptr, pages->error);
Expand Down

0 comments on commit c7d905e

Please sign in to comment.