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 | |
Jamie Madill | 45bcc78 | 2016-11-07 13:58:48 -0500 | [diff] [blame^] | 16 | namespace sh |
| 17 | { |
| 18 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 19 | bool InitProcess() |
| 20 | { |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 21 | if (!InitializePoolIndex()) { |
| 22 | assert(0 && "InitProcess(): Failed to initalize global pool"); |
| 23 | return false; |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 24 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 25 | |
| 26 | if (!InitializeParseContextIndex()) { |
| 27 | assert(0 && "InitProcess(): Failed to initalize parse context"); |
| 28 | return false; |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 29 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 30 | |
Dmitry Skiba | 0197111 | 2015-07-10 14:54:00 -0400 | [diff] [blame] | 31 | TCache::initialize(); |
| 32 | |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 33 | return true; |
| 34 | } |
| 35 | |
Alok Priyadarshi | 8156b6b | 2013-09-23 14:56:58 -0400 | [diff] [blame] | 36 | void DetachProcess() |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 37 | { |
Alok Priyadarshi | 8156b6b | 2013-09-23 14:56:58 -0400 | [diff] [blame] | 38 | FreeParseContextIndex(); |
| 39 | FreePoolIndex(); |
Dmitry Skiba | 0197111 | 2015-07-10 14:54:00 -0400 | [diff] [blame] | 40 | TCache::destroy(); |
alokp@chromium.org | 34b99cd | 2010-07-27 18:37:55 +0000 | [diff] [blame] | 41 | } |
Jamie Madill | 45bcc78 | 2016-11-07 13:58:48 -0500 | [diff] [blame^] | 42 | |
| 43 | } // namespace sh |