Skip to content

[Runtime] Refactor layout string runtime functions to simplify future… #66105

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

Merged
merged 1 commit into from
May 26, 2023

Conversation

drexin
Copy link
Contributor

@drexin drexin commented May 24, 2023

… specialization work

rdar://109787818

Templatized and abstracted handling of layout strings to simplify future specializations. E.g. specilizing for a particular number of reference count operations can be done by passing the expected size as a template param:

extern "C" void
swift_generic_destroy_2(swift::OpaqueValue *address, const Metadata *metadata) {
  handleRefCounts<2, DestroyHandler>(metadata, (uint8_t *)address);
}

@drexin drexin requested a review from mikeash May 24, 2023 18:51
@drexin
Copy link
Contributor Author

drexin commented May 24, 2023

@swift-ci smoke test

@drexin
Copy link
Contributor Author

drexin commented May 24, 2023

Waiting for #66112 before merging.

… specialization work

rdar://109787818

Templatized and abstracted handling of layout strings to simplify future specializations. E.g. specilizing for a particular number of reference count operations can be done by passing the expected size as a template param:

```
extern "C" void
swift_generic_destroy_2(swift::OpaqueValue *address, const Metadata *metadata) {
  handleRefCounts<2, DestroyHandler>(metadata, (uint8_t *)address);
}
```
@drexin
Copy link
Contributor Author

drexin commented May 25, 2023

@swift-ci smoke test

1 similar comment
@drexin
Copy link
Contributor Author

drexin commented May 25, 2023

@swift-ci smoke test

@drexin
Copy link
Contributor Author

drexin commented May 26, 2023

@swift-ci smoke test macos

@drexin drexin merged commit 658f0ea into swiftlang:main May 26, 2023
@drexin drexin deleted the wip-109787818 branch May 26, 2023 15:31
NuriAmari pushed a commit to NuriAmari/swift that referenced this pull request May 28, 2023
… specialization work (swiftlang#66105)

rdar://109787818

Templatized and abstracted handling of layout strings to simplify future specializations. E.g. specilizing for a particular number of reference count operations can be done by passing the expected size as a template param:

```
extern "C" void
swift_generic_destroy_2(swift::OpaqueValue *address, const Metadata *metadata) {
  handleRefCounts<2, DestroyHandler>(metadata, (uint8_t *)address);
}
```
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.

1 participant