omdev-cext 0.0.59__tar.gz → 0.0.60__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 (35) hide show
  1. {omdev_cext-0.0.59/omdev_cext.egg-info → omdev_cext-0.0.60}/PKG-INFO +2 -2
  2. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/quickjs-libc.c +4 -2
  3. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/quickjs.c +26 -8
  4. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/quickjs.h +9 -6
  5. {omdev_cext-0.0.59 → omdev_cext-0.0.60/omdev_cext.egg-info}/PKG-INFO +2 -2
  6. omdev_cext-0.0.60/omdev_cext.egg-info/requires.txt +1 -0
  7. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/pyproject.toml +2 -2
  8. omdev_cext-0.0.59/omdev_cext.egg-info/requires.txt +0 -1
  9. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/LICENSE +0 -0
  10. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/MANIFEST.in +0 -0
  11. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/README.md +0 -0
  12. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/cexts/_boilerplate.cc +0 -0
  13. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_pyqjsng.c +0 -0
  14. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/builtin-array-fromasync.h +0 -0
  15. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/builtin-iterator-zip-keyed.h +0 -0
  16. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/builtin-iterator-zip.h +0 -0
  17. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/cutils.h +0 -0
  18. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/dtoa.c +0 -0
  19. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/dtoa.h +0 -0
  20. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/libregexp-opcode.h +0 -0
  21. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/libregexp.c +0 -0
  22. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/libregexp.h +0 -0
  23. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/libunicode-table.h +0 -0
  24. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/libunicode.c +0 -0
  25. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/libunicode.h +0 -0
  26. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/list.h +0 -0
  27. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/quickjs-atom.h +0 -0
  28. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/quickjs-c-atomics.h +0 -0
  29. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/quickjs-libc.h +0 -0
  30. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev/js/quickjs/_quickjs/quickjs-opcode.h +0 -0
  31. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev_cext.egg-info/SOURCES.txt +0 -0
  32. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev_cext.egg-info/dependency_links.txt +0 -0
  33. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/omdev_cext.egg-info/top_level.txt +0 -0
  34. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/setup.cfg +0 -0
  35. {omdev_cext-0.0.59 → omdev_cext-0.0.60}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omdev-cext
3
- Version: 0.0.59
3
+ Version: 0.0.60
4
4
  Summary: omdev
5
5
  Author: wrmsr
6
6
  License-Expression: BSD-3-Clause
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.15
14
14
  Requires-Python: >=3.14
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: omdev==0.0.59
17
+ Requires-Dist: omdev==0.0.60
18
18
  Dynamic: license-file
19
19
 
20
20
  # Overview
@@ -2853,7 +2853,7 @@ static int js_os_poll_internal(JSContext *ctx, int timeout_ms, int flags)
2853
2853
  {
2854
2854
  JSRuntime *rt = JS_GetRuntime(ctx);
2855
2855
  JSThreadState *ts = js_get_thread_state(rt);
2856
- int r, w, ret, nfds, min_delay;
2856
+ int r, w, ret, nfds, min_delay, poll_nfds;
2857
2857
  JSOSRWHandler *rh;
2858
2858
  struct list_head *el;
2859
2859
  struct pollfd *pfd, *pfds, pfds_local[64];
@@ -2947,12 +2947,14 @@ static int js_os_poll_internal(JSContext *ctx, int timeout_ms, int flags)
2947
2947
  // linear-ish in practice because we bail out on the first hit,
2948
2948
  // i.e., it's probably good enough for now
2949
2949
  ret = 0;
2950
+ /* poll() returns the number of ready descriptors, not the array length. */
2951
+ poll_nfds = nfds;
2950
2952
  nfds = poll(pfds, nfds, min_delay);
2951
2953
  if (nfds < 0) {
2952
2954
  ret = -1;
2953
2955
  goto done;
2954
2956
  }
2955
- for (pfd = pfds; nfds-- > 0; pfd++) {
2957
+ for (pfd = pfds; poll_nfds-- > 0; pfd++) {
2956
2958
  rh = find_rh(ts, pfd->fd);
2957
2959
  if (rh) {
2958
2960
  r = (POLLERR|POLLHUP|POLLNVAL|POLLIN) * !JS_IsNull(rh->rw_func[0]);
@@ -2858,6 +2858,7 @@ JSContext *JS_NewContextRaw(JSRuntime *rt)
2858
2858
  ctx->class_proto = js_malloc_rt(rt, sizeof(ctx->class_proto[0]) *
2859
2859
  rt->class_count);
2860
2860
  if (!ctx->class_proto) {
2861
+ remove_gc_object(&ctx->header);
2861
2862
  js_free_rt(rt, ctx);
2862
2863
  return NULL;
2863
2864
  }
@@ -42585,8 +42586,16 @@ static JSValue js_function_bind(JSContext *ctx, JSValueConst this_val,
42585
42586
  if (check_function(ctx, this_val))
42586
42587
  return JS_EXCEPTION;
42587
42588
 
42588
- func_obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
42589
+ JSValue prototype = JS_GetPrototype(ctx, this_val);
42590
+
42591
+ if (JS_IsException(prototype))
42592
+ return JS_EXCEPTION;
42593
+
42594
+ func_obj = JS_NewObjectProtoClass(ctx, prototype,
42589
42595
  JS_CLASS_BOUND_FUNCTION);
42596
+
42597
+ JS_FreeValue(ctx, prototype);
42598
+
42590
42599
  if (JS_IsException(func_obj))
42591
42600
  return JS_EXCEPTION;
42592
42601
  p = JS_VALUE_GET_OBJ(func_obj);
@@ -48089,27 +48098,35 @@ static JSValue js_string_repeat(JSContext *ctx, JSValueConst this_val,
48089
48098
  JSValue str;
48090
48099
  StringBuffer b_s, *b = &b_s;
48091
48100
  JSString *p;
48092
- int64_t val;
48101
+ double val;
48093
48102
  int n, len;
48094
48103
 
48095
48104
  str = JS_ToStringCheckObject(ctx, this_val);
48096
48105
  if (JS_IsException(str))
48097
48106
  goto fail;
48098
- if (JS_ToInt64Sat(ctx, &val, argv[0]))
48107
+ if (JS_ToFloat64(ctx, &val, argv[0]))
48099
48108
  goto fail;
48100
- if (val < 0 || val > 2147483647) {
48109
+ // ToIntegerOrInfinity: NaN maps to zero, everything else truncates
48110
+ if (isnan(val))
48111
+ val = 0;
48112
+ else
48113
+ val = trunc(val);
48114
+ // only a negative or infinite count is out of range; a large finite
48115
+ // count is not, it merely risks exceeding the maximum string length
48116
+ if (val < 0 || val == INFINITY) {
48101
48117
  JS_ThrowRangeError(ctx, "invalid repeat count");
48102
48118
  goto fail;
48103
48119
  }
48104
- n = val;
48105
48120
  p = JS_VALUE_GET_STRING(str);
48106
48121
  len = p->len;
48107
- if (len == 0 || n == 1)
48122
+ // any number of copies of the empty string is the empty string
48123
+ if (len == 0 || val == 1)
48108
48124
  return str;
48109
48125
  if (val * len > JS_STRING_LEN_MAX) {
48110
- JS_ThrowRangeError(ctx, "invalid string length");
48126
+ JS_ThrowRangeError(ctx, "string too long");
48111
48127
  goto fail;
48112
48128
  }
48129
+ n = val;
48113
48130
  if (string_buffer_init2(ctx, b, n * len, p->is_wide_char))
48114
48131
  goto fail;
48115
48132
  if (len == 1) {
@@ -63001,7 +63018,8 @@ int JS_AddIntrinsicTypedArrays(JSContext *ctx)
63001
63018
 
63002
63019
  static double js__now_ms(void)
63003
63020
  {
63004
- return js__hrtime_ns() / 1e6;
63021
+ uint64_t ns = js__hrtime_ns();
63022
+ return (double)(ns / 1000000) + (double)(ns % 1000000) / 1e6;
63005
63023
  }
63006
63024
 
63007
63025
  static JSValue js_perf_now(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
@@ -315,7 +315,10 @@ static inline bool JS_VALUE_IS_NAN(JSValue v)
315
315
  #else /* !JS_NAN_BOXING */
316
316
 
317
317
  typedef union JSValueUnion {
318
- int32_t int32;
318
+ /* JS_MKVAL() writes all 64 bits even though only 32 are needed:
319
+ leaving the upper half uninitialized makes GCC 14+ generate much
320
+ slower code on x86-64 */
321
+ uint64_t uint64;
319
322
  double float64;
320
323
  void *ptr;
321
324
  int32_t short_big_int;
@@ -329,10 +332,10 @@ typedef struct JSValue {
329
332
  #define JS_VALUE_GET_TAG(v) ((int32_t)(v).tag)
330
333
  /* same as JS_VALUE_GET_TAG, but return JS_TAG_FLOAT64 with NaN boxing */
331
334
  #define JS_VALUE_GET_NORM_TAG(v) JS_VALUE_GET_TAG(v)
332
- #define JS_VALUE_GET_INT(v) ((v).u.int32)
333
- #define JS_VALUE_GET_BOOL(v) ((v).u.int32)
335
+ #define JS_VALUE_GET_INT(v) ((int)(v).u.uint64)
336
+ #define JS_VALUE_GET_BOOL(v) ((int)(v).u.uint64)
334
337
  #define JS_VALUE_GET_FLOAT64(v) ((v).u.float64)
335
- #define JS_VALUE_GET_SHORT_BIG_INT(v) ((v).u.short_big_int)
338
+ #define JS_VALUE_GET_SHORT_BIG_INT(v) ((int32_t)(v).u.uint64)
336
339
  #define JS_VALUE_GET_PTR(v) ((v).u.ptr)
337
340
 
338
341
  /* msvc doesn't understand designated initializers without /std:c++20 */
@@ -347,7 +350,7 @@ static inline JSValue JS_MKPTR(int64_t tag, void *ptr)
347
350
  static inline JSValue JS_MKVAL(int64_t tag, int32_t int32)
348
351
  {
349
352
  JSValue v;
350
- v.u.int32 = int32;
353
+ v.u.uint64 = (uint32_t)int32;
351
354
  v.tag = tag;
352
355
  return v;
353
356
  }
@@ -364,7 +367,7 @@ static inline JSValue JS_MKNAN(void)
364
367
  #define JS_NAN JS_MKNAN() /* alas, not a constant expression */
365
368
  #else
366
369
  #define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
367
- #define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
370
+ #define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .uint64 = (uint32_t)(val) }, tag }
368
371
  #define JS_NAN (JSValue){ (JSValueUnion){ .float64 = NAN }, JS_TAG_FLOAT64 }
369
372
  #endif
370
373
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: omdev-cext
3
- Version: 0.0.59
3
+ Version: 0.0.60
4
4
  Summary: omdev
5
5
  Author: wrmsr
6
6
  License-Expression: BSD-3-Clause
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.15
14
14
  Requires-Python: >=3.14
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: omdev==0.0.59
17
+ Requires-Dist: omdev==0.0.60
18
18
  Dynamic: license-file
19
19
 
20
20
  # Overview
@@ -0,0 +1 @@
1
+ omdev==0.0.60
@@ -13,7 +13,7 @@ urls = {source = 'https://github.com/wrmsr/om'}
13
13
  license = 'BSD-3-Clause'
14
14
  readme = 'README.md'
15
15
  requires-python = '>=3.14'
16
- version = '0.0.59'
16
+ version = '0.0.60'
17
17
  classifiers = [
18
18
  'Intended Audience :: Developers',
19
19
  'Operating System :: OS Independent',
@@ -24,7 +24,7 @@ classifiers = [
24
24
  ]
25
25
  description = 'omdev'
26
26
  dependencies = [
27
- 'omdev == 0.0.59',
27
+ 'omdev == 0.0.60',
28
28
  ]
29
29
 
30
30
  [tool.setuptools]
@@ -1 +0,0 @@
1
- omdev==0.0.59
File without changes
File without changes
File without changes
File without changes
File without changes