diff options
author | Daniel Colascione <dancol@google.com> | 2019-09-03 13:42:23 -0700 |
---|---|---|
committer | Daniel Colascione <dancol@google.com> | 2019-09-03 18:27:57 -0700 |
commit | 82e97442fa38d7aad60fbc19a0df811cef4fbdf9 (patch) | |
tree | 4ed37024eb41cd46d312018a948cce6e2f6b9434 /startop/scripts/lib/cmd_utils.py | |
parent | b63ff32f531946a13d80f9340aaa8acf692cf145 (diff) |
Make android_os_Process_readProcFile allocate less
Make android_os_Process_readProcFile read small proc files into a
stack-allocated buffer and fall back to the heap only for larger
files. Avoid pointless zeroing of memory that we're going to use for
read() buffers. Read proc files atomically instead of
piece-by-piece. Use Android RAII helpers instead of explicit
resource management.
Bug: 140439982
Test: booted, works
Change-Id: Ifc02a4bbab0cfd968aff841d7ce0af846db613eb
Diffstat (limited to 'startop/scripts/lib/cmd_utils.py')
0 files changed, 0 insertions, 0 deletions