Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

Related: #4615, #4615 (comment)

What's new?

This PR addresses a review discussion about whether std::make_unique<drmModePropertyRes>(id) correctly initializes the C struct. The code is correct as-is.

Technical clarification:

  • std::make_unique<T>(args...) uses direct initialization
  • For aggregate types like drmModePropertyRes, passing a single argument id initializes the first field (prop_id) with that value
  • Remaining fields are implicitly zero-initialized per C++11+ aggregate initialization rules
  • This is equivalent to std::make_unique<drmModePropertyRes>(drmModePropertyRes{id}) but more concise

The construction at line 138 correctly initializes prop_id to the provided id and zero-initializes all other struct members (flags, name, count_values, etc.).

How to test

No code changes - documentation/clarification only.

Checklist

  • Tests added and pass
  • Adequate documentation added
  • (optional) Added Screenshots or videos

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] WIP Address feedback on memory management fix Clarify aggregate initialization behavior in drmModePropertyRes construction Jan 9, 2026
Copilot AI requested a review from AlanGriffiths January 9, 2026 14:54
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