Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/dependabot.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches:
- 'main'
- '3.*'
- 'meta/3.*'
pull_request:
branches:
- 'main'
Expand Down
49 changes: 49 additions & 0 deletions Include/internal/pycore_gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,55 @@ extern void _PyGC_VisitObjectsWorldStopped(PyInterpreterState *interp,
gcvisitobjects_t callback, void *arg);
#endif

struct _Ci_PyGCImpl;

/*
* Collect cyclic garbage.
*
* impl - Pointer to the collection implementation.
* tstate - Indirectly specifies (via tstate->interp) the interpreter
for which collection should be performed.
* generation - Collect generations <= this value
* reason - Why we're collecting
*/
typedef Py_ssize_t (*Ci_gc_collect_t)(struct _Ci_PyGCImpl *impl, PyThreadState* tstate,
int generation, _PyGC_Reason reason);

// Free a collector
typedef void (*Ci_gc_finalize_t)(struct _Ci_PyGCImpl *impl);

// An implementation of cyclic garbage collection
typedef struct _Ci_PyGCImpl {
Ci_gc_collect_t collect;
Ci_gc_finalize_t finalize;
} _Ci_PyGCImpl;

struct _gc_runtime_state;

/*
* Set the collection implementation.
*
* The callee takes ownership of impl.
*
* Returns a pointer to the previous impl, which the caller is responsible for freeing
* using the returned impl's finalize().
*/
PyAPI_FUNC(_Ci_PyGCImpl *) _Ci_PyGC_SetImpl(struct _gc_runtime_state *gc_state, _Ci_PyGCImpl *impl);

/*
* Returns a pointer to the current GC implementation but does not transfer
* ownership to the caller.
*/
PyAPI_FUNC(_Ci_PyGCImpl *) _Ci_PyGC_GetImpl(struct _gc_runtime_state *gc_state);

/*
* Clear free lists (e.g. frames, tuples, etc.) for the given interpreter.
*
* This should be called by GC implementations after collecting the highest
* generation.
*/
PyAPI_FUNC(void) _Ci_PyGC_ClearFreeLists(PyInterpreterState* interp);

#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 6 additions & 0 deletions Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ _Py_ThreadCanHandleSignals(PyInterpreterState *interp)
and interpreter state */

#if !defined(Py_BUILD_CORE_MODULE)
# if defined(Py_ENABLE_SHARED) && _Py__has_attribute(tls_model)
__attribute__((tls_model("initial-exec")))
# endif
extern _Py_thread_local PyThreadState *_Py_tss_tstate;
# if defined(Py_ENABLE_SHARED) && _Py__has_attribute(tls_model)
__attribute__((tls_model("initial-exec")))
# endif
extern _Py_thread_local PyInterpreterState *_Py_tss_interp;
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/patchlevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define PY_RELEASE_SERIAL 1

/* Version as a string */
#define PY_VERSION "3.15.0b1+"
#define PY_VERSION "3.15.0b1+meta"
/*--end constants--*/


Expand Down
2 changes: 2 additions & 0 deletions Include/pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE);
*/
PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);

// Sets the thread state for multi-threaded GC
PyAPI_FUNC(void) Ci_SetTStateForGC(PyThreadState *tstate);

/* PEP 788 -- Protection against interpreter finalization */

Expand Down
9 changes: 9 additions & 0 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,15 @@ def main():
sethelper()
if not sys.flags.isolated:
enablerlcompleter()
# If we've been built with CinderX support there will be an init_cinderx.py
# included in the default module search path. In this case we import it
# which will have the side-effect of initializing CinderX. If this module
# is missing then we weren't build with CinderX so ignoring the import
# error is fine.
try:
import init_cinderx
except ImportError:
pass
execsitecustomize()
if ENABLE_USER_SITE:
execusercustomize()
Expand Down
Loading
Loading