Line data Source code
1 : //
2 : // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
3 : // Use of this source code is governed by a BSD-style license that can be
4 : // found in the LICENSE file.
5 : //
6 :
7 : #include "compiler/translator/Cache.h"
8 : #include "compiler/translator/InitializeDll.h"
9 : #include "compiler/translator/InitializeGlobals.h"
10 : #include "compiler/translator/InitializeParseContext.h"
11 :
12 : #include "common/platform.h"
13 :
14 : #include <assert.h>
15 :
16 : namespace sh
17 : {
18 :
19 0 : bool InitProcess()
20 : {
21 0 : if (!InitializePoolIndex()) {
22 0 : assert(0 && "InitProcess(): Failed to initalize global pool");
23 : return false;
24 : }
25 :
26 0 : if (!InitializeParseContextIndex()) {
27 0 : assert(0 && "InitProcess(): Failed to initalize parse context");
28 : return false;
29 : }
30 :
31 0 : TCache::initialize();
32 :
33 0 : return true;
34 : }
35 :
36 0 : void DetachProcess()
37 : {
38 0 : FreeParseContextIndex();
39 0 : FreePoolIndex();
40 0 : TCache::destroy();
41 0 : }
42 :
43 : } // namespace sh
|