forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemorySizeParser.h
More file actions
45 lines (33 loc) · 1.11 KB
/
MemorySizeParser.h
File metadata and controls
45 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#ifndef HERMES_SUPPORT_MEMORYSIZEPARSER_H
#define HERMES_SUPPORT_MEMORYSIZEPARSER_H
#include "hermes/Public/GCConfig.h"
#include "llvh/ADT/StringRef.h"
#include "llvh/Support/CommandLine.h"
#include <string>
/// This file defines flags that are specific to the Hermes runtime,
/// independent of the Hermes compiler. Such flags must be defined in the
/// hermes and hvm binaries, so this file is included in all of those.
namespace cl {
using llvh::cl::Option;
using llvh::cl::parser;
struct MemorySize {
hermes::vm::gcheapsize_t bytes;
};
// Define a custom parser for memory size specifications.
struct MemorySizeParser : public parser<MemorySize> {
MemorySizeParser(Option &O) : parser<MemorySize>(O) {}
// parse - Return true on error.
bool parse(
cl::Option &O,
llvh::StringRef ArgName,
const std::string &ArgValue,
MemorySize &Val);
};
} // namespace cl
#endif // HERMES_SUPPORT_MEMORYSIZEPARSER_H