Skip to content

Use caller_locations to reduce memory allocation#138

Merged
byroot merged 1 commit intobasecamp:masterfrom
fatkodima:caller-locations
Jan 10, 2024
Merged

Use caller_locations to reduce memory allocation#138
byroot merged 1 commit intobasecamp:masterfrom
fatkodima:caller-locations

Conversation

@fatkodima
Copy link
Contributor

Closes #137.
Added original author as a coauthor.

cc @byroot

Co-authored-by: Tai Do <tai.do@partech.com>
@byroot byroot merged commit 226f932 into basecamp:master Jan 10, 2024
@fatkodima fatkodima deleted the caller-locations branch January 10, 2024 21:42
@fatkodima
Copy link
Contributor Author

Thank you! ❤️ 🎉


last_line = caller.detect do |line|
line !~ Marginalia::Comment.lines_to_ignore
last_line = caller_locations.detect do |loc|

Choose a reason for hiding this comment

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

@fatkodima before I dive into it... did you ever look at using Thread.each_caller_location in this gem? I know you did in Rails but not sure if there was a reason to not do it here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

did you ever look at using Thread.each_caller_location in this gem?

I think I don't.

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.

3 participants