diff options
author | Christopher Ferris <cferris@google.com> | 2014-05-13 15:22:02 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2014-05-22 14:22:45 -0700 |
commit | 18ff84135248f3566b938c836a02fa6138a281f6 (patch) | |
tree | d309df8d535daff785bda4340ecdcf0f25273aaf /android | |
parent | 5daf4e4a8d52ac2d5b40b0d12ce5721c6b9676e7 (diff) | |
download | jemalloc-18ff84135248f3566b938c836a02fa6138a281f6.tar.gz |
Create a simple je_mallinfo function.
Move the scripts into a separate directory under android too.
Bug: 981363
Change-Id: Ifddc5cedea25a1bc8e31e870313a944a3293c737
Diffstat (limited to 'android')
-rw-r--r-- | android/scripts/README (renamed from android/README) | 0 | ||||
-rwxr-xr-x | android/scripts/conf_arm.sh (renamed from android/conf_arm.sh) | 0 | ||||
-rwxr-xr-x | android/scripts/conf_arm64.sh (renamed from android/conf_arm64.sh) | 0 | ||||
-rwxr-xr-x | android/scripts/conf_mips.sh (renamed from android/conf_mips.sh) | 0 | ||||
-rwxr-xr-x | android/scripts/conf_x86.sh (renamed from android/conf_x86.sh) | 0 | ||||
-rwxr-xr-x | android/scripts/conf_x86_64.sh (renamed from android/conf_x86_64.sh) | 0 | ||||
-rw-r--r-- | android/src/je_mallinfo.c | 32 |
7 files changed, 32 insertions, 0 deletions
diff --git a/android/README b/android/scripts/README index f50d52d..f50d52d 100644 --- a/android/README +++ b/android/scripts/README diff --git a/android/conf_arm.sh b/android/scripts/conf_arm.sh index a844182..a844182 100755 --- a/android/conf_arm.sh +++ b/android/scripts/conf_arm.sh diff --git a/android/conf_arm64.sh b/android/scripts/conf_arm64.sh index 83cffd9..83cffd9 100755 --- a/android/conf_arm64.sh +++ b/android/scripts/conf_arm64.sh diff --git a/android/conf_mips.sh b/android/scripts/conf_mips.sh index 17f43dc..17f43dc 100755 --- a/android/conf_mips.sh +++ b/android/scripts/conf_mips.sh diff --git a/android/conf_x86.sh b/android/scripts/conf_x86.sh index 5b7b468..5b7b468 100755 --- a/android/conf_x86.sh +++ b/android/scripts/conf_x86.sh diff --git a/android/conf_x86_64.sh b/android/scripts/conf_x86_64.sh index a0a2ca1..a0a2ca1 100755 --- a/android/conf_x86_64.sh +++ b/android/scripts/conf_x86_64.sh diff --git a/android/src/je_mallinfo.c b/android/src/je_mallinfo.c new file mode 100644 index 0000000..4f55709 --- /dev/null +++ b/android/src/je_mallinfo.c @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "jemalloc/internal/jemalloc_internal.h" + +// This is a very simple implementation that only gives information for +// the main thread's arena. +struct mallinfo je_mallinfo() { + struct mallinfo mi; + memset(&mi, 0, sizeof(mi)); + + arena_t* arena = choose_arena(NULL); + if (arena != NULL) { + mi.arena = arena->stats.mapped; + mi.uordblks = arena->stats.allocated_large; + mi.fordblks = mi.arena - mi.ordblks; + } + return mi; +} |