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
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
Skgland
4df7e94d56
rename to match toml file
...
- goals.pl is used by both compound_goal.toml and multiple_goals.toml therefor renamed the later to share a common prefix with goals.pl, to keep them together
2023-12-04 22:23:04 +01:00
Skgland
fcf2e2db05
move .pl files from tests-pl next to the .toml of the test that uses them
2023-12-04 22:16:04 +01:00
Skgland
1c52de9ab1
File-oriented testing
...
inspired by #2191 but for the `run_top_level_test_with_args`s and `run_top_level_test_no_args instead of the `load_module_test`s
2023-12-04 22:02:46 +01:00
Skgland
d24e6100a7
fix rust_beta_channel feature
2023-09-05 19:12:23 +02:00
Skgland
cd0e45b70e
fix accidentally left in println!()
2023-09-05 19:12:23 +02:00
Skgland
0f0018abe4
raise msrv for OnceLock support
2023-09-05 19:12:23 +02:00
Skgland
a95c5e26e6
add comment why blocking_write is not used
2023-09-05 19:12:23 +02:00
Skgland
70b6cc8e55
fix deadlock in load_library_as_stream
2023-09-05 19:12:22 +02:00
Skgland
86166dbf25
[WIP] make AtomTable concurrentcy ready
2023-09-05 19:12:22 +02:00
Skgland
b2130c2a48
run cargo fmt
2023-09-05 19:12:17 +02:00
Skgland
9055370326
adjust rust-version declaration
2022-10-26 23:36:07 -06:00
Skgland
1479b5d38c
add a .gitattributes file
...
- this should stop problems such as mthom/scryer-prolog#1491
by specifying the line ending
as this should take precedence over the global config
2022-06-12 15:39:55 +02:00
Skgland
232b66cfc3
adjust error message on failed formatting
2022-06-03 23:50:17 +02:00
Skgland
11ba7e47fd
make rustfmt optional
...
- when rustfmt is not detected (by attempting to run ``rustfmt --version)
no formatting will be attempted
- this should resolve issue mthom/scryer-prolog#1504
2022-06-03 23:35:55 +02:00
Bennet Bleßmann
d89eb9ff0e
change reposity url
2021-02-06 22:38:40 +01:00