feat(library/init/lean/runtime): expose runtime limit
This commit is contained in:
parent
db6933e3a4
commit
ae8a51c718
3 changed files with 25 additions and 0 deletions
|
|
@ -9,3 +9,4 @@ import init.lean.frontend
|
|||
import init.lean.extern
|
||||
import init.lean.environment
|
||||
import init.lean.modifiers
|
||||
import init.lean.runtime
|
||||
|
|
|
|||
17
library/init/lean/runtime.lean
Normal file
17
library/init/lean/runtime.lean
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/-
|
||||
Copyright (c) 2019 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
prelude
|
||||
import init.core
|
||||
|
||||
namespace Lean
|
||||
|
||||
@[extern "lean_closure_max_args"]
|
||||
constant closureMaxArgsFn : Unit → Nat := default _
|
||||
|
||||
def closureMaxArgs : Nat :=
|
||||
closureMaxArgsFn ()
|
||||
|
||||
end Lean
|
||||
|
|
@ -1953,6 +1953,13 @@ obj_res fixpoint6(obj_arg rec, obj_arg a1, obj_arg a2, obj_arg a3, obj_arg a4, o
|
|||
return r;
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// Runtime info
|
||||
|
||||
extern "C" object * lean_closure_max_args(object *) {
|
||||
return mk_nat_obj(static_cast<unsigned>(LEAN_CLOSURE_MAX_ARGS));
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// Debugging helper functions
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue