Skip to content
Commit 82e97442 authored by Daniel Colascione's avatar Daniel Colascione
Browse files

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
parent b63ff32f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment