Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug in type hashconsing #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

deyaaeldeen
Copy link
Member

@deyaaeldeen deyaaeldeen commented Apr 8, 2020

The index field in types was not being updated correctly. Before the fix, 0 was written to the index field, regardless of the current value of types_unique_index_counter, because Types-gen-index! has side effects and its result is not written to the variable.

Furthermore, I decreased some code bloat by taking advantage of uniform memory layout of structural types.

Finally, I fixed a memory leak when resizing the types hashconsing table.

@deyaaeldeen deyaaeldeen force-pushed the fix-hashcons branch 2 times, most recently from dc2a7a6 to 26c895a Compare April 8, 2020 14:14
@deyaaeldeen deyaaeldeen marked this pull request as ready for review April 8, 2020 14:18
Copy link
Collaborator

@akuhlens akuhlens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@@ -136,7 +136,8 @@
(Array-set! #t ((Array Obj) Int Obj -> Unit))
(Array-ref #f ((Array Obj) Int -> Obj))
(Types-hashcons! #t (Type -> Type))
(Types-gen-index! #t (Type -> Unit))
(Types-gen-index! #t (-> Unit))
(get-types-hashcons-index #f (-> Int))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this left in by mistake?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants