diff options
-rw-r--r-- | vm/alloc/Alloc.h | 12 | ||||
-rw-r--r-- | vm/alloc/Copying.cpp | 2 | ||||
-rw-r--r-- | vm/alloc/HeapSource.cpp | 2 | ||||
-rw-r--r-- | vm/alloc/HeapSource.h | 26 |
4 files changed, 22 insertions, 20 deletions
diff --git a/vm/alloc/Alloc.h b/vm/alloc/Alloc.h index a36a6b54e..6637cd696 100644 --- a/vm/alloc/Alloc.h +++ b/vm/alloc/Alloc.h @@ -21,6 +21,12 @@ #include <stddef.h> +/* flags for dvmMalloc */ +enum { + ALLOC_DEFAULT = 0x00, + ALLOC_DONT_TRACK = 0x01, /* don't add to internal tracking list */ +}; + /* * Initialization. */ @@ -56,12 +62,6 @@ void* dvmMalloc(size_t size, int flags); */ extern "C" Object* dvmAllocObject(ClassObject* clazz, int flags); -/* flags for dvmMalloc */ -enum { - ALLOC_DEFAULT = 0x00, - ALLOC_DONT_TRACK = 0x01, /* don't add to internal tracking list */ -}; - /* * Track an object reference that is currently only visible internally. * This is called automatically by dvmMalloc() unless ALLOC_DONT_TRACK diff --git a/vm/alloc/Copying.cpp b/vm/alloc/Copying.cpp index f36fc89ca..a1e503a7d 100644 --- a/vm/alloc/Copying.cpp +++ b/vm/alloc/Copying.cpp @@ -685,7 +685,7 @@ bool dvmHeapSourceContains(const void *addr) } } -bool dvmHeapSourceGetPtrFlag(const void *ptr, enum HeapSourcePtrFlag flag) +bool dvmHeapSourceGetPtrFlag(const void *ptr, HeapSourcePtrFlag flag) { assert(!"implemented"); return false; diff --git a/vm/alloc/HeapSource.cpp b/vm/alloc/HeapSource.cpp index f9a1b2da0..d94456019 100644 --- a/vm/alloc/HeapSource.cpp +++ b/vm/alloc/HeapSource.cpp @@ -1012,7 +1012,7 @@ dvmHeapSourceContains(const void *ptr) * Returns the value of the requested flag. */ bool -dvmHeapSourceGetPtrFlag(const void *ptr, enum HeapSourcePtrFlag flag) +dvmHeapSourceGetPtrFlag(const void *ptr, HeapSourcePtrFlag flag) { if (ptr == NULL) { return false; diff --git a/vm/alloc/HeapSource.h b/vm/alloc/HeapSource.h index be6d2e5e5..64008b31e 100644 --- a/vm/alloc/HeapSource.h +++ b/vm/alloc/HeapSource.h @@ -28,6 +28,18 @@ */ #define HEAP_SOURCE_MAX_HEAP_COUNT 2 +enum HeapSourceValueSpec { + HS_FOOTPRINT, + HS_ALLOWED_FOOTPRINT, + HS_BYTES_ALLOCATED, + HS_OBJECTS_ALLOCATED +}; + +enum HeapSourcePtrFlag { + HS_CONTAINS, // identical to dvmHeapSourceContains() + HS_ALLOCATED_IN_ZYGOTE +}; + /* * Initializes the heap source; must be called before any other * dvmHeapSource*() functions. @@ -90,13 +102,7 @@ void *dvmHeapSourceGetBase(void); * Returns the requested value. If the per-heap stats are requested, fill * them as well. */ -enum HeapSourceValueSpec { - HS_FOOTPRINT, - HS_ALLOWED_FOOTPRINT, - HS_BYTES_ALLOCATED, - HS_OBJECTS_ALLOCATED -}; -size_t dvmHeapSourceGetValue(enum HeapSourceValueSpec spec, +size_t dvmHeapSourceGetValue(HeapSourceValueSpec spec, size_t perHeapStats[], size_t arrayLen); /* @@ -131,11 +137,7 @@ bool dvmHeapSourceContainsAddress(const void *ptr); /* * Returns the value of the requested flag. */ -enum HeapSourcePtrFlag { - HS_CONTAINS, // identical to dvmHeapSourceContains() - HS_ALLOCATED_IN_ZYGOTE -}; -bool dvmHeapSourceGetPtrFlag(const void *ptr, enum HeapSourcePtrFlag flag); +bool dvmHeapSourceGetPtrFlag(const void *ptr, HeapSourcePtrFlag flag); /* * Returns the number of usable bytes in an allocated chunk; the size |