This repository has been archived by the owner on Feb 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Implement REPR instance marking/freeing, so that slot mapping tables …
…won't go missing and anonymous types won't leak memory.
- Loading branch information
Showing
8 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,20 @@ | ||
| #include "../metamodel/rakudoobject.h" | ||
|
|
||
| /* A representation is responsible for object layout. Representations | ||
| * all fill out a REPR struct and maybe have one of their own with some | ||
| * extra bits of information in it. This PMC is simply a wrapper around | ||
| * a REPR for the purposes of GC, etc. It's up to the REPR to set the | ||
| * PMC up as it wishes. */ | ||
| pmclass REPR manual_attrs dynpmc group nqp { | ||
| /* XXX Needs custom mark/destroy implementing. */ | ||
| VTABLE void mark() { | ||
| REPRCommonalities *repr = REPR_STRUCT(SELF); | ||
| if (repr->gc_mark_repr) | ||
| repr->gc_mark_repr(interp, SELF); | ||
| } | ||
|
|
||
| VTABLE void destroy() { | ||
| REPRCommonalities *repr = REPR_STRUCT(SELF); | ||
| if (repr->gc_free_repr) | ||
| repr->gc_free_repr(interp, SELF); | ||
| } | ||
| } |