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

mutable.Queue of size 1 holds onto element after dequeue #6690

Closed
scabug opened this issue Nov 20, 2012 · 4 comments
Closed

mutable.Queue of size 1 holds onto element after dequeue #6690

scabug opened this issue Nov 20, 2012 · 4 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Nov 20, 2012

mutable.Queue is implemented by inheriting mutable.MutableList.

when an element is enqueued into an empty mutable.Queue, mutable.MutableList modifies the
first and last member variables to the only element in the queue. the dequeue method in mutable.Queue does not modify the value of last, so the queue holds onto the reference of the now dequeued element, which is a space-leak.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 20, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6690?orig=1
Reporter: Arya Asemanfar (aryaasemanfar)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 20, 2012

Arya Asemanfar (aryaasemanfar) said:
illustration of the bug: https://gist.github.com/4119194

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Dec 8, 2012

@retronym said:
Thanks for the precise report, Arya.

scala/scala#1732

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Dec 10, 2012

@scabug scabug closed this Dec 10, 2012
@scabug scabug added the has PR label Apr 7, 2017
@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.