blob: 43c215f52b58c8b6a5e18a987dcca45c96dcb549 [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"
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
Jamie Madill45bcc782016-11-07 13:58:48 -050015namespace sh
16{
17
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000018bool InitProcess()
19{
Jamie Madilld7b1ab52016-12-12 14:42:19 -050020 if (!InitializePoolIndex())
21 {
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000022 assert(0 && "InitProcess(): Failed to initalize global pool");
23 return false;
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000024 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000025
Dmitry Skiba01971112015-07-10 14:54:00 -040026 TCache::initialize();
27
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000028 return true;
29}
30
Alok Priyadarshi8156b6b2013-09-23 14:56:58 -040031void DetachProcess()
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000032{
Alok Priyadarshi8156b6b2013-09-23 14:56:58 -040033 FreePoolIndex();
Dmitry Skiba01971112015-07-10 14:54:00 -040034 TCache::destroy();
alokp@chromium.org34b99cd2010-07-27 18:37:55 +000035}
Jamie Madill45bcc782016-11-07 13:58:48 -050036
37} // namespace sh