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
"summary": "High-performance array-based list using static shared storage per type.\nIn most cases, a LinkedList is a better choice due to its flexibility.\nThis data structure is only recommended for performance-critical code\nand requires careful use to avoid fragmentation.\n\nWHEN TO USE:\n===========\nArrayList is faster than LinkedList for:\n- Iterating large lists (1000+ elements) - no node indirection\n- Index based operations - O(1) vs O(n)\n- When only appending elements to the end\n\nLinkedList is better for:\n- Insertion anywhere except the end of the list\n- Deletions while retaining order\n- Unknown size requirements\n- No resize performance risk\n\nTYPE SYSTEM IMPLICATIONS:\n========================\nEach ArrayList<T> type gets its own static storage array.\n- ArrayList<int>, ArrayList<unit>, ArrayList<string> = 3 separate arrays\n- On the Jass target each type holds up to JASS_MAX_ARRAY_SIZE elements total across all\n instances (the Lua target grows dynamically and is not bounded by this)\n\nChoose wisely based on how many types you have.\n\nPERFORMANCE RULES:\n==================\n\n1. PRESIZE, DON'T RESIZE\n Bad: new ArrayList<int>() // Might resize multiple times\n Good: new ArrayList<int>(maxSize) // One allocation\n\n Why: Resize operations copy ALL elements to new memory. Expensive!\n\n2. REUSE, DON'T RECREATE\n Bad: In loop `let temp = new ArrayList<int>() ... destroy temp`\n Good: `let temp = new ArrayList<int>() ... temp.clear()` in loop\n\n Why: Allocation/Deallocation is moderately expensive and causes fragmentation\n\n3. ORDERED REMOVAL IS SLOW\n Bad: list.removeAt(i) // O(n) - shifts all elements\n Good: list.removeAtUnordered(i) // O(1) - swaps with last element\n\n Only use removeAtUnordered() if order doesn't matter\n\n4. ITERATE BY INDEX\n Good: for i = 0 to list.size()-1 // Zero allocation\n Good: list[i] // Indexing operator\n\n ArrayList has no iterator by design - index loops keep hot paths\n allocation-free.\n\n5. AVOID FREQUENT INSERTS AT START\n Bad: list.addtoStart(x) // O(n) every time\n Good: Use LinkedList or add in reverse order\n\nPERFORMANCE TABLE:\n==================\nOperation | ArrayList | LinkedList | Notes\n-------------------|-----------|------------|---------------------------\nadd(elem) | O(1)* | O(1) | *O(n) on resize!\naddtoStart(elem) | O(n) | O(1) | Shifts all elements\nget(index) | O(1) | O(n) | Major ArrayList advantage\nremoveAt(index) | O(n) | O(1) | Shifts remaining elements\nremoveAtUnordered | O(1) | N/A | Doesn't preserve order\nIterate all | Faster | Fast | LinkedList does double the work, but is still fast\nMemory per element | 1 slot | 3 slots | Element + 2 pointers\nCreate/destroy | Varies | High | AL might need memory management, LL needs to process Nodes\n\nMEMORY MANAGEMENT:\n==================\nArrayList uses section allocation in a shared static array per type.\nDestroyed lists return sections to a free pool for reuse.\nFree sections are compacted to reduce fragmentation.\n\nFragmentation occurs when lists grow - the old section becomes a gap.\nThis is why presizing matters: growth = copy to new location = wasted space.\n\nHard limit (wc3 / Jass native target): the shared store is a fixed-size array, so it is\nbounded by JASS_MAX_ARRAY_SIZE total slots per type across all live instances; exceeding\nit raises an error. On the Lua target the store is a dynamically growing table, so the\ncap does not apply - allocateStorage branches on the magic isLua constant and skips the\nerror. ArrayList's added value on Lua is keeping element types static instead of relying\non typecasting.",
108733
-
"summaryFirstLine": "High-performance array-based list using static shared storage per type.",
108734
-
"tags": [
108735
-
"collection",
108736
-
"data",
108737
-
"list"
108738
-
],
108739
-
"imports": [],
108740
-
"entities": [
108741
-
{
108742
-
"kind": "class",
108743
-
"name": "ArrayList",
108744
-
"typeParams": "<T:>",
108745
-
"receiver": null,
108746
-
"signature": "public class ArrayList<T:>",
108747
-
"doc": "",
108748
-
"deprecated": {
108749
-
"flag": false,
108750
-
"message": null
108751
-
},
108752
-
"configurable": false,
108753
-
"members": [],
108754
-
"enumMembers": [],
108755
-
"line": 98
108756
-
},
108757
-
{
108758
-
"kind": "function",
108759
-
"name": "asArrayList",
108760
-
"typeParams": "<T:>",
108761
-
"receiver": null,
108762
-
"signature": "public function asArrayList<T:>(vararg T ts) returns ArrayList<T>",
"signature": "public function ArrayList<int>.sort()",
108875
-
"doc": "",
108876
-
"deprecated": {
108877
-
"flag": false,
108878
-
"message": null
108879
-
},
108880
-
"configurable": false,
108881
-
"members": [],
108882
-
"enumMembers": [],
108883
-
"line": 643
108884
-
},
108885
-
{
108886
-
"kind": "extension-function",
108887
-
"name": "sort",
108888
-
"typeParams": "",
108889
-
"receiver": "ArrayList<real>",
108890
-
"signature": "public function ArrayList<real>.sort()",
108891
-
"doc": "",
108892
-
"deprecated": {
108893
-
"flag": false,
108894
-
"message": null
108895
-
},
108896
-
"configurable": false,
108897
-
"members": [],
108898
-
"enumMembers": [],
108899
-
"line": 647
108900
-
},
108901
-
{
108902
-
"kind": "extension-function",
108903
-
"name": "sort",
108904
-
"typeParams": "",
108905
-
"receiver": "ArrayList<string>",
108906
-
"signature": "public function ArrayList<string>.sort()",
108907
-
"doc": "",
108908
-
"deprecated": {
108909
-
"flag": false,
108910
-
"message": null
108911
-
},
108912
-
"configurable": false,
108913
-
"members": [],
108914
-
"enumMembers": [],
108915
-
"line": 651
108916
-
},
108917
-
{
108918
-
"kind": "extension-function",
108919
-
"name": "joinBy",
108920
-
"typeParams": "",
108921
-
"receiver": "ArrayList<string>",
108922
-
"signature": "public function ArrayList<string>.joinBy(string separator) returns string",
108923
-
"doc": "Joins elements from a string list into one string using a separator",
108924
-
"deprecated": {
108925
-
"flag": false,
108926
-
"message": null
108927
-
},
108928
-
"configurable": false,
108929
-
"members": [],
108930
-
"enumMembers": [],
108931
-
"line": 659
108932
-
},
108933
-
{
108934
-
"kind": "extension-function",
108935
-
"name": "join",
108936
-
"typeParams": "",
108937
-
"receiver": "ArrayList<string>",
108938
-
"signature": "public function ArrayList<string>.join() returns string",
108939
-
"doc": "Joins elements from a string list into one string",
108940
-
"deprecated": {
108941
-
"flag": false,
108942
-
"message": null
108943
-
},
108944
-
"configurable": false,
108945
-
"members": [],
108946
-
"enumMembers": [],
108947
-
"line": 668
108948
-
},
108949
-
{
108950
-
"kind": "extension-function",
108951
-
"name": "op_index",
108952
-
"typeParams": "<T>",
108953
-
"receiver": "ArrayList<T>",
108954
-
"signature": "public function ArrayList<T>.op_index<T>(int index) returns T",
108955
-
"doc": "",
108956
-
"deprecated": {
108957
-
"flag": false,
108958
-
"message": null
108959
-
},
108960
-
"configurable": false,
108961
-
"members": [],
108962
-
"enumMembers": [],
108963
-
"line": 672
108964
-
},
108965
-
{
108966
-
"kind": "extension-function",
108967
-
"name": "op_indexAssign",
108968
-
"typeParams": "<T>",
108969
-
"receiver": "ArrayList<T>",
108970
-
"signature": "public function ArrayList<T>.op_indexAssign<T>(int index, T value)",
108971
-
"doc": "",
108972
-
"deprecated": {
108973
-
"flag": false,
108974
-
"message": null
108975
-
},
108976
-
"configurable": false,
108977
-
"members": [],
108978
-
"enumMembers": [],
108979
-
"line": 675
108980
-
}
108981
-
]
108982
-
},
108983
108726
{
108984
108727
"package": "BitSet",
108985
108728
"category": "data",
@@ -154542,7 +154285,40 @@
154542
154285
"message": null
154543
154286
},
154544
154287
"configurable": false,
154545
-
"members": [],
154288
+
"members": [
154289
+
{
154290
+
"kind": "function",
154291
+
"name": "commandButton",
154292
+
"typeParams": "",
154293
+
"receiver": null,
154294
+
"signature": "static function commandButton(int index) returns string",
154295
+
"doc": "Name of a command card button, index 0 to 11 (1.32+): 0 is the top-left (0,0) button, 11 the\n\t\tbottom-right (3,2). Move/hide via these named frames, not ORIGIN_FRAME_COMMAND_BUTTON (moving\n\t\tthe origin frames glitches in 1.32+). NOTE: command buttons reappear/update on every unit\n\t\tselection, even while hidden via BlzHideOriginFrames - re-hide on selection if needed.",
154296
+
"deprecated": {
154297
+
"flag": false,
154298
+
"message": null
154299
+
},
154300
+
"configurable": false,
154301
+
"members": [],
154302
+
"enumMembers": [],
154303
+
"line": 103
154304
+
},
154305
+
{
154306
+
"kind": "function",
154307
+
"name": "inventoryButton",
154308
+
"typeParams": "",
154309
+
"receiver": null,
154310
+
"signature": "static function inventoryButton(int index) returns string",
154311
+
"doc": "Name of an inventory item button, index 0 to 5 (1.32+). Move/hide via these named frames, not\n\t\tORIGIN_FRAME_ITEM_BUTTON (moving the origin frames glitches in 1.32+). NOTE: like command\n\t\tbuttons, they reappear/update on every unit selection.",
0 commit comments