cpyte 4.2.3__tar.gz → 4.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {cpyte-4.2.3/source/cpyte.egg-info → cpyte-4.2.5}/PKG-INFO +1 -1
  2. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/__init__.py +1 -1
  3. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/compiling.py +2 -1
  4. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/gc_runtime.c +13 -10
  5. {cpyte-4.2.3 → cpyte-4.2.5/source/cpyte.egg-info}/PKG-INFO +1 -1
  6. {cpyte-4.2.3 → cpyte-4.2.5}/MANIFEST.in +0 -0
  7. {cpyte-4.2.3 → cpyte-4.2.5}/pyproject.toml +0 -0
  8. {cpyte-4.2.3 → cpyte-4.2.5}/readme.md +0 -0
  9. {cpyte-4.2.3 → cpyte-4.2.5}/setup.cfg +0 -0
  10. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/__main__.py +0 -0
  11. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/_bignum_bc.py +0 -0
  12. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/_runtime_bc.py +0 -0
  13. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/astparse.py +0 -0
  14. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/bignum.c +0 -0
  15. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/bytecoding.py +0 -0
  16. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/clib.py +0 -0
  17. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/extension_hooks.py +0 -0
  18. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/formatter.py +0 -0
  19. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/generate_bc.py +0 -0
  20. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/lexar.py +0 -0
  21. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/linker.py +0 -0
  22. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/lsp_server.py +0 -0
  23. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/mainpie.py +0 -0
  24. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/optimizations.py +0 -0
  25. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/package_manifest.py +0 -0
  26. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/runtime.c +0 -0
  27. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/runtime_scorpion.c +0 -0
  28. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/sef.py +0 -0
  29. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/semantic_analasis.py +0 -0
  30. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/ugc.h +0 -0
  31. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/ui.py +0 -0
  32. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/update_check.py +0 -0
  33. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/winjit_patch.py +0 -0
  34. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte/winjit_stubs.c +0 -0
  35. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte.egg-info/SOURCES.txt +0 -0
  36. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte.egg-info/dependency_links.txt +0 -0
  37. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte.egg-info/entry_points.txt +0 -0
  38. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte.egg-info/requires.txt +0 -0
  39. {cpyte-4.2.3 → cpyte-4.2.5}/source/cpyte.egg-info/top_level.txt +0 -0
  40. {cpyte-4.2.3 → cpyte-4.2.5}/test/test_bignum_jit.py +0 -0
  41. {cpyte-4.2.3 → cpyte-4.2.5}/test/test_fuzz_del_has.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cpyte
3
- Version: 4.2.3
3
+ Version: 4.2.5
4
4
  Summary: The Cpyte programming language compiler
5
5
  Author: Hoang Duy Tung
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- __version__ = "4.2.3"
1
+ __version__ = "4.2.5"
2
2
 
3
3
  # ---------------------------------------------------------------------------
4
4
  # Public library API.
@@ -463,12 +463,13 @@ def _find_llvm_cc():
463
463
  return _llvm_cc_cache
464
464
  import shutil
465
465
 
466
+ triple = host_target().triple
466
467
  for name in ("clang", "cc", "gcc"):
467
468
  exe = shutil.which(name)
468
469
  if exe:
469
470
  try:
470
471
  r = subprocess.run(
471
- [exe, "-S", "-emit-llvm", "-O0", "-o", "-", "-xc", "-"],
472
+ [exe, "-S", "-emit-llvm", "-O0", "-target", triple, "-o", "-", "-xc", "-"],
472
473
  input="int __x = 0;",
473
474
  capture_output=True,
474
475
  text=True,
@@ -14,6 +14,9 @@
14
14
  * License: BSD-2-Clause (ugc) + project license
15
15
  */
16
16
 
17
+ #if !defined(_WIN32) && !defined(_GNU_SOURCE)
18
+ #define _GNU_SOURCE 1
19
+ #endif
17
20
  #define UGC_IMPLEMENTATION
18
21
  #define UGC_USE_TAGGED_POINTER 0
19
22
  #include <stddef.h>
@@ -112,16 +115,19 @@ typedef struct {
112
115
 
113
116
  /* Thread-local storage for TLAB.
114
117
  *
115
- * Windows and Linux use native TLS (`__declspec(thread)` / `__thread`).
116
- * macOS must NOT: the JIT path compiles this file to LLVM IR and emits a
117
- * Mach-O object via llvmlite's MCJIT, which cannot encode the TLVP
118
- * relocation that `__thread` lowers to (ARM64_RELOC_TLVP_LOAD_PAGEOFF12).
119
- * On Apple we back the per-thread TLAB with a pthread key instead, so the
120
- * emitted object is TLS-free and each thread still gets its own buffer. */
118
+ * Native TLS (`__declspec(thread)` / `__thread`) is avoided on every POSIX
119
+ * platform: the JIT path compiles this file to LLVM IR and emits a native
120
+ * object via llvmlite's MCJIT, and the compiler lowers native TLS to a
121
+ * `thread_local` LLVM global, which RuntimeDyld refuses to allocate
122
+ * (`LLVM ERROR: allocation of TLS not implemented`; on macOS arm64 it would
123
+ * also require the TLVP relocation ARM64_RELOC_TLVP_LOAD_PAGEOFF12). We back
124
+ * the per-thread TLAB with a pthread key instead, so the emitted object is
125
+ * TLS-free and each thread still gets its own buffer. Windows keeps native
126
+ * TLS (no POSIX threads available). */
121
127
  #ifdef _WIN32
122
128
  __declspec(thread) static tlab_t tlab = {NULL, NULL, NULL};
123
129
  # define TLAB_GET() (&tlab)
124
- #elif defined(__APPLE__)
130
+ #else
125
131
  static pthread_key_t tlab_key;
126
132
  static pthread_once_t tlab_key_once = PTHREAD_ONCE_INIT;
127
133
  static void tlab_key_create(void) { pthread_key_create(&tlab_key, NULL); }
@@ -135,9 +141,6 @@ static tlab_t* tlab_get(void) {
135
141
  return tl;
136
142
  }
137
143
  # define TLAB_GET() tlab_get()
138
- #else
139
- static __thread tlab_t tlab = {NULL, NULL, NULL};
140
- # define TLAB_GET() (&tlab)
141
144
  #endif
142
145
 
143
146
  static void* tlab_alloc(size_t size) {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cpyte
3
- Version: 4.2.3
3
+ Version: 4.2.5
4
4
  Summary: The Cpyte programming language compiler
5
5
  Author: Hoang Duy Tung
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes