Skip to content

udisksbasejob: change samples heap allocation to stack#1460

Open
GermanAizek wants to merge 1 commit into
storaged-project:masterfrom
GermanAizek:heap-to-stack
Open

udisksbasejob: change samples heap allocation to stack#1460
GermanAizek wants to merge 1 commit into
storaged-project:masterfrom
GermanAizek:heap-to-stack

Conversation

@GermanAizek
Copy link
Copy Markdown
Contributor

@tbzatek
Copy link
Copy Markdown
Member

tbzatek commented Feb 6, 2026

Jenkins, ok to test.

Copy link
Copy Markdown
Member

@tbzatek tbzatek left a comment

Choose a reason for hiding this comment

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

Well, this may look as an obvious candidate for microoptimization at first, but looking at how often the samples array is used, you'll realize this is a waste of precious memory (as you said yourself, RAM is very expensive nowadays!) in majority of the cases.

The point is that struct _UDisksBaseJobPrivate.samples array is only used in on_notify_progress() which gets connected only when the object property auto-estimate is set to TRUE (default = FALSE). Only the format-erase job uses that, as far as I was able to find.

So I wonder what was your point behind this - do you have some real world profiling numbers in hand supporting your changes?

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