bionic: revert to a single (larger) property area

d329697 is too complicated.  Change the multiple property pages back to
a single 128K property area that's mapped in entirely at initialization
(the memory will not get allocated until the pages are touched).

d329697 has other changes useful for testing (moving property area
initialization inside bionic and adding __system_property_set_filename)
so undo the change manually rather than with git revert.

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit 5f05348c18)

Change-Id: I690704552afc07a4dd410277893ca9c40bc13e5f
This commit is contained in:
Greg Hackmann
2013-06-19 13:31:21 -07:00
committed by Colin Cross
parent 996cdc4b1a
commit 1540f601be
4 changed files with 36 additions and 89 deletions

View File

@@ -24,7 +24,7 @@
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
extern void *__system_property_regions__[PA_REGION_COUNT];
extern void *__system_property_area__;
struct LocalPropertyTestState {
LocalPropertyTestState() : valid(false) {
@@ -35,10 +35,8 @@ struct LocalPropertyTestState {
return;
}
for (size_t i = 0; i < PA_REGION_COUNT; i++) {
old_pa[i] = __system_property_regions__[i];
__system_property_regions__[i] = NULL;
}
old_pa = __system_property_area__;
__system_property_area__ = NULL;
pa_dirname = dirname;
pa_filename = pa_dirname + "/__properties__";
@@ -52,9 +50,7 @@ struct LocalPropertyTestState {
if (!valid)
return;
for (size_t i = 0; i < PA_REGION_COUNT; i++) {
__system_property_regions__[i] = old_pa[i];
}
__system_property_area__ = old_pa;
__system_property_set_filename(PROP_FILENAME);
unlink(pa_filename.c_str());
@@ -65,7 +61,7 @@ public:
private:
std::string pa_dirname;
std::string pa_filename;
void *old_pa[PA_REGION_COUNT];
void *old_pa;
};
TEST(properties, add) {