blob: c98430662aab1d8891266aa982c245540e9dca2a [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
Geoff Lang17732822013-08-29 13:46:49 -04007#include "compiler/translator/InitializeDll.h"
Geoff Lang17732822013-08-29 13:46:49 -04008#include "compiler/translator/InitializeGlobals.h"
9#include "compiler/translator/InitializeParseContext.h"
Geoff Lang44fa7592014-05-30 11:50:07 -040010
11#include "common/platform.h"
12
13#include <assert.h>
daniel@transgaming.combbf56f72010-04-20 18:52:13 +000014
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000015bool InitProcess()
16{
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000017 if (!InitializePoolIndex()) {
18 assert(0 && "InitProcess(): Failed to initalize global pool");
19 return false;
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000020 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000021
22 if (!InitializeParseContextIndex()) {
23 assert(0 && "InitProcess(): Failed to initalize parse context");
24 return false;
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000025 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000026
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000027 return true;
28}
29
Alok Priyadarshi8156b6b2013-09-23 14:56:58 -040030void DetachProcess()
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000031{
Alok Priyadarshi8156b6b2013-09-23 14:56:58 -040032 FreeParseContextIndex();
33 FreePoolIndex();
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000034}