Skip to content

Commit 946ddc7

Browse files
alexmalyshevmeta-codesync[bot]
authored andcommitted
Reduce jit namespace usage in cinderx/Common
Summary: These are general and not _directly_ tied to JIT machinery. Reviewed By: yoney Differential Revision: D109701356 fbshipit-source-id: 0bfe5a56d672d159bd18e192294b7e7f3248ad6b
1 parent d5211a4 commit 946ddc7

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

cinderx/Common/frozen_list.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <stdexcept>
1111
#include <utility>
1212

13-
namespace cinderx::jit {
13+
namespace cinderx {
1414

1515
// A frozen list is effectively a vector that is dynamically allocated at
1616
// runtime, but then can no longer be resized.
@@ -130,4 +130,4 @@ class FrozenList {
130130
std::unique_ptr<T[]> ptr_;
131131
};
132132

133-
} // namespace cinderx::jit
133+
} // namespace cinderx

cinderx/Common/slab.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <cstdlib>
1313
#include <utility>
1414

15-
namespace cinderx::jit {
15+
namespace cinderx {
1616

1717
template <typename T>
1818
class SlabIterator {
@@ -146,4 +146,4 @@ class Slab {
146146
size_t mlocks_{0};
147147
};
148148

149-
} // namespace cinderx::jit
149+
} // namespace cinderx

cinderx/Common/slab_arena.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <utility>
1313
#include <vector>
1414

15-
namespace cinderx::jit {
15+
namespace cinderx {
1616

1717
template <class T>
1818
struct ObjectSizeTrait {
@@ -178,4 +178,4 @@ class SlabArena {
178178
#endif
179179
};
180180

181-
} // namespace cinderx::jit
181+
} // namespace cinderx

cinderx/Common/type.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "cinderx/Jit/threaded_compile.h"
1313
#include "cinderx/UpstreamBorrow/borrowed.h"
1414

15-
namespace cinderx::jit {
15+
namespace cinderx {
1616

1717
std::string typeFullname(PyTypeObject* type) {
1818
PyObject* dict = _PyType_GetDict(type);
@@ -25,9 +25,9 @@ std::string typeFullname(PyTypeObject* type) {
2525
}
2626

2727
PyObject* getBorrowedTypeDictSafe(PyTypeObject* self) {
28-
if (getThreadedCompileContext().compileRunning() &&
28+
if (jit::getThreadedCompileContext().compileRunning() &&
2929
self->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN) {
30-
PyInterpreterState* interp = getThreadedCompileContext().interpreter();
30+
PyInterpreterState* interp = jit::getThreadedCompileContext().interpreter();
3131
managed_static_type_state* state = Cix_PyStaticType_GetState(interp, self);
3232
return state->tp_dict;
3333
}
@@ -41,7 +41,7 @@ BorrowedRef<> typeLookupSafe(
4141
// Silence false positive from TSAN when checking Py_TPFLAGS_READY.
4242
// This flag should never change during compilation although other
4343
// flags may.
44-
ThreadedCompileSerialize guard;
44+
jit::ThreadedCompileSerialize guard;
4545

4646
BorrowedRef<PyTupleObject> mro{type->tp_mro};
4747
for (size_t i = 0, n = PyTuple_GET_SIZE(mro); i < n; ++i) {
@@ -62,12 +62,12 @@ BorrowedRef<> typeLookupSafe(
6262

6363
bool ensureVersionTag(BorrowedRef<PyTypeObject> type) {
6464
JIT_CHECK(
65-
getThreadedCompileContext().canAccessSharedData(),
65+
jit::getThreadedCompileContext().canAccessSharedData(),
6666
"Accessing type object needs lock");
6767
if (Ci_Type_HasValidVersionTag(type)) {
6868
return true;
6969
}
7070
return PyUnstable_Type_AssignVersionTag(type);
7171
}
7272

73-
} // namespace cinderx::jit
73+
} // namespace cinderx

cinderx/Common/type.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <string>
1010

11-
namespace cinderx::jit {
11+
namespace cinderx {
1212

1313
// When possible, return the fully qualified name of the given type (including
1414
// its module). Falls back to the type's bare name.
@@ -29,4 +29,4 @@ BorrowedRef<> typeLookupSafe(
2929
// true if successful.
3030
bool ensureVersionTag(BorrowedRef<PyTypeObject> type);
3131

32-
} // namespace cinderx::jit
32+
} // namespace cinderx

0 commit comments

Comments
 (0)