Skip to content

Commit

Permalink
Merge pull request #239 from P403n1x87/chore/clean-up-old-code
Browse files Browse the repository at this point in the history
chore: clean up support for old versions of Python
  • Loading branch information
P403n1x87 authored Oct 13, 2024
2 parents 7c42586 + af9ba26 commit 741d378
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 36 deletions.
10 changes: 2 additions & 8 deletions src/py_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ static inline int
_py_thread__unwind_iframe_stack(py_thread_t * self, void * iframe_raddr) {
int invalid = FALSE;
void * curr = iframe_raddr;

while (isvalid(curr)) {
if (fail(_py_thread__push_iframe(self, &curr))) {
log_d("Failed to retrieve iframe #%d", stack_pointer());
Expand Down Expand Up @@ -457,8 +457,6 @@ static inline int
_py_thread__unwind_cframe_stack(py_thread_t * self) {
PyCFrame cframe;

int invalid = FALSE;

_py_thread__read_stack(self);

stack_reset();
Expand All @@ -470,11 +468,7 @@ _py_thread__unwind_cframe_stack(py_thread_t * self) {
FAIL;
}

invalid = fail(_py_thread__unwind_iframe_stack(self, V_FIELD(void *, cframe, py_cframe, o_current_frame)));
if (invalid)
return invalid;

return invalid;
return fail(_py_thread__unwind_iframe_stack(self, V_FIELD(void *, cframe, py_cframe, o_current_frame)));
}


Expand Down
10 changes: 0 additions & 10 deletions src/python/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,4 @@ typedef struct {
char ob_sval[1];
} PyBytesObject;


// ---- stringobject.h --------------------------------------------------------

typedef struct {
PyObject_VAR_HEAD
long ob_shash;
int ob_sstate;
char ob_sval[1];
} PyStringObject; /* From Python 2.7 */

#endif
18 changes: 0 additions & 18 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,6 @@ typedef struct {
} py_thread_v;


typedef struct {
int version;
} py_unicode_v;


typedef struct {
int version;
} py_bytes_v;


typedef struct {
ssize_t size;

Expand Down Expand Up @@ -280,14 +270,6 @@ typedef struct {
offsetof(s, _status) \
}

#define PY_UNICODE(n) { \
n \
}

#define PY_BYTES(n) { \
n \
}

#define PY_RUNTIME(s) { \
sizeof(s), \
offsetof(s, interpreters.head), \
Expand Down

0 comments on commit 741d378

Please sign in to comment.