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
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/
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
15
* The Original Code is the Netscape Portable Runtime (NSPR).
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.
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.
36
* ***** END LICENSE BLOCK ***** */
44
extern PRLogModuleInfo *_pr_msgc_lm;
45
extern GCInfo _pr_gcData;
47
#if defined(_WIN32) && !defined(DEBUG)
52
#define LOCK_GC() EnterCriticalSection(&_pr_gcData.lock->mutexHandle)
53
#define UNLOCK_GC() LeaveCriticalSection(&_pr_gcData.lock->mutexHandle)
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)
61
#define _GCTRACE(x, y) if (_pr_gcData.flags & x) GCTrace y
63
#define _GCTRACE(x, y)
66
extern GCBeginGCHook *_pr_beginGCHook;
67
extern void *_pr_beginGCHookArg;
68
extern GCBeginGCHook *_pr_endGCHook;
69
extern void *_pr_endGCHookArg;
71
extern GCBeginFinalizeHook *_pr_beginFinalizeHook;
72
extern void *_pr_beginFinalizeHookArg;
73
extern GCBeginFinalizeHook *_pr_endFinalizeHook;
74
extern void *_pr_endFinalizeHookArg;
76
extern int _pr_do_a_dump;
77
extern FILE *_pr_dump_file;
79
extern PRLogModuleInfo *_pr_gc_lm;
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.
85
typedef struct RootFinderStr RootFinder;
87
struct RootFinderStr {
93
extern RootFinder *_pr_rootFinders;
95
typedef struct CollectorTypeStr {
100
#define GC_MAX_TYPES 256
101
extern CollectorType *_pr_collectorTypes;
103
#define _GC_TYPE_BUSY 0x1
104
#define _GC_TYPE_FINAL 0x2
105
#define _GC_TYPE_WEAK 0x4
107
/* Slot in _pr_gcTypes used for free memory */
108
#define FREE_MEMORY_TYPEIX 255
110
extern void _PR_InitGC(PRWord flags);
111
extern void _MD_InitGC(void);
112
extern void PR_CALLBACK _PR_ScanFinalQueue(void *notused);
117
extern void *_MD_GrowGCHeap(PRUint32 *sizep);
120
** Extend the GC Heap.
122
extern PRBool _MD_ExtendGCHeap(char *base, PRInt32 oldSize, PRInt32 newSize);
125
** Free a GC segment.
127
extern void _MD_FreeGCSegment(void *base, PRInt32 len);
129
#endif /* gcint_h___ */