|
[Courgette] Refactor: Manage AssemblyProgram and EncodedProgram with scoped_ptr.
Previously naked pointers AssemblyProgram and EncodedProgram are used over the
place, and are deallocated using Delete{AssemblyProgram, EncodedProgram}().
In this CL we use scoped_ptr to manage the life cycles of these objects.
- Removed DeleteAssemblyProgram() and DeleteEncodedProgram() and replaced calls
with e.g., program.reset(nullptr); if the manual deallocation is a peak
memory optimization.
- Moved Encode() and ReadEncodedProgram() to the .h files matching the .cc files.
- Extracted DetectExecutableType() and ParseDetectedExecutable() from
disassembly.* to new files program_detector*c, since Disassembly is really an
implementation that caller's don't care about.
Committed: https://crrev.com/0a9cbf1781a114b35a4e0f4a834f2d24ade2e917
Cr-Commit-Position: refs/heads/master@{#372212}
Committed: https://crrev.com/8d5be25a65a341fcbd1b92a6856e8c71600a2bec
Cr-Commit-Position: refs/heads/master@{#372436}
Total comments: 18
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+322 lines, -302 lines) |
Patch |
|
M |
courgette/BUILD.gn
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
courgette/adjustment_method_unittest.cc
|
View
|
1
2
|
4 chunks |
+30 lines, -23 lines |
0 comments
|
Download
|
|
M |
courgette/assembly_program.h
|
View
|
1
2
3
|
3 chunks |
+9 lines, -2 lines |
0 comments
|
Download
|
|
M |
courgette/assembly_program.cc
|
View
|
1
2
|
7 chunks |
+22 lines, -28 lines |
0 comments
|
Download
|
|
M |
courgette/courgette.h
|
View
|
|
2 chunks |
+1 line, -35 lines |
0 comments
|
Download
|
|
M |
courgette/courgette.gyp
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
courgette/courgette_tool.cc
|
View
|
1
2
|
9 chunks |
+43 lines, -36 lines |
0 comments
|
Download
|
|
M |
courgette/disassembler.cc
|
View
|
|
1 chunk |
+0 lines, -93 lines |
0 comments
|
Download
|
|
M |
courgette/encode_decode_unittest.cc
|
View
|
1
2
|
3 chunks |
+16 lines, -11 lines |
0 comments
|
Download
|
|
M |
courgette/encoded_program.h
|
View
|
1
2
3
|
2 chunks |
+7 lines, -0 lines |
0 comments
|
Download
|
|
M |
courgette/encoded_program.cc
|
View
|
1
2
|
4 chunks |
+10 lines, -14 lines |
0 comments
|
Download
|
|
M |
courgette/encoded_program_fuzz_unittest.cc
|
View
|
1
2
3
4
|
5 chunks |
+15 lines, -13 lines |
0 comments
|
Download
|
|
M |
courgette/encoded_program_unittest.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
courgette/ensemble.cc
|
View
|
|
2 chunks |
+1 line, -3 lines |
0 comments
|
Download
|
|
M |
courgette/patch_generator_x86_32.h
|
View
|
1
2
3
|
4 chunks |
+23 lines, -27 lines |
0 comments
|
Download
|
|
M |
courgette/patcher_x86_32.h
|
View
|
1
2
|
3 chunks |
+12 lines, -14 lines |
0 comments
|
Download
|
|
A |
courgette/program_detector.h
|
View
|
1
|
1 chunk |
+43 lines, -0 lines |
0 comments
|
Download
|
|
A |
courgette/program_detector.cc
|
View
|
1
2
|
1 chunk |
+85 lines, -0 lines |
0 comments
|
Download
|
|
M |
testing/libfuzzer/fuzzers/courgette_fuzzer.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
Total messages: 53 (22 generated)
|