Skip to content

[stdlib] Slab #76438

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 15 commits into from
Jan 12, 2025
Merged

[stdlib] Slab #76438

merged 15 commits into from
Jan 12, 2025

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented Sep 12, 2024

This PR adds a new type to the standard library Slab who is a fixed size array. One can define a value of Slab like so:

var numbers = Slab<3, Int>(repeating: 0)
numbers[0] = 1
numbers[1] = 2
numbers[2] = 3

print(numbers.description) // "[1, 2, 3]"

@Azoy Azoy added standard library Area: Standard library umbrella swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal labels Sep 12, 2024
@Azoy Azoy requested review from a team, rjmccall, hborla, slavapestov and xedin as code owners September 12, 2024 21:05
@Azoy Azoy marked this pull request as draft September 12, 2024 21:06
@Azoy
Copy link
Contributor Author

Azoy commented Sep 12, 2024

Whoops, meant to mark this as a draft, sorry for the pings everyone!

@Azoy
Copy link
Contributor Author

Azoy commented Sep 12, 2024

@swift-ci please build toolchain

1 similar comment
@Azoy
Copy link
Contributor Author

Azoy commented Oct 15, 2024

@swift-ci please build toolchain

@Azoy
Copy link
Contributor Author

Azoy commented Nov 5, 2024

@swift-ci please build toolchain

@Azoy Azoy force-pushed the vector branch 2 times, most recently from 334ffd6 to 7f57ca9 Compare November 8, 2024 02:35
@Azoy
Copy link
Contributor Author

Azoy commented Nov 8, 2024

@swift-ci please build toolchain

@Azoy
Copy link
Contributor Author

Azoy commented Nov 8, 2024

@swift-ci please build toolchain macOS

@Azoy
Copy link
Contributor Author

Azoy commented Nov 13, 2024

@swift-ci please build toolchain macOS

@Jumhyn
Copy link
Member

Jumhyn commented Nov 14, 2024

@swift-ci please build toolchain Linux

@Jumhyn
Copy link
Member

Jumhyn commented Nov 14, 2024

@swift-ci please build toolchain Windows

@Azoy
Copy link
Contributor Author

Azoy commented Dec 3, 2024

@swift-ci please build toolchain

@Azoy
Copy link
Contributor Author

Azoy commented Dec 3, 2024

@swift-ci please build toolchain

@Azoy
Copy link
Contributor Author

Azoy commented Jan 9, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Jan 9, 2025

@swift-ci please build toolchain

Copy link
Contributor

@glessard glessard left a comment

Choose a reason for hiding this comment

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

Minor niggles. 🎉

@ahoppen ahoppen removed their request for review January 9, 2025 21:53
@rintaro rintaro removed their request for review January 9, 2025 23:12
@Azoy Azoy requested a review from xymus as a code owner January 9, 2025 23:55
@Azoy
Copy link
Contributor Author

Azoy commented Jan 9, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Jan 9, 2025

@swift-ci please build toolchain

@@ -333,7 +333,7 @@ namespace {
baseObjTy = baseObjTy->getWithoutSpecifierType();
}

if (baseObjTy->isArrayType()) {
if (auto elementTy = baseObjTy->isArrayType()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We really gotta rename this to getAsArrayType or something

@Azoy
Copy link
Contributor Author

Azoy commented Jan 11, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Jan 11, 2025

@swift-ci please build toolchain macOS

@Azoy
Copy link
Contributor Author

Azoy commented Jan 12, 2025

@swift-ci please test

@Azoy Azoy merged commit 09d122a into swiftlang:main Jan 12, 2025
5 checks passed
@Azoy Azoy deleted the vector branch January 12, 2025 18:36
@xedin
Copy link
Contributor

xedin commented Jan 12, 2025

These changes have implications to how literals are handled by the solver, I think a better way to model this lieral -> slab interaction would be a conversion restriction .

@Azoy
Copy link
Contributor Author

Azoy commented Jan 12, 2025

@xedin I can address this as a followup this week if that's ok?

@xedin
Copy link
Contributor

xedin commented Jan 12, 2025

Sure, sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
standard library Area: Standard library umbrella
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants