


## unsafe.pkg
# Compiled by:
# src/lib/std/src/standard-core.sublib# Unsafe operations on Mythryl values.
package unsafe: Unsafe { # Unsafe is from src/lib/std/src/unsafe/unsafe.api #
package mythryl_callable_c_library_interface
=
mythryl_callable_c_library_interface; # mythryl_callable_c_library_interface is from src/lib/std/src/unsafe/mythryl-callable-c-library-interface.pkg package unsafe_chunk = unsafe_chunk; # unsafe_chunk is from src/lib/std/src/unsafe/unsafe-chunk.pkg package software_generated_periodic_events
=
software_generated_periodic_events; # software_generated_periodic_events is from src/lib/std/src/unsafe/software-generated-periodic-events.pkg package vector {
#
get = inline_t::poly_vector::get; # inline_t is from src/lib/core/init/built-in.pkg make = core::runtime::asm::make_typeagnostic_ro_vector; # core is from src/lib/core/init/core.pkg };
package rw_vector {
#
get = inline_t::poly_rw_vector::get;
set = inline_t::poly_rw_vector::set;
make = core::runtime::asm::make_typeagnostic_rw_vector;
};
package vector_of_chars {
#
Vector = vector_of_chars::Vector; # vector_of_chars is from src/lib/std/src/vector-of-chars.pkg Element = vector_of_chars::Element;
get = inline_t::vector_of_chars::get;
set = inline_t::vector_of_chars::set;
make = core::runtime::asm::make_string;
};
package rw_vector_of_chars {
#
Rw_Vector = rw_vector_of_chars::Rw_Vector; # rw_vector_of_chars is from src/lib/std/src/rw-vector-of-chars.pkg Element = rw_vector_of_chars::Element;
get = inline_t::rw_vector_of_chars::get;
set = inline_t::rw_vector_of_chars::set;
my make: Int -> Rw_Vector
=
inline_t::cast core::runtime::asm::make_unt8_rw_vector;
};
package vector_of_one_byte_unts {
#
Vector = vector_of_one_byte_unts::Vector; # vector_of_one_byte_unts is from src/lib/std/src/vector-of-one-byte-unts.pkg Element = vector_of_one_byte_unts::Element;
get = inline_t::vector_of_one_byte_unts::get;
set = inline_t::vector_of_one_byte_unts::set;
my make: Int -> Vector
=
inline_t::cast core::runtime::asm::make_string;
};
package rw_vector_of_one_byte_unts {
#
Rw_Vector = rw_vector_of_one_byte_unts::Rw_Vector; # rw_vector_of_one_byte_unts is from src/lib/std/src/rw-vector-of-one-byte-unts.pkg Element = rw_vector_of_one_byte_unts::Element;
get = inline_t::rw_vector_of_one_byte_unts::get;
set = inline_t::rw_vector_of_one_byte_unts::set;
make = core::runtime::asm::make_unt8_rw_vector;
};
/** once we have flat float vectors, we can include this subpackage
package vector_of_eight_byte_floats {
#
type Vector = vector_of_eight_byte_floats::Vector
type Element = vector_of_eight_byte_floats::Element
my get: (Vector * Int) -> Element
my set: (Vector * Int * Element) -> Void
my make: Int -> Vector
};
**/
package rw_vector_of_eight_byte_floats {
#
Rw_Vector = rw_vector_of_eight_byte_floats::Rw_Vector; # rw_vector_of_eight_byte_floats is from src/lib/std/src/rw-vector-of-eight-byte-floats.pkg Element = rw_vector_of_eight_byte_floats::Element;
get = inline_t::rw_vector_of_eight_byte_floats::get;
set = inline_t::rw_vector_of_eight_byte_floats::set;
make = core::runtime::asm::make_float64_rw_vector;
};
get_current_thread_register = inline_t::get_current_thread_register;
set_current_thread_register = inline_t::set_current_thread_register;
get_handler = inline_t::gethandler;
set_handler = inline_t::sethandler;
get_pseudo = inline_t::getpseudo;
set_pseudo = inline_t::setpseudo;
my unpickle_datastructure: vector_of_one_byte_unts::Vector -> X
=
(fn x = mythryl_callable_c_library_interface::find_c_function { lib_name => "heap", fun_name => "unpickle_datastructure" } x);
my pickle_datastructure: X -> vector_of_one_byte_unts::Vector
=
(fn x = mythryl_callable_c_library_interface::find_c_function { lib_name => "heap", fun_name => "pickle_datastructure" } x);
boxed = inline_t::boxed;
cast = inline_t::cast;
# Actual representation of pervasive_package_pickle_list__global,
# a C global used to communicate with the C runtime.
# It contains a linklist of picklehash-pickle pairs:
# see (e.g.)
# src/c/main/construct-runtime-package.c
# src/c/main/load-compiledfiles.c
#
package p {
#
Pervasive_Package_Pickle_List
#
= NIL # NIL and CONS are traditional LISP terms for final and nonfinal (respectively) linklist nodes.
| CONS ( vector_of_one_byte_unts::Vector, # 16-byte hash of chunk.
unsafe_chunk::Chunk, # Arbitrary ram-chunk on Mythryl heap.
Pervasive_Package_Pickle_List # 'next' pointer in linklist.
)
;
};
#
my pervasive_package_pickle_list__global: Ref( p::Pervasive_Package_Pickle_List )
=
inline_t::cast runtime::pervasive_package_pickle_list__global;
toplevel_fate
=
REF (inline_t::make_isolated_fate (fn () = ()));
posix_interprocess_signal_handler_refcell__global
=
runtime::posix_interprocess_signal_handler_refcell__global;
};


