You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To simplify List that currently take 2 parameters: type and is_trivial_hint,
it could also be useful in InlinedFixedVector.__del__ 👍
This can also be used to do perf optimizations in the library (e.g. know whether we can use memcpy instead of copy, etc - see various C++ STL algorithms for inspiration here).
Any other details?
No response
The text was updated successfully, but these errors were encountered:
Unfortunately, I don't think it's quite that simple as you've shown in your example. In the compiler, we know if the type is "trivial", but we don't have sufficient information to do this in the library. Reassigning to the compiler team, but do know I requested this a month or two back during Gabriel's string optimization work.
Just like all types inherit from AnyType, I think you'd want types (in the stdlib and user defined types) to implicitly conform to Trivial for example based on the triviality bit known in the front end for a given type.
Review Mojo's priorities
What is your request?
It would be nice to have a function that check if an
AnyRegType
becameAnyType
:What is your motivation for this change?
To simplify
List
that currently take 2 parameters:type
andis_trivial_hint
,it could also be useful in
InlinedFixedVector.__del__
👍This can also be used to do perf optimizations in the library (e.g. know whether we can use memcpy instead of copy, etc - see various C++ STL algorithms for inspiration here).
Any other details?
No response
The text was updated successfully, but these errors were encountered: