Commit 06e2a85
Use cmd_args
Summary:
Refactors `get_framework_linker_args` and `_get_unchecked_framework_linker_args` to return `cmd_args` instead of `list[str]`, and uses `cmd_args(format=)` for library linker flags.
This avoids intermediate list allocations and leverages `cmd_args` composability — the unchecked path collapses from a loop with two appends per framework into a single `cmd_args(framework_names, prepend="-framework")`.
To measure the memory usage I ran:
```
$ buck2 kill
$ buck2 audit providers igios-no-extensions fbios-no-extensions --quiet
$ buck2 debug allocator-stats
```
Memory impact (jemalloc stats, before vs after):
- `allocated` is essentially unchanged (+31 MiB / +0.08% out of ~39 GiB), so the real heap footprint didn't move.
- `resident` (RSS) dropped by 1.6 GiB (-3.4%), from 47.6 GiB to 46.0 GiB, due to jemalloc's background purge thread reclaiming dirty pages more effectively.
- `retained` grew by 1.5 GiB (+5.9%), which is the mirror image — jemalloc kept the virtual address space mappings but released the physical pages back to the OS. This is free on 64-bit and allows cheap reuse without new mmap syscalls.
- `active / allocated` ratio (fragmentation) is stable at ~1.13x in both cases.
Overall: neutral to slightly positive. No regression in allocation pressure, improved RSS, no concerning tradeoffs.
Reviewed By: rmaz
Differential Revision: D92996049
fbshipit-source-id: 04e9fa2234b9c144fd9e0ccb4dac0e12a0f9f9c31 parent c2f4f74 commit 06e2a85
File tree
2 files changed
+9
-16
lines changed- prelude/apple
2 files changed
+9
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1129 | 1129 | | |
1130 | 1130 | | |
1131 | 1131 | | |
1132 | | - | |
| 1132 | + | |
1133 | 1133 | | |
1134 | 1134 | | |
1135 | 1135 | | |
| |||
1145 | 1145 | | |
1146 | 1146 | | |
1147 | 1147 | | |
1148 | | - | |
| 1148 | + | |
1149 | 1149 | | |
1150 | 1150 | | |
1151 | 1151 | | |
| |||
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | | - | |
| 1159 | + | |
1160 | 1160 | | |
1161 | | - | |
| 1161 | + | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | | - | |
| 1164 | + | |
1165 | 1165 | | |
1166 | | - | |
| 1166 | + | |
1167 | 1167 | | |
1168 | 1168 | | |
1169 | 1169 | | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
| 1170 | + | |
| 1171 | + | |
1177 | 1172 | | |
1178 | 1173 | | |
1179 | 1174 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 65 | + | |
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
| |||
0 commit comments