diff options
author | Tom Cherry <tomcherry@google.com> | 2017-11-30 15:41:32 -0800 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2017-11-30 16:26:34 -0800 |
commit | 8d366a81a361221d872db99d74bbaaa4611bdb82 (patch) | |
tree | d7e363de4e901821136272ca2ac2d16373ec79f1 /libc/malloc_hooks/malloc_hooks.cpp | |
parent | f5a6fd2001baad5ea92d50f9e38388a2eda21e23 (diff) |
Fix static classes in system properties
Previously, the functionality for mapping properties to contexts were
broken into a set of classes, each statically defined in
system_properties.cpp to prevent using new/malloc. This is a mistake
however, since system property initialization happens before static
initialization, so it is possible for the Constructors of these
classes to clobber the initialized data.
This change fixes that by placing them in a Union and having that
Union have a no-op constructor. The individual classes will be
initialized via placement new before they are used as is typically
done with classes in a union.
Test: boot bullhead
Change-Id: Ideb9d6ad8b6fc768811d8615d005cd4b8d134bce
Diffstat (limited to 'libc/malloc_hooks/malloc_hooks.cpp')
0 files changed, 0 insertions, 0 deletions