The Crystal programming language | http://crystal-lang.org | Fund Crystal's development: http://is.gd/X7PRtI | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/
out
a better choice?
Pointer(Void).new(-1)
0xffff_ffff_ffff_ffff
is definitely -1.to_u64!
https://man7.org/linux/man-pages/man2/mmap.2.html
On error, the value MAP_FAILED (that is, (void *) -1) is returned, and errno is set to indicate the error.
Pointer(Void)
created in crystal
#gets
on the stdout pipe. however, as soon as this fiber is part of my multi-fiber application, the other fibers seem to be blocked too
crystal-posix
started when @chris-huxtable and I had design differences with the core team. Sometimes we need native types exposed rather than Int32 everywhere. The largest disagreement was on compile time vs runtime safety. @astterite wants everything to compile cross platform without macros or if respond_to?
checks. An acceptable workaround to him is platform_specific_method
may raise an error on an unsupported platform (but it still compiles - I haven't figured out why that matters if it doesn't work). We've chosen
{% if supported_platform %}
def platform_specific_method
{% end %}
Then letting the code break when compiling if you don't check with respond_to
. This let's you know something will or won't work when compiling rather than having random breakage you may or may not test for.