Skgland
833c3bd77f
run rustfmt
2026-03-21 14:24:13 +01:00
Skgland
153f04b72a
adjust interrupt handling
...
we used to spend ~5.8% of the time on getting the next value of the 0..INSTRUCTIONS_PER_INTERRUPT_POLL iterator
increment on Wrapping<u8> now only takes ~0.58 of the time
2026-03-21 14:20:11 +01:00
Skgland
8aab887388
switch from Integer to u128
...
- u128 is only 16 bytes instead of 24
- incrementing u128 does not involve heap allocations
- u128 should be sufficent
it would take more than 2 sextilion years to overflow if we would be incrementing it every tick at 5GHz
i.e. 2^128-1 / 5 GHz / 60 / 60 / 24 / 356 > 2 sextilion
before this ~3.2% of the execution time of the program in https://github.com/mthom/scryer-prolog/issues/3265#issuecomment-4103176469 was spend in the increment_call_count function, after this change it's down to 0.3%
2026-03-21 13:36:40 +01:00
Skgland
2dc904aa73
run apt update before apt install
...
https://github.com/orgs/community/discussions/145882#discussioncomment-11447924
2026-02-20 23:00:45 +01:00
Skgland
0ceab41b39
fix warning in CI about using apt in a script
2026-02-20 22:57:44 +01:00
Skgland
2a79d6fc40
run cargo fmt
2026-02-20 22:52:25 +01:00
Skgland
49e49b425d
fix clippy lint warning
2026-02-20 22:47:08 +01:00
Skgland
7d0d61d789
remove no longer necessary allows
2026-02-20 22:45:09 +01:00
Skgland
5ef5a3f30a
replace custom modular_bitfields fork with update upstream
...
part of #2468
2026-02-20 22:40:33 +01:00
Skgland
65aadb3b88
reduce visibility to pub(crate) to prevent accidentally exposing
2026-01-24 04:20:13 +01:00
Skgland
dfad71bc6e
fix some lint warnings
2026-01-24 04:13:26 +01:00
Skgland
d8c6fa1fe5
don't expose lexical error and provide location
2026-01-24 04:08:41 +01:00
Skgland
18b476af28
make ParserError a struct with an enum kind field
2026-01-24 04:08:40 +01:00
Skgland
bd233fedfd
add location to InvalidSingleQuotedCharacter
2026-01-24 04:08:40 +01:00
Skgland
083546442d
make match exhaustive
2026-01-24 04:08:40 +01:00
Skgland
3343188756
replace pairs of usize with location struct
2026-01-24 04:08:40 +01:00
Skgland
b14e363d5e
run rustfmt to fix formatting
2026-01-10 18:31:40 +01:00
Skgland
5064760b1e
fix spelling
2026-01-10 18:13:59 +01:00
Skgland
eca4262be6
fix clippy lints
2026-01-10 17:52:34 +01:00
Skgland
73c26bed2a
extaract the static part of the instructions template directly into the instructions module
...
This way goto source doesn't end up in a generated file for those parts and they can be edited directly.
I have way too often accidentally edited the generated file.
2026-01-10 17:48:07 +01:00
Skgland
129cca53ed
throw error(resource_error(memory), []) when the list length exceeds usize.
2025-12-10 00:04:24 +01:00
Skgland
00aba96185
remove overengineered RecursionGuard
2025-12-08 22:27:24 +01:00
Skgland
616f071cd9
fix another integer overflow
2025-12-08 19:59:43 +01:00
Skgland
580572aec6
don't calculate panic message eagerly
2025-12-07 23:06:09 +01:00
Skgland
47e908bf76
handle overflown in Heap::with_cell_capacity
2025-12-07 22:59:00 +01:00
Skgland
11901b5fde
handle oob heap index calculation
2025-12-07 21:45:13 +01:00
Skgland
d63b0a192c
use checked multiplication in heap_index! macro
2025-12-07 21:31:24 +01:00
Skgland
2fc08dde1e
prevent multiply with overflow resulting in odd errors/segv
2025-12-07 21:27:24 +01:00
Skgland
193cfabc66
detect recursive throw_resource_error and panic instead of causing a segmentation fault
2025-12-07 21:08:17 +01:00
Skgland
7c3ffd0e87
deny function_casts_as_integer warnings
2025-12-04 23:35:35 +01:00
Skgland
797a8f8611
fix function_casts_as_integer warning
...
Comparing addresses of function pointers is brittle.
Functions may be duplicated resulting in function pointers to the same function to compare !=.
Functions may be merged/de-duplicated resulting in function pointers to different function to compare ==.
The later shouldn't be relevant here as the function differ in behavior, but mentioning it for completeness.
2025-12-04 23:35:23 +01:00
Skgland
6ec8c9064f
fix pstr_iter_tests test
2025-11-20 23:08:46 +01:00
Skgland
d4f2f7ba2b
remove RESOURCE_ERROR_OFFSET_INIT
...
With it when using multiple Machine in one process only the first would store the pre-allocated error.
Instead Heap.resource_err_loc is now Option<NonZero<usize>> instead of usize using None for uninitialized.
The cell at index 0 should alredy be used by a runtime reserved interstitial cell that is allocated prior. So requiring the offset to be non zero should be fine.
2025-11-20 21:44:29 +01:00
Skgland
a05dc79505
fix unecessary parens in macro
2025-11-20 21:24:47 +01:00
Skgland
e90c813528
return an AllocError instead of panicing in Heap::with_cell_capacity
2025-11-20 21:13:17 +01:00
Skgland
516848e214
wrap resource_error into an error/2 functor and don't wrap it into a syntax_error functor
2025-11-20 01:22:18 +01:00
Skgland
6063783e9d
propagate AllocErrro instead of unwrapping
2025-11-20 00:19:24 +01:00
Skgland
e9e97fe82a
handle machine heap/stack allocation error
2025-11-19 22:17:24 +01:00
Skgland
5686b69013
stub a clippy config
...
with things we need to get rid of replace if we want to eliminate panics due to oom
2025-11-19 19:23:42 +01:00
Skgland
248b05c992
use as_bytes().to_vec() instead of bytes().collect()
...
copying a slice into a vec should be easier to optimize by the complier than collecting a byte iteration into a vec
2025-11-19 19:23:41 +01:00
Skgland
a283c8bdc2
remove some uncessary allocations/copies
2025-11-19 19:23:41 +01:00
Skgland
6b5ec3fab8
ignore incompatible msrv in compat module
2025-11-19 19:23:41 +01:00
Skgland
a0b4162d7a
improve count_to_letter_code
...
- reserve the complete required length at the beginning to reduce reallocations
- use u8 instead of char so that we can re-use the allocation for the string
2025-11-19 19:23:41 +01:00
Skgland
119761ad10
ignore unused_parens warning
...
parens are generated by external macro
2025-11-18 21:42:00 +01:00
Skgland
bf8651db29
remove two unecessary clones
2025-11-18 21:29:22 +01:00
Skgland
f8b9944f5c
update documentation
2025-09-28 19:50:21 +02:00
Skgland
6e7dbfc75e
consistently treat bool as i8
2025-09-28 18:29:20 +02:00
Skgland
1add5a9a75
add ffi types for non-fixed-sized integers
2025-09-28 18:17:35 +02:00
Skgland
777e6de9ee
fix missing quotes
2025-09-28 13:43:09 +02:00
Skgland
2443af57d0
fixup quad
2025-09-27 23:14:14 +02:00
Skgland
ed03d5b1b4
move CI job release from retired ubuntu-20.04 image to ubuntu-22.04
...
the new image is the same as all other ubuntu jobs
2025-09-27 22:54:45 +02:00
Skgland
9376bc6369
fix mthom/scryer-prolog#3073
2025-09-27 22:48:05 +02:00
Skgland
2f43c3ff40
add regression test for issue 3073
2025-09-27 22:05:51 +02:00
Skgland
c067bfa832
allow 3rd argument of ffi:read_ptr to not be a variable
2025-08-29 00:36:35 +02:00
Skgland
14ce052bf2
export array_type/3
2025-08-26 00:33:16 +02:00
Skgland
252361fc20
fix left over todo
2025-08-26 00:15:13 +02:00
Skgland
78c08b87b6
cleanup ffi error handling and use Atom instead of &str in appropriate places
2025-08-26 00:01:35 +02:00
Skgland
a140720c6f
use representation_error rather than resource_error
2025-08-25 20:14:14 +02:00
Skgland
6f3f66c407
fix builds without ffi feature
2025-08-24 21:08:52 +02:00
Skgland
1f7a60dec9
add meta_predicate declaration for with_locals/2
2025-08-24 20:25:47 +02:00
Skgland
ce9b41815d
add documentation
2025-08-24 20:23:17 +02:00
Skgland
80bf276e09
run rustfmt
2025-08-24 19:57:54 +02:00
Skgland
8bc8171ec7
fix define_foreign_struct
2025-08-24 19:56:26 +02:00
Skgland
3b5b768f4a
make ffi error structure not found point to the correct culprit
2025-08-24 19:56:26 +02:00
Skgland
176858ad42
fix map_ffi_arg
2025-08-24 19:56:26 +02:00
Skgland
eba681786d
make map_ffi_args a method and throw an instantiation error when encountering a variable
2025-08-24 19:56:25 +02:00
Skgland
f4297e365f
don't crash on empty list and differentiate list head not being string like
2025-08-24 19:56:25 +02:00
Skgland
cd777294b9
use setup_call_cleanup/3 for with_locals
...
as suggested by triska
2025-08-24 19:56:25 +02:00
Skgland
3e929511bb
add a test for with_locals
2025-08-24 19:56:24 +02:00
Skgland
d1356db7e3
include a culprit in ffi_error
2025-08-24 19:56:24 +02:00
Skgland
7b2bf73ba1
fix with_locals
2025-08-24 19:56:24 +02:00
Skgland
edd6d44bd6
require array_length to be > 0
...
C does not have 0-sized types
2025-08-24 19:56:24 +02:00
Skgland
4b5e4a2745
fix some things in ffi.pl
...
thanks triska for pointing out most of these
2025-08-24 19:56:23 +02:00
Skgland
3a4dfc46da
add ffi helpers
2025-08-24 19:56:23 +02:00
Skgland
d8346b1651
don't place allocate, read_ptr and deallocate between use_foreign_module and its helper predicates
2025-08-24 19:56:23 +02:00
Skgland
20d52c093a
add ffi:{allocate,read_ptr,deallocate}
2025-08-24 19:56:23 +02:00
Skgland
35d34231f2
don't fail the build script if we couldn't parse a file
...
this way we get to the actual compilation in which rustc shouldl fail with a more helpfull error message
2025-08-24 19:56:17 +02:00
Skgland
633b86ddc4
make CI read msrv from Cargo.toml
...
instead of hardcoding it, so we have a single source of truth
2025-08-18 21:10:27 +02:00
Skgland
348c5029b3
reduce msrv back to 1.85
2025-08-18 20:52:15 +02:00
Skgland
6338a40eed
fixup logtalk-test
2025-08-17 22:52:45 +02:00
Skgland
3aa272e44d
explicitly pass the target to cargo-deb
2025-08-17 22:31:28 +02:00
Skgland
52f3ddd20d
fix paths
2025-08-17 22:12:54 +02:00
Skgland
f1171e2fb2
build debian packages on linux targets
2025-08-17 21:36:42 +02:00
Skgland
e38ee14580
add tests for issue 3048
2025-08-17 14:50:15 +02:00
Skgland
e1a52a4dde
allow passing a null through a cstr arg/return
2025-08-08 22:45:24 +02:00
Skgland
7b960a7d63
fix clippy lint warning
2025-08-08 22:08:13 +02:00
Skgland
39bd520542
ignore pstr_iter_tests test in miri as it takes too long
2024-07-07 13:22:49 +02:00
Skgland
78b83ca1e1
simplify os:argv/1 fix
2024-01-04 19:26:10 +01:00
Skgland
ea0130d114
use once to limit solutions instead of cut
2024-01-04 18:14:32 +01:00
Skgland
e66e7c5034
add another test case for os:argv/1
2024-01-04 18:12:38 +01:00
Skgland
8bd0317e9c
fix os:argv(V) not completing
2024-01-02 21:43:38 +01:00
Skgland
76b1167842
fix os:argv
2024-01-02 20:54:37 +01:00
Skgland
7537686d8f
cover both args ending in -- and args not ending in -- for os:argv/1 test
2024-01-02 20:48:38 +01:00
Skgland
6fc340c4db
remove unnecessary true
2024-01-02 20:27:14 +01:00
Skgland
38f25af47d
cover trailing -- and os:argv([]) in os_argv test
2024-01-02 20:23:53 +01:00
Skgland
91df533834
fix os:argv/1
2024-01-02 19:55:27 +01:00
Skgland
9a05ca0667
add failing test for os:argv issue
...
See https://github.com/mthom/scryer-prolog/pull/2263#issuecomment-1874400820
2024-01-02 19:51:09 +01:00
Skgland
147e47c8eb
fix missing .pl file for singleton test case and move .pl files under <testcase>.in/
...
follow up to #2205
2023-12-06 21:21:28 +01:00
Skgland
57b52fbe90
fix windows test by not disabling normalization
...
- this re-enables line ending and file path normalization
- the latter might be unwanted, but there is only a shared flag
- this might result in too loose matching of / and \ in stdout and stderr as prolog syntax may be mistaken for a path
2023-12-04 22:59:52 +01:00
Skgland
b052b62b16
fix formatting
2023-12-04 22:41:25 +01:00