summaryrefslogtreecommitdiff
path: root/chapter31/src/main/smp/sys/rt
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-11-13 13:10:15 -0800
committerCliff Click <cliffc@acm.org>2026-11-13 13:10:15 -0800
commit299addd03094389bb622e0fe1d7ad585b51e146d (patch)
treefde1f3d0d440665428786c8bc35bd9d037034e2c /chapter31/src/main/smp/sys/rt
parentb7440c1e4c182ad977996d91bfb8125091ffae92 (diff)
downloadSimple-299addd03094389bb622e0fe1d7ad585b51e146d.tar.gz
Simple-299addd03094389bb622e0fe1d7ad585b51e146d.zip
Cleanp the new time & graphics APIs
Diffstat (limited to 'chapter31/src/main/smp/sys/rt')
-rw-r--r--chapter31/src/main/smp/sys/rt/simple_args.smp6
1 files changed, 4 insertions, 2 deletions
diff --git a/chapter31/src/main/smp/sys/rt/simple_args.smp b/chapter31/src/main/smp/sys/rt/simple_args.smp
index 3f630e54..f2890c1c 100644
--- a/chapter31/src/main/smp/sys/rt/simple_args.smp
+++ b/chapter31/src/main/smp/sys/rt/simple_args.smp
@@ -1,18 +1,20 @@
// Native startup support, compiled independently and linked with the CRT.
// Raw native addresses stay i64; only the arrays allocated here are Simple objects.
+// This startup object is built without sys imports.
+u32 _MAX_U32 = (1<<32)-1;
{ i64 i64 -> i64 } simple_argv = "C";
{ i64 -> i64 } strlen = "C";
{ i64 i64 i64 -> i64 } memcpy = "C";
val simple_args = { i64 argc, i64 argv ->
- if( argc < 0 || argc > 4294967295 ) return null;
+ if( argc < 0 || argc > _MAX_U32 ) return null;
// Zero-filled reference arrays require nullable elements. Every slot is
// filled before returning; the native entry bridge publishes u8[~][].
val args = new u8[~]?[argc];
for( i64 i=0; i<argc; i++ ) {
i64 src = simple_argv(argv,i);
i64 len = strlen(src);
- if( len < 0 || len > 4294967295 ) return null;
+ if( len < 0 || len > _MAX_U32 ) return null;
val bytes = new u8[len];
i64 dst = bytes;
memcpy(dst,src,len);