am bff19682: Merge "name the atexit handler pages"

* commit 'bff196822230b5a8b1f5bafeed88ded821d390a9':
  name the atexit handler pages
This commit is contained in:
Elliott Hughes 2015-07-27 18:32:37 +00:00 committed by Android Git Automerger
commit fd3cd1cc2a

View File

@ -37,6 +37,10 @@
#include "atexit.h"
#include "private/thread_private.h"
/* BEGIN android-changed */
#include "private/bionic_prctl.h"
/* END android-changed */
struct atexit {
struct atexit *next; /* next in list */
int ind; /* next index in this table */
@ -95,6 +99,10 @@ __cxa_atexit(void (*func)(void *), void *arg, void *dso)
MAP_ANON | MAP_PRIVATE, -1, 0);
if (p == MAP_FAILED)
goto unlock;
/* BEGIN android-changed */
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, p, pgsize,
"atexit handlers");
/* END android-changed */
if (__atexit == NULL) {
memset(&p->fns[0], 0, sizeof(p->fns[0]));
p->ind = 1;
@ -204,6 +212,10 @@ __atexit_register_cleanup(void (*func)(void))
MAP_ANON | MAP_PRIVATE, -1, 0);
if (p == MAP_FAILED)
goto unlock;
/* BEGIN android-changed */
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, p, pgsize,
"atexit handlers");
/* END android-changed */
p->ind = 1;
p->max = (pgsize - ((char *)&p->fns[0] - (char *)p)) /
sizeof(p->fns[0]);