Skip to content

Commit

Permalink
free_export_symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Jan 10, 2025
1 parent e04890d commit f131a8a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions compiler/free.jou
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import "stdlib/mem.jou"
import "./types.jou"
import "./typecheck/common.jou"

def free_export_symbol(es: ExportSymbol*) -> None:
if es->kind == ExportSymbolKind::Function:
es->funcsignature.free()

def free_file_types(ft: FileTypes*) -> None:
for t = ft->owned_types; t < &ft->owned_types[ft->n_owned_types]; t++:
free_type(*t)
Expand Down
2 changes: 1 addition & 1 deletion compiler/main.jou
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class CompileState:

for i = 0; i < self->nfiles; i++:
for es = pending_exports[i]; es->name[0] != '\0'; es++:
free_export_symbol(es)
es->free()
free(pending_exports[i])
pending_exports[i] = NULL

Expand Down
4 changes: 4 additions & 0 deletions compiler/typecheck/common.jou
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class ExportSymbol:
funcsignature: Signature
type: Type* # ExportSymbolKind::Type and ExportSymbolKind::GlobalVar

def free(self) -> None:
if self->kind == ExportSymbolKind::Function:
self->funcsignature.free()


# Type information about a function or method defined in the current file.
# Not created for anything imported from another file.
Expand Down

0 comments on commit f131a8a

Please sign in to comment.