fix spelling
This commit is contained in:
@@ -445,7 +445,7 @@ impl<T: ?Sized + ArenaAllocated> TypedAllocSlab<T> {
|
||||
pub fn to_untyped(self: Box<Self>) -> (TypedArenaPtr<T>, UntypedArenaSlab) {
|
||||
let raw_box = Box::into_raw(self);
|
||||
|
||||
// safety: the pointer from Box::into_raw fullfills addr_of_mut's saftey requirements
|
||||
// safety: the pointer from Box::into_raw fulfills addr_of_mut's safety requirements
|
||||
let payload_ptr = unsafe { addr_of_mut!((*raw_box).payload) };
|
||||
|
||||
(
|
||||
|
||||
@@ -540,7 +540,7 @@ impl AtomTable {
|
||||
table.insert(atom);
|
||||
block_epoch.table.replace(table);
|
||||
|
||||
// expicit drop to ensure we don't accidentally drop it early
|
||||
// explicit drop to ensure we don't accidentally drop it early
|
||||
drop(update_guard);
|
||||
|
||||
return atom;
|
||||
|
||||
@@ -981,7 +981,7 @@ pub enum FfiError {
|
||||
got: usize,
|
||||
},
|
||||
AllocationFailed,
|
||||
// LayoutError should never occour
|
||||
// LayoutError should never occur
|
||||
LayoutError,
|
||||
UnsupportedTypedef,
|
||||
UnsupportedAbi,
|
||||
|
||||
@@ -310,7 +310,7 @@ impl MachineState {
|
||||
self.throw_interrupt_exception();
|
||||
self.backtrack();
|
||||
|
||||
// We have extracted controll over the Tokio runtime to the calling context for enabling library use case
|
||||
// We have extracted control over the Tokio runtime to the calling context for enabling library use case
|
||||
// (see https://github.com/mthom/scryer-prolog/pull/1880)
|
||||
// So we only have access to a runtime handle in here and can't shut it down.
|
||||
// Since I'm not aware of the consequences of deactivating this new code which came in while PR 1880
|
||||
|
||||
@@ -445,7 +445,7 @@ impl Index<usize> for ReservedHeapSection {
|
||||
|
||||
/// Computes the number of bytes required to pad a string of length `chunk_len`
|
||||
/// with zeroes, such that `chunk_len + pstr_sentinel_length(chunk_len)` is a
|
||||
/// multiple of `Heap::heap_cell_alignement()`.
|
||||
/// multiple of `Heap::heap_cell_alignment()`.
|
||||
fn pstr_sentinel_length(chunk_len: usize) -> usize {
|
||||
let res = chunk_len.next_multiple_of(ALIGN) - chunk_len;
|
||||
|
||||
|
||||
@@ -415,7 +415,7 @@ pub struct QueryState<'a> {
|
||||
|
||||
impl Drop for QueryState<'_> {
|
||||
fn drop(&mut self) {
|
||||
// FIXME: This may be wrong if the iterator is not fully consumend, but from testing it
|
||||
// FIXME: This may be wrong if the iterator is not fully consumed, but from testing it
|
||||
// seems fine. Is this really ok?
|
||||
self.machine.trust_me();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::MachineBuilder;
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
||||
fn programatic_query() {
|
||||
fn programmatic_query() {
|
||||
let mut machine = MachineBuilder::default().build();
|
||||
|
||||
machine.load_module_string(
|
||||
|
||||
@@ -191,7 +191,7 @@ impl Stack {
|
||||
let cell_ptr = new_ptr.add(offset).cast::<HeapCellValue>();
|
||||
ptr::write(cell_ptr.as_ptr(), stack_loc_as_cell!(AndFrame, e, idx + 1));
|
||||
|
||||
// Because in the Index and IndexMut inplementations we need to get this from
|
||||
// Because in the Index and IndexMut implementations we need to get this from
|
||||
// exposed provenance, we need to expose the provenance here, even though we don't
|
||||
// actually use the value for anything. This is a reminder that `expose_provenance`
|
||||
// isn't just a cast from a pointer to an integer but has actual side effects.
|
||||
@@ -224,7 +224,7 @@ impl Stack {
|
||||
let cell_ptr = new_ptr.byte_add(offset).cast::<HeapCellValue>();
|
||||
ptr::write(cell_ptr.as_ptr(), stack_loc_as_cell!(OrFrame, b, idx));
|
||||
|
||||
// Because in the Index and IndexMut inplementations we need to get this from
|
||||
// Because in the Index and IndexMut implementations we need to get this from
|
||||
// exposed provenance, we need to expose the provenance here, even though we don't
|
||||
// actually use the value for anything. This is a reminder that `expose_provenance`
|
||||
// isn't just a cast from a pointer to an integer but has actual side effects.
|
||||
|
||||
@@ -4292,7 +4292,7 @@ impl Machine {
|
||||
}
|
||||
let value = self.rng.gen_range(lower..upper);
|
||||
// Safety:
|
||||
// - lower and uper bounds are Fixnum values
|
||||
// - lower and upper bounds are Fixnum values
|
||||
// - value is inbetween lower and upper
|
||||
// - fixnums value range has no gaps
|
||||
// so value is also a valid Fixnum value
|
||||
@@ -4812,7 +4812,7 @@ impl Machine {
|
||||
if interruption {
|
||||
self.machine_st.throw_interrupt_exception();
|
||||
self.machine_st.backtrack();
|
||||
// We have extracted controll over the Tokio runtime to the calling context for enabling library use case
|
||||
// We have extracted control over the Tokio runtime to the calling context for enabling library use case
|
||||
// (see https://github.com/mthom/scryer-prolog/pull/1880)
|
||||
// So we only have access to a runtime handle in here and can't shut it down.
|
||||
// Since I'm not aware of the consequences of deactivating this new code which came in while PR 1880
|
||||
|
||||
@@ -361,7 +361,7 @@ impl OpDesc {
|
||||
|
||||
#[inline]
|
||||
pub fn get_spec(self) -> OpDeclSpec {
|
||||
OpDeclSpec::try_from(self.spec()).expect("OpDecl always contains a valud OpDeclSpec")
|
||||
OpDeclSpec::try_from(self.spec()).expect("OpDecl always contains a valid OpDeclSpec")
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
||||
@@ -10,14 +10,14 @@ use crate::atom_table::{AtomString, AtomTable, STATIC_ATOMS_MAP};
|
||||
|
||||
// TODO: Maybe add validation to the helper
|
||||
pub struct Helper {
|
||||
highligher: MatchingBracketHighlighter,
|
||||
highlighter: MatchingBracketHighlighter,
|
||||
pub atoms: Weak<AtomTable>,
|
||||
}
|
||||
|
||||
impl Helper {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
highligher: MatchingBracketHighlighter::new(),
|
||||
highlighter: MatchingBracketHighlighter::new(),
|
||||
atoms: Weak::new(),
|
||||
}
|
||||
}
|
||||
@@ -90,11 +90,11 @@ impl Completer for Helper {
|
||||
|
||||
impl Highlighter for Helper {
|
||||
fn highlight<'l>(&self, line: &'l str, pos: usize) -> std::borrow::Cow<'l, str> {
|
||||
self.highligher.highlight(line, pos)
|
||||
self.highlighter.highlight(line, pos)
|
||||
}
|
||||
|
||||
fn highlight_char(&self, line: &str, pos: usize, forced: bool) -> bool {
|
||||
self.highligher.highlight_char(line, pos, forced)
|
||||
self.highlighter.highlight_char(line, pos, forced)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -782,7 +782,7 @@ impl UntypedArenaPtr {
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
/// - this UntypedArenaPtr actuall pointee type is T
|
||||
/// - this UntypedArenaPtr actual pointee type is T
|
||||
/// - the pointer must be non-null
|
||||
#[inline]
|
||||
pub unsafe fn as_typed_ptr<T: ?Sized + ArenaAllocated>(self) -> TypedArenaPtr<T>
|
||||
|
||||
Reference in New Issue
Block a user