VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/nsprpub/lib/msgc/include/gcint.h@ 89890

最後變更 在這個檔案從89890是 1,由 vboxsync 提交於 55 年 前

import

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 3.9 KB
 
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is the Netscape Portable Runtime (NSPR).
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998-2000
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38#ifndef gcint_h___
39#define gcint_h___
40
41#include "prmon.h"
42#include "prgc.h"
43
44extern PRLogModuleInfo *_pr_msgc_lm;
45extern GCInfo _pr_gcData;
46
47#if defined(_WIN32) && !defined(DEBUG)
48#undef INLINE_LOCK
49#endif
50
51#ifdef INLINE_LOCK
52#define LOCK_GC() EnterCriticalSection(&_pr_gcData.lock->mutexHandle)
53#define UNLOCK_GC() LeaveCriticalSection(&_pr_gcData.lock->mutexHandle)
54#else
55#define LOCK_GC() PR_EnterMonitor(_pr_gcData.lock)
56#define UNLOCK_GC() PR_ExitMonitor (_pr_gcData.lock)
57#define GC_IS_LOCKED() (PR_GetMonitorEntryCount(_pr_gcData.lock)!=0)
58#endif
59
60#ifdef DEBUG
61#define _GCTRACE(x, y) if (_pr_gcData.flags & x) GCTrace y
62#else
63#define _GCTRACE(x, y)
64#endif
65
66extern GCBeginGCHook *_pr_beginGCHook;
67extern void *_pr_beginGCHookArg;
68extern GCBeginGCHook *_pr_endGCHook;
69extern void *_pr_endGCHookArg;
70
71extern GCBeginFinalizeHook *_pr_beginFinalizeHook;
72extern void *_pr_beginFinalizeHookArg;
73extern GCBeginFinalizeHook *_pr_endFinalizeHook;
74extern void *_pr_endFinalizeHookArg;
75
76extern int _pr_do_a_dump;
77extern FILE *_pr_dump_file;
78
79extern PRLogModuleInfo *_pr_gc_lm;
80
81/*
82** Root finders. Root finders are used by the GC to find pointers into
83** the GC heap that are not contained in the GC heap.
84*/
85typedef struct RootFinderStr RootFinder;
86
87struct RootFinderStr {
88 RootFinder *next;
89 GCRootFinder *func;
90 char *name;
91 void *arg;
92};
93extern RootFinder *_pr_rootFinders;
94
95typedef struct CollectorTypeStr {
96 GCType gctype;
97 PRUint32 flags;
98} CollectorType;
99
100#define GC_MAX_TYPES 256
101extern CollectorType *_pr_collectorTypes;
102
103#define _GC_TYPE_BUSY 0x1
104#define _GC_TYPE_FINAL 0x2
105#define _GC_TYPE_WEAK 0x4
106
107/* Slot in _pr_gcTypes used for free memory */
108#define FREE_MEMORY_TYPEIX 255
109
110extern void _PR_InitGC(PRWord flags);
111extern void _MD_InitGC(void);
112extern void PR_CALLBACK _PR_ScanFinalQueue(void *notused);
113
114/*
115** Grow the GC Heap.
116*/
117extern void *_MD_GrowGCHeap(PRUint32 *sizep);
118
119/*
120** Extend the GC Heap.
121*/
122extern PRBool _MD_ExtendGCHeap(char *base, PRInt32 oldSize, PRInt32 newSize);
123
124/*
125** Free a GC segment.
126*/
127extern void _MD_FreeGCSegment(void *base, PRInt32 len);
128
129#endif /* gcint_h___ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette