This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ch1 = Channel(Int32).new | |
ch2 = Channel(Int32).new | |
500.times do | |
spawn do | |
r = Random.new | |
ch2.send(r.next_int) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro container_of(ptr, _type, member) | |
{% if _type.resolve < Reference %} | |
(({{ ptr }}).as(Void*) - offsetof({{ _type }}, {{ member }})).as({{ _type }}) | |
{% else %} | |
(({{ ptr }}).as(Void*) - offsetof({{ _type }}, {{ member }})).as(Pointer({{ _type }})) | |
{% end %} | |
end | |
struct StaticList | |
@prev = uninitialized Pointer(StaticList) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Architecture: x86_64 | |
CPU op-mode(s): 32-bit, 64-bit | |
Byte Order: Little Endian | |
Address sizes: 48 bits physical, 48 bits virtual | |
CPU(s): 2 | |
On-line CPU(s) list: 0,1 | |
Thread(s) per core: 1 | |
Core(s) per socket: 2 | |
Socket(s): 1 | |
NUMA node(s): 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef FIBFUZZYSHELLSORT_HPP | |
#define FIBFUZZYSHELLSORT_HPP | |
#include <limits> | |
#include "ShellSortTemplate.hpp" | |
#include "IntegralConstantArithmetic.hpp" | |
namespace FibFuzzyNS { | |
using namespace IntegralConstantArithmetic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function y = my_midpoint_method(f, y0, a, b, n) | |
h = (b - a) / n | |
y = 0:n | |
y(0) = y0 | |
for i = 1:n | |
y(i) = y(i - 1) + h * f(a + h*(i - 1) + h*0.5, y(i - 1) + 0.5*h*f(a + h*(i - 1), y(i - 1))) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AMD Athlon(tm) II X2 270 Processor | |
# Arch Linux x86_64 | |
# gcc (GCC) 6.2.1 20160830 | |
# Crystal 0.19.4 (2016-10-07) | |
Crystal | |
181 | |
== 1.22s, 4.4Mb == | |
Crystal with new channel | |
181 | |
== 2.39s, 16.7Mb == |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bug: called create_llvm_type for T | |
0x752ed7: *CallStack::unwind:Array(Pointer(Void)) at ?? | |
0x752e6a: *CallStack#initialize:Array(Pointer(Void)) at ?? | |
0x752e3a: *CallStack::new:CallStack at ?? | |
0x73051e: *raise<Exception>:NoReturn at ?? | |
0x73050e: ??? at ?? | |
0x13e02d5: ??? at ?? | |
0x13dc0eb: ??? at ?? | |
0x13dc671: *Crystal::LLVMTyper#llvm_embedded_type<Crystal::Type+, Bool>:LLVM::Type at ?? | |
0x13de76f: *Crystal::LLVMTyper#create_llvm_struct_type<(Crystal::GenericClassInstanceType+ | Crystal::GenericClassType+ | Crystal::GenericModuleInstanceType | Crystal::GenericModuleType | Crystal::NonGenericClassType | Crystal::NonGenericModuleType+ | Crystal::VirtualType), Bool>:LLVM::Type at ?? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error in line 1: while requiring "./channel_spec.cr" | |
in channel_spec.cr:122: instantiating 'AsyncAwait::Channel(T):Class#select_with_csp()' | |
AAChannel.select_with_csp do |x| | |
[32;1m^~~~~~~~~~~~~~~[0m | |
in /home/firejox/develop/async_await/src/async_await/channel.cr:290: instantiating 'AsyncAwait::Channel(T):Class#select()' | |
self.select do |action| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lib Intrinsics | |
fun frameaddress = "llvm.frameaddress"(level : Int32) : Void* | |
end | |
module Async | |
enum Status | |
INCOMPLETE | |
COMPLETE | |
FAULT | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro show(qqq) | |
puts "#{ {{qqq}} }" | |
end | |
macro bla(name) | |
{% if name.is_a?(Def) %} | |
def {{name.name}} | |
{% body = name.body %} | |
{{ body }} | |
end |