Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5e40e74b
Kaydet (Commit)
5e40e74b
authored
Eki 07, 2002
tarafından
Michael W. Hudson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
This is Armin Rigo's patch:
[ 617309 ] getframe hook (Psyco #1) Forward port candidate.
üst
ddd3f0ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
10 deletions
+22
-10
pystate.h
Include/pystate.h
+3
-0
pyexpat.c
Modules/pyexpat.c
+1
-1
ceval.c
Python/ceval.c
+8
-9
pystate.c
Python/pystate.c
+10
-0
No files found.
Include/pystate.h
Dosyayı görüntüle @
5e40e74b
...
@@ -109,6 +109,9 @@ DL_IMPORT(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
...
@@ -109,6 +109,9 @@ DL_IMPORT(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
DL_IMPORT
(
PyThreadState
*
)
PyInterpreterState_ThreadHead
(
PyInterpreterState
*
);
DL_IMPORT
(
PyThreadState
*
)
PyInterpreterState_ThreadHead
(
PyInterpreterState
*
);
DL_IMPORT
(
PyThreadState
*
)
PyThreadState_Next
(
PyThreadState
*
);
DL_IMPORT
(
PyThreadState
*
)
PyThreadState_Next
(
PyThreadState
*
);
/* hook for PyEval_GetFrame(), requested for Psyco */
extern
DL_IMPORT
(
unaryfunc
)
_PyThreadState_GetFrame
;
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
Modules/pyexpat.c
Dosyayı görüntüle @
5e40e74b
...
@@ -392,7 +392,7 @@ call_with_frame(PyCodeObject *c, PyObject* func, PyObject* args)
...
@@ -392,7 +392,7 @@ call_with_frame(PyCodeObject *c, PyObject* func, PyObject* args)
f
=
PyFrame_New
(
f
=
PyFrame_New
(
tstate
,
/*back*/
tstate
,
/*back*/
c
,
/*code*/
c
,
/*code*/
tstate
->
frame
->
f_globals
,
/*globals*/
PyEval_GetGlobals
()
,
/*globals*/
NULL
/*locals*/
NULL
/*locals*/
);
);
if
(
f
==
NULL
)
if
(
f
==
NULL
)
...
...
Python/ceval.c
Dosyayı görüntüle @
5e40e74b
...
@@ -2949,10 +2949,9 @@ PyEval_SetTrace(Py_tracefunc func, PyObject *arg)
...
@@ -2949,10 +2949,9 @@ PyEval_SetTrace(Py_tracefunc func, PyObject *arg)
PyObject
*
PyObject
*
PyEval_GetBuiltins
(
void
)
PyEval_GetBuiltins
(
void
)
{
{
PyThreadState
*
tstate
=
PyThreadState_Get
();
PyFrameObject
*
current_frame
=
(
PyFrameObject
*
)
PyEval_GetFrame
();
PyFrameObject
*
current_frame
=
tstate
->
frame
;
if
(
current_frame
==
NULL
)
if
(
current_frame
==
NULL
)
return
tstate
->
interp
->
builtins
;
return
PyThreadState_Get
()
->
interp
->
builtins
;
else
else
return
current_frame
->
f_builtins
;
return
current_frame
->
f_builtins
;
}
}
...
@@ -2960,7 +2959,7 @@ PyEval_GetBuiltins(void)
...
@@ -2960,7 +2959,7 @@ PyEval_GetBuiltins(void)
PyObject
*
PyObject
*
PyEval_GetLocals
(
void
)
PyEval_GetLocals
(
void
)
{
{
PyFrameObject
*
current_frame
=
PyThreadState_Get
()
->
frame
;
PyFrameObject
*
current_frame
=
(
PyFrameObject
*
)
PyEval_GetFrame
()
;
if
(
current_frame
==
NULL
)
if
(
current_frame
==
NULL
)
return
NULL
;
return
NULL
;
PyFrame_FastToLocals
(
current_frame
);
PyFrame_FastToLocals
(
current_frame
);
...
@@ -2970,7 +2969,7 @@ PyEval_GetLocals(void)
...
@@ -2970,7 +2969,7 @@ PyEval_GetLocals(void)
PyObject
*
PyObject
*
PyEval_GetGlobals
(
void
)
PyEval_GetGlobals
(
void
)
{
{
PyFrameObject
*
current_frame
=
PyThreadState_Get
()
->
frame
;
PyFrameObject
*
current_frame
=
(
PyFrameObject
*
)
PyEval_GetFrame
()
;
if
(
current_frame
==
NULL
)
if
(
current_frame
==
NULL
)
return
NULL
;
return
NULL
;
else
else
...
@@ -2980,21 +2979,21 @@ PyEval_GetGlobals(void)
...
@@ -2980,21 +2979,21 @@ PyEval_GetGlobals(void)
PyObject
*
PyObject
*
PyEval_GetFrame
(
void
)
PyEval_GetFrame
(
void
)
{
{
Py
FrameObject
*
current_frame
=
PyThreadState_Get
()
->
frame
;
Py
ThreadState
*
tstate
=
PyThreadState_Get
()
;
return
(
PyObject
*
)
current_frame
;
return
_PyThreadState_GetFrame
((
PyObject
*
)
tstate
)
;
}
}
int
int
PyEval_GetRestricted
(
void
)
PyEval_GetRestricted
(
void
)
{
{
PyFrameObject
*
current_frame
=
PyThreadState_Get
()
->
frame
;
PyFrameObject
*
current_frame
=
(
PyFrameObject
*
)
PyEval_GetFrame
()
;
return
current_frame
==
NULL
?
0
:
current_frame
->
f_restricted
;
return
current_frame
==
NULL
?
0
:
current_frame
->
f_restricted
;
}
}
int
int
PyEval_MergeCompilerFlags
(
PyCompilerFlags
*
cf
)
PyEval_MergeCompilerFlags
(
PyCompilerFlags
*
cf
)
{
{
PyFrameObject
*
current_frame
=
PyThreadState_Get
()
->
frame
;
PyFrameObject
*
current_frame
=
(
PyFrameObject
*
)
PyEval_GetFrame
()
;
int
result
=
0
;
int
result
=
0
;
if
(
current_frame
!=
NULL
)
{
if
(
current_frame
!=
NULL
)
{
...
...
Python/pystate.c
Dosyayı görüntüle @
5e40e74b
...
@@ -35,6 +35,7 @@ static PyThread_type_lock head_mutex = NULL; /* Protects interp->tstate_head */
...
@@ -35,6 +35,7 @@ static PyThread_type_lock head_mutex = NULL; /* Protects interp->tstate_head */
static
PyInterpreterState
*
interp_head
=
NULL
;
static
PyInterpreterState
*
interp_head
=
NULL
;
PyThreadState
*
_PyThreadState_Current
=
NULL
;
PyThreadState
*
_PyThreadState_Current
=
NULL
;
unaryfunc
_PyThreadState_GetFrame
=
NULL
;
PyInterpreterState
*
PyInterpreterState
*
...
@@ -114,10 +115,19 @@ PyInterpreterState_Delete(PyInterpreterState *interp)
...
@@ -114,10 +115,19 @@ PyInterpreterState_Delete(PyInterpreterState *interp)
}
}
/* Default implementation for _PyThreadState_GetFrame */
static
struct
_frame
*
threadstate_getframe
(
PyThreadState
*
self
)
{
return
self
->
frame
;
}
PyThreadState
*
PyThreadState
*
PyThreadState_New
(
PyInterpreterState
*
interp
)
PyThreadState_New
(
PyInterpreterState
*
interp
)
{
{
PyThreadState
*
tstate
=
PyMem_NEW
(
PyThreadState
,
1
);
PyThreadState
*
tstate
=
PyMem_NEW
(
PyThreadState
,
1
);
if
(
_PyThreadState_GetFrame
==
NULL
)
_PyThreadState_GetFrame
=
(
unaryfunc
)
threadstate_getframe
;
if
(
tstate
!=
NULL
)
{
if
(
tstate
!=
NULL
)
{
tstate
->
interp
=
interp
;
tstate
->
interp
=
interp
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment