/*
  Copyright 2025 Matthias-Sebastian Schröder <matthias.schroeder@dolanghub.de>

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/

#pragma once

#include "dobase/vmframe.hpp"
#include "dobase/error.hpp"

__NAMESPACE_DO_START

// Stack with sufficient size to evaulate
// index key expressions an run some small user defined
// functions
const int small_stack_size = 512;

// Default stack size when executing scripts
const int regular_stack_size = 65536;

class Runtime;
class VmStack;

DOBASE_EXPORT int CreateStack(Runtime* runtime, size_t size, VmStack** out_stack);

DOBASE_EXPORT int ReleaseStack(VmStack* stack);

DOBASE_EXPORT Runtime * GetRuntime(VmStack* stack);

__NAMESPACE_END
