Skip to content

Conversation

@guillep
Copy link
Member

@guillep guillep commented Apr 4, 2023

Ephemerons with immediate keys should not fail

@guillep
Copy link
Member Author

guillep commented Apr 5, 2023

CI is green, timed out in windows...

@guillep guillep merged commit aede3fc into pharo-project:pharo-10 Apr 5, 2023
@guillep guillep deleted the fix/ephemeron-immediate-keys branch April 5, 2023 08:23
Comment on lines +420 to +435
VMSpurOldSpaceGarbageCollectorTest >> testEphemeronWithImmediateKeyShouldNotFail [

| ephemeron1 key |
ephemeron1 := self newEphemeronObjectWithSlots: 5.
self keepObjectInVMVariable1: ephemeron1.
key := memory integerObjectOf: 15.
memory storePointer: 0 ofObject: ephemeron1 withValue: key.

memory setCheckForLeaks: 63. "all"
memory fullGC.

self
assert:
(memory fetchInteger: 0 ofObject: self keptObjectInVMVariable1)
equals: 15
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why here the assertion says just 15 instead of key? @guillep

Copy link
Member Author

Choose a reason for hiding this comment

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

I did a fetchInteger:, to make sure the same value is there.
What would be the most readable?
I think in any case we will need a comment, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahhhh okkkkk. I don't think that a comment is needed, I just need to learn how to read 😅

Maybe having storeInteger: also would help with the symmetry.

@guillep guillep mentioned this pull request Apr 5, 2023
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