blob: 713965389faba3d97241d3a2dced32f7f33e0b9b [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
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 Skiba01971112015-07-10 14:54:00 -04007#include "compiler/translator/Cache.h"
Geoff Lang17732822013-08-29 13:46:49 -04008#include "compiler/translator/InitializeDll.h"
Geoff Lang17732822013-08-29 13:46:49 -04009#include "compiler/translator/InitializeGlobals.h"
10#include "compiler/translator/InitializeParseContext.h"
Geoff Lang44fa7592014-05-30 11:50:07 -040011
12#include "common/platform.h"
13
14#include <assert.h>
daniel@transgaming.combbf56f72010-04-20 18:52:13 +000015
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000016bool InitProcess()
17{
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000018 if (!InitializePoolIndex()) {
19 assert(0 && "InitProcess(): Failed to initalize global pool");
20 return false;
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000021 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000022
23 if (!InitializeParseContextIndex()) {
24 assert(0 && "InitProcess(): Failed to initalize parse context");
25 return false;
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000026 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000027
Dmitry Skiba01971112015-07-10 14:54:00 -040028 TCache::initialize();
29
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000030 return true;
31}
32
Alok Priyadarshi8156b6b2013-09-23 14:56:58 -040033void DetachProcess()
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000034{
Alok Priyadarshi8156b6b2013-09-23 14:56:58 -040035 FreeParseContextIndex();
36 FreePoolIndex();
Dmitry Skiba01971112015-07-10 14:54:00 -040037 TCache::destroy();
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000038}