Commit e2e216c
committed
feat: allow freeing of ustring table for debugging cases
This patch optionally frees the contents of the ustring table as the
process is exiting. It's triggered one of two ways:
- `OIIO::attribute("ustring:cleanup", 1);`
- Environment variable `OIIO_USTRING_CLEANUP=1`
If neither is used, the teardown won't happen, thus avoiding any
pointless work when it should be exiting the process.
The purpose of this is that when using certain debugging tools, the
ustring table (which only grows and never frees) looks like a memory
leak, even though it's by design. Someimes, it's useful to make it not
appear ot leak, and you are happy for a large table to spend time
pointlessly freeing all the data.
Fixes 3913
Signed-off-by: Larry Gritz <lg@larrygritz.com>1 parent df6c3ea commit e2e216c
4 files changed
Lines changed: 69 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3968 | 3968 | | |
3969 | 3969 | | |
3970 | 3970 | | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
3971 | 3980 | | |
3972 | 3981 | | |
3973 | 3982 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
376 | 380 | | |
377 | 381 | | |
378 | 382 | | |
| |||
447 | 451 | | |
448 | 452 | | |
449 | 453 | | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
474 | 478 | | |
475 | 479 | | |
476 | 480 | | |
| |||
511 | 515 | | |
512 | 516 | | |
513 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
514 | 522 | | |
515 | 523 | | |
516 | 524 | | |
| |||
649 | 657 | | |
650 | 658 | | |
651 | 659 | | |
652 | | - | |
653 | | - | |
| 660 | + | |
| 661 | + | |
654 | 662 | | |
655 | 663 | | |
656 | 664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
15 | 34 | | |
16 | 35 | | |
17 | 36 | | |
| |||
43 | 62 | | |
44 | 63 | | |
45 | 64 | | |
| 65 | + | |
46 | 66 | | |
47 | 67 | | |
48 | 68 | | |
49 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
50 | 85 | | |
51 | 86 | | |
52 | 87 | | |
| |||
187 | 222 | | |
188 | 223 | | |
189 | 224 | | |
190 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
191 | 228 | | |
192 | 229 | | |
193 | 230 | | |
194 | 231 | | |
195 | 232 | | |
196 | 233 | | |
| 234 | + | |
197 | 235 | | |
198 | 236 | | |
199 | 237 | | |
| |||
207 | 245 | | |
208 | 246 | | |
209 | 247 | | |
| 248 | + | |
210 | 249 | | |
211 | 250 | | |
212 | 251 | | |
| |||
0 commit comments