Skip to content

Conversation

@fitzgen
Copy link
Member

@fitzgen fitzgen commented Jan 26, 2026

Part of #12069

@fitzgen fitzgen requested review from a team as code owners January 26, 2026 22:59
@fitzgen fitzgen requested review from cfallin and pchickey and removed request for a team January 26, 2026 22:59
@fitzgen fitzgen force-pushed the more-oom-handling-boxed-slice-ctors branch from 7d4e831 to de2a430 Compare January 26, 2026 23:01
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Jan 27, 2026
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Another possible idea:

  • One function to return fn(usize) -> Result<Box<[MaybeUninit<T>]>>
  • Another function fn(Iterator<T>, Box<[MaybeUninit<T>]>) -> Result<Box<[T]>>
  • Another function for a fallible iterator
  • Helper functions combining these together

@fitzgen
Copy link
Member Author

fitzgen commented Jan 27, 2026

Another possible idea:

  • One function to return fn(usize) -> Result<Box<[MaybeUninit<T>]>>

  • Another function fn(Iterator<T>, Box<[MaybeUninit<T>]>) -> Result<Box<[T]>>

  • Another function for a fallible iterator

  • Helper functions combining these together

This is sort of what we have, except we don't expose the second function publicly, just as an implementation detail.

What these proposed functions don't collectively cover, however, is when you have an unknown-length iterator, unless I am misunderstanding.

@fitzgen fitzgen force-pushed the more-oom-handling-boxed-slice-ctors branch from de2a430 to ec6e508 Compare January 27, 2026 19:13
@fitzgen
Copy link
Member Author

fitzgen commented Jan 27, 2026

Okay the boxed slice helpers are now implemented on top of our OOM-handling Vec and this PR now depends on #12452 (and therefore also #12448)

@fitzgen fitzgen requested a review from alexcrichton January 27, 2026 19:14
@fitzgen fitzgen force-pushed the more-oom-handling-boxed-slice-ctors branch from ec6e508 to bdcf42e Compare January 27, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants