commit | 82e97442fa38d7aad60fbc19a0df811cef4fbdf9 | [log] [tgz] |
---|---|---|
author | Daniel Colascione <dancol@google.com> | Tue Sep 03 13:42:23 2019 -0700 |
committer | Daniel Colascione <dancol@google.com> | Tue Sep 03 18:27:57 2019 -0700 |
tree | 4ed37024eb41cd46d312018a948cce6e2f6b9434 | |
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