commit | b74e7190e86d559712747e5cdb31a0d390b7af7d | [log] [tgz] |
---|---|---|
author | Iliyan Malchev <malchev@google.com> | Thu Feb 16 11:23:36 2012 -0800 |
committer | Iliyan Malchev <malchev@google.com> | Thu Feb 16 11:30:09 2012 -0800 |
tree | 7ac5eb198a63b938d42b74f43988bf5b73c8de11 | |
parent | 5bac60aaafca855f68e1f8b5527d4a4b7897f234 [diff] |
Replace malloc() followed by memset() to zero with calloc() Bionic's calloc() is smart enough to not zero out memory if it gets that memory from an anonyous mmap. Thus, if we use malloc for large allocations, we cause unnecessary memory duplication by following the malloc() with a memset(). An even better approach would be to replace the known large calloc() calls with dvmAllocRegion() allocation. Change-Id: Id308f541c9a040d5929bf991b6c2bfdefb823c3c