beatsaber-hook
beatsaber-hook copied to clipboard
Add more compile time C# typedefs
Now that ConstString
has made it into master and has some pretty significant benefits over previous methods of allocating manual strings (constexpr, entirely static memory, allocation-less, known AOT), it is perhaps a foregone conclusion that allowing this functionality for more types would be worthwhile.
The easiest compile-time typedef that I think would get the most value would be a compile-time Array/List implementation. List becomes a bit more tricky, but perhaps hardcoding the capacity to be what is used is what can make adds and removes applicable. (Akin to static_vector
) Ultimately, there should be some room for improvement, which, while it may be GC-unaware, can perhaps be made to be aware over a set of different ways, or perhaps with an early gc allocation (since we have access to that fairly early on, perhaps even before il2cpp_init
, just that we would have to scan for it)