[PR #11487] [MERGED] Remove last remaining winrt::hstring allocation during text output #28605

Open
opened 2026-01-31 09:29:36 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11487
Author: @lhecker
Created: 10/12/2021
Status: ✅ Merged
Merged: 10/18/2021
Merged by: @carlos-zamora

Base: main ← Head: dev/lhecker/winrt-runtime-allocations


📝 Commits (1)

  • 104b445 Remove last remaining winrt::hstring allocation during text output

📊 Changes

2 files changed (+10 additions, -4 deletions)

View changed files

📝 src/cascadia/TerminalControl/ControlCore.cpp (+9 -4)
📝 src/cascadia/TerminalControl/ControlCore.h (+1 -0)

📄 Description

ControlCore::FontFaceName() is called 10/s by TSFInputControl.
The getter was modified to cache the STL string in a hstring allowing
us to return a value without temporary allocations during runtime.

PR Checklist

  • I work here
  • Tests added/passed

Validation Steps Performed

  • Font face and size changes properly update TSFInputControl ✔️

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/11487 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 10/12/2021 **Status:** ✅ Merged **Merged:** 10/18/2021 **Merged by:** [@carlos-zamora](https://github.com/carlos-zamora) **Base:** `main` ← **Head:** `dev/lhecker/winrt-runtime-allocations` --- ### 📝 Commits (1) - [`104b445`](https://github.com/microsoft/terminal/commit/104b445ad7c351a97f654a18dd37c7e037515c3e) Remove last remaining winrt::hstring allocation during text output ### 📊 Changes **2 files changed** (+10 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+9 -4) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+1 -0) </details> ### 📄 Description ControlCore::FontFaceName() is called 10/s by TSFInputControl. The getter was modified to cache the STL string in a hstring allowing us to return a value without temporary allocations during runtime. ## PR Checklist * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Font face and size changes properly update TSFInputControl ✔️ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:29:36 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28605