1/*
2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef VMTags_h
27#define VMTags_h
28
29// On Mac OS X, the VM subsystem allows tagging memory requested from mmap and vm_map
30// in order to aid tools that inspect system memory use.
31#if OS(DARWIN)
32
33#include <mach/vm_statistics.h>
34
35#if defined(VM_MEMORY_TCMALLOC)
36#define VM_TAG_FOR_TCMALLOC_MEMORY VM_MAKE_TAG(VM_MEMORY_TCMALLOC)
37#else
38#define VM_TAG_FOR_TCMALLOC_MEMORY VM_MAKE_TAG(53)
39#endif // defined(VM_MEMORY_TCMALLOC)
40
41#if defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
42#define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
43#else
44#define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY VM_MAKE_TAG(64)
45#endif // defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
46
47#if defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE)
48#define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE)
49#else
50#define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(65)
51#endif // defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE)
52
53#if defined(VM_MEMORY_JAVASCRIPT_CORE)
54#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_CORE)
55#else
56#define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(63)
57#endif // defined(VM_MEMORY_JAVASCRIPT_CORE)
58
59#if defined(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS)
60#define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY VM_MAKE_TAG(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS)
61#else
62#define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY VM_MAKE_TAG(69)
63#endif // defined(VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS)
64
65#elif OS(LINUX)
66
67#define VM_TAG_FOR_TCMALLOC_MEMORY 0
68#define VM_TAG_FOR_COLLECTOR_MEMORY 1
69#define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY 2
70#define VM_TAG_FOR_REGISTERFILE_MEMORY 3
71#define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY 4
72
73#else // OS(DARWIN)
74
75#define VM_TAG_FOR_TCMALLOC_MEMORY -1
76#define VM_TAG_FOR_COLLECTOR_MEMORY -1
77#define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY -1
78#define VM_TAG_FOR_REGISTERFILE_MEMORY -1
79#define VM_TAG_FOR_WEBCORE_PURGEABLE_MEMORY -1
80
81#endif // OS(DARWIN)
82
83#endif // VMTags_h
84

source code of qtdeclarative/src/3rdparty/masm/wtf/VMTags.h