Skip to content

Commit e89504e

Browse files
committed
Revert "Improve robustness on free threaded builds and add a TODO"
This reverts commit 06e9378.
1 parent 06e9378 commit e89504e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

mypyc/codegen/emitclass.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ def emit_reuse_dealloc(cl: ClassIR, emitter: Emitter) -> None:
855855
"""
856856
prefix = cl.name_prefix(emitter.names)
857857
emitter.emit_line(f"if ({prefix}_free_instance == NULL) {{")
858+
emitter.emit_line(f"{prefix}_free_instance = self;")
858859

859860
# Clear attributes and free referenced objects.
860861

@@ -864,11 +865,6 @@ def emit_reuse_dealloc(cl: ClassIR, emitter: Emitter) -> None:
864865
for attr, rtype in base.attributes.items():
865866
emitter.emit_reuse_clear(f"self->{emitter.attr(attr)}", rtype)
866867

867-
# TODO: Insert a memory barrier on free-threaded builds? This appears not to be
868-
# needed on x86-64 because of the memory model.
869-
870-
emitter.emit_line(f"{prefix}_free_instance = self;")
871-
872868
emitter.emit_line("return;")
873869
emitter.emit_line("}")
874870

0 commit comments

Comments
 (0)