aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/vespa/document/select/parser_limits.h
blob: cde17aa2c8d3ed8d38add6d64e2f65d0e138fef9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <cstdint>
#include <cstddef>

namespace document::select {

// Any resource constraints set for parsing document selection expressions
struct ParserLimits {
    // Max depth allowed for nodes in the AST tree.
    constexpr static uint32_t MaxRecursionDepth    = 1024;
    // Max size of entire input document selection string, in bytes.
    constexpr static size_t   MaxSelectionByteSize = 1024*1024;
};

void __attribute__((noinline)) throw_max_depth_exceeded_exception();

}