daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 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 | |
Dmitry Skiba | 0197111 | 2015-07-10 14:54:00 -0400 | [diff] [blame^] | 7 | #include "compiler/translator/Cache.h" |
Geoff Lang | 1773282 | 2013-08-29 13:46:49 -0400 | [diff] [blame] | 8 | #include "compiler/translator/InitializeDll.h" |
Geoff Lang | 1773282 | 2013-08-29 13:46:49 -0400 | [diff] [blame] | 9 | #include "compiler/translator/InitializeGlobals.h" |
| 10 | #include "compiler/translator/InitializeParseContext.h" |
Geoff Lang | 44fa759 | 2014-05-30 11:50:07 -0400 | [diff] [blame] | 11 | |
| 12 | #include "common/platform.h" |
| 13 | |
| 14 | #include <assert.h> |
daniel@transgaming.com | bbf56f7 | 2010-04-20 18:52:13 +0000 | [diff] [blame] | 15 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 16 | bool InitProcess() |
| 17 | { |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 18 | if (!InitializePoolIndex()) { |
| 19 | assert(0 && "InitProcess(): Failed to initalize global pool"); |
| 20 | return false; |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 21 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 22 | |
| 23 | if (!InitializeParseContextIndex()) { |
| 24 | assert(0 && "InitProcess(): Failed to initalize parse context"); |
| 25 | return false; |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 26 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 27 | |
Dmitry Skiba | 0197111 | 2015-07-10 14:54:00 -0400 | [diff] [blame^] | 28 | TCache::initialize(); |
| 29 | |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 30 | return true; |
| 31 | } |
| 32 | |
Alok Priyadarshi | 8156b6b | 2013-09-23 14:56:58 -0400 | [diff] [blame] | 33 | void DetachProcess() |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 34 | { |
Alok Priyadarshi | 8156b6b | 2013-09-23 14:56:58 -0400 | [diff] [blame] | 35 | FreeParseContextIndex(); |
| 36 | FreePoolIndex(); |
Dmitry Skiba | 0197111 | 2015-07-10 14:54:00 -0400 | [diff] [blame^] | 37 | TCache::destroy(); |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 38 | } |