FAForever / FAForever/lua-lang

Pre-allocation syntax of tables

Đang mở
#7 0 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
1
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The Lua of the game supports pre-allocation syntax when you create a new table: `{&1&1}` where `1` can be any number. The numbers allow us to define the second and third argument of the `NEWTABLE` operation. For more information:
- https://www.lua.org/source/5.1/lopcodes.h.html

Previously no file with that syntax was part of the repository. But the `lazyvar.lua` file uses it: https://github.com/FAForever/fa/pull/3725 . It is also an interesting approach to get a 20% - 50% speed up on table allocations, according to benchmarks.

This compiler doesn't need to support the functionality. But it would be great if it would accept the syntax 😄 .

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.