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

Don't use refs for unmanaged bitmaps #84

Merged
merged 1 commit into from
Dec 28, 2024
Merged

Conversation

Nycto
Copy link
Collaborator

@Nycto Nycto commented Oct 19, 2024

This reduces the number of small memory allocations that happens when working with bitmaps. Bitmaps are split into two categories: managed and unmanaged. Unmanaged bitmaps are passed around by copying pointers, managed bitmaps are passed around using nim object refs.

Copy link
Collaborator

@ninovanhooff ninovanhooff left a comment

Choose a reason for hiding this comment

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

Hey thanks, seems this might improve both readability and performance somewhat.

I think I did find a pre-existing bug tho for a bitmap that should be managed

@Nycto Nycto changed the base branch from main to dev December 27, 2024 23:18
@Nycto
Copy link
Collaborator Author

Nycto commented Dec 27, 2024

@ninovanhooff I've updated to incorporate all your feedback. And you were right about the bitmask image. We may want to publish a new patch version that fixes that bug, as it's a fairly significant memory leak

@ninovanhooff
Copy link
Collaborator

@Nycto allright, would create a PR for the bitmask leak?

PS: I prefer no force-pushes, so that I can see what changed since the last review. If you want to keep a clean git history, perhaps squash merge?

@ninovanhooff ninovanhooff self-requested a review December 28, 2024 18:36
@Nycto
Copy link
Collaborator Author

Nycto commented Dec 28, 2024

I’ll skip the force push in the future— sorry about that. This change includes the bitmap fix, so once I merge I’ll cut a new release

@Nycto Nycto merged commit 862ce35 into samdze:dev Dec 28, 2024
4 checks passed
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