this repo has no description
1// Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
2#include "builtins.h"
3#include "runtime.h"
4
5namespace py {
6
7RawObject FUNC(gc, immortalize_heap)(Thread* thread, Arguments) {
8 thread->runtime()->immortalizeCurrentHeapObjects();
9 return NoneType::object();
10}
11
12RawObject FUNC(gc, _is_immortal)(Thread* thread, Arguments args) {
13 HandleScope scope(thread);
14 Object obj(&scope, args.get(0));
15
16 return Bool::fromBool(
17 obj.isHeapObject() &&
18 thread->runtime()->heap()->isImmortal(HeapObject::cast(*obj).address()));
19}
20
21} // namespace py