Commit e669b61
pcre2test: memory reports only compiled memory usage for code/data (#418)
Cherry-pick of 5790662.
Since 05aafb2 (Implement pcre2_set_max_pattern_compiled_length() and set
this limit in the fuzzer, 2024-04-24), the memory modifier has reported
the full size of the allocated "code" returned by `pcre2_compile`.
Problem is that the size of the structure used to hold that in memory also
depends on the platform ABI and even alignment by the compiler, and has
been therefore fragile to compare.
Revert to reporting only the additional memory that `pcre2_compile()` will
use for the compiled pattern (including any data tables) and make sure
that the limit provided with `pcre2_set_max_pattern_compiled_length()`
also avoid the internal struct overhead.
Fixes: #4151 parent 6ae58be commit e669b61
File tree
12 files changed
+546
-1022
lines changed- doc
- src
- testdata
12 files changed
+546
-1022
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10608 | 10608 | | |
10609 | 10609 | | |
10610 | 10610 | | |
10611 | | - | |
10612 | | - | |
| 10611 | + | |
10613 | 10612 | | |
10614 | 10613 | | |
10615 | 10614 | | |
| |||
10618 | 10617 | | |
10619 | 10618 | | |
10620 | 10619 | | |
| 10620 | + | |
10621 | 10621 | | |
10622 | 10622 | | |
10623 | 10623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4397 | 4397 | | |
4398 | 4398 | | |
4399 | 4399 | | |
4400 | | - | |
| 4400 | + | |
4401 | 4401 | | |
4402 | 4402 | | |
4403 | 4403 | | |
| |||
4417 | 4417 | | |
4418 | 4418 | | |
4419 | 4419 | | |
4420 | | - | |
4421 | | - | |
| 4420 | + | |
| 4421 | + | |
| 4422 | + | |
4422 | 4423 | | |
4423 | | - | |
4424 | | - | |
4425 | | - | |
4426 | | - | |
| 4424 | + | |
| 4425 | + | |
| 4426 | + | |
| 4427 | + | |
4427 | 4428 | | |
4428 | 4429 | | |
4429 | 4430 | | |
4430 | 4431 | | |
4431 | | - | |
| 4432 | + | |
4432 | 4433 | | |
4433 | 4434 | | |
4434 | 4435 | | |
| |||
0 commit comments