Commit ce6301c
committed
combine PL_strategy_* bools into 1 exported symbol
These 9 symbols are just 2 bits wide bools. I presume each one is declared
as a 4 byte int because either they are lvals taking a 4 byte enum
assignment or because C doesn't acknowledge the SMP concept and doesn't
describe any unit tests for threads or SMP address spaces. ISO C stopped
describing what volatile and register do on a HW level long ago.
Considering all current former and future CPU archs Perl has executed on,
there is no money-back guarentee from all CPU mfgs that doing R/Ws to
the same mem addr by 2 CPU cores will not shard or be atomic.
As of 5.43, metaconfig and perl.h still don't know about the std::atomic
API that first appeared in C11/C++11. PL_strategy_* is required de-jure,
not de-facto, by C11/C++11 to be using the atomic_load() token. It is very
overkill to use the atomic_load() token on these PL_strategy_* vars.
atomic_load() can be added to PL_strategy_* after a verified and
reproduced bug ticket on the correct permutation of hardware and compiler
that needs it. Dr Memory, Asan, and Valgrind aren't hardware.
These 9 different exported linker symbols take up significant screen space
in various C dev tools. These vars will never be part of a copy paste
backtrace SEGV report. They are undocumented, not public CPAN API.
The only user is doio.c They take up alot of bytes inside of libperl
since symbol PL_strategy_mkstemp can't be smaller than
24 == (sizeof("PL_strategy_mkstemp") + sizeof(U32))
Dynamic instrumenting all dereferences of PL_strategy_dup but not
instrumenting PL_strategy_mkstemp, using LD_PRELOAD inside a
private + obsolete + proprietary + closed source + lost source build
of libperl.so ...
All of the PL_strategy_* symbols have no references to them on Win32.
The Win32 doio.o/doio.obj file doesn't link against the PL_strategy_*
symbols. They would've been discarded on Windows, but their names
appeared inside perldll.def so that is that and ABI is ABI.
The easiest step is to combine the symbols into 1 ascii C string name.
Any other improvements will be more complex and can be done another time.
This step is beneficial on all OS since the shared library loaders on all
OSes have to loop over the array of "Symbols" to connect 2 files,
or 2 User Services (TM IBM), or 2 Subroutines (TM Larry Wall) atleast once
on startup.
If this io_strategy code needs to be stepped debeg (unlikely) keeping all
the bools together in 1 struct is easier to see their state in the watch
window since its 1 name to type in vs 9 names.
The amount of vertical screen space these exported symbols occupy in
C devel tools if they are drawn, and need to be scrolled or glanced by,
or more partial match letters to type, vs what these syms/vars do
and the state they hold, is the main reason this commit was written.1 parent 52d9c9c commit ce6301c
4 files changed
+50
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
| 337 | + | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | | - | |
| 387 | + | |
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 69 | + | |
78 | 70 | | |
79 | 71 | | |
80 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5230 | 5230 | | |
5231 | 5231 | | |
5232 | 5232 | | |
| 5233 | + | |
| 5234 | + | |
| 5235 | + | |
| 5236 | + | |
| 5237 | + | |
| 5238 | + | |
| 5239 | + | |
| 5240 | + | |
| 5241 | + | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
| 5253 | + | |
| 5254 | + | |
| 5255 | + | |
| 5256 | + | |
| 5257 | + | |
| 5258 | + | |
| 5259 | + | |
| 5260 | + | |
| 5261 | + | |
5233 | 5262 | | |
5234 | 5263 | | |
5235 | 5264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
408 | 415 | | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
| 416 | + | |
418 | 417 | | |
419 | 418 | | |
420 | 419 | | |
0 commit comments