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
/// Context: I am currently working on improving debug info formatting in druntime | |
/// There are a few obvious things which are **very** wrong and performances seem abysmal. | |
/// The following is the first benchmark code I came up with: | |
import std.stdio; | |
void main () | |
{ | |
try | |
{ | |
foo(); |
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
import std.traits; | |
import std.typecons; | |
import std.meta; | |
struct Foo1 | |
{ | |
@disable this(this); | |
@disable ref Foo1 opAssign () (auto ref Foo1 other); | |
void* ptr; |
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
// Compiled with: | |
// ./dmd2/linux/bin64/dmd -L-rpath=`pwd`/dmd2/linux/lib64/ -L-L`pwd`/dmd2/linux/lib64/ -defaultlib=libphobos2.so -fPIC -shared -ofmytest.so src/mytest.d | |
// Run with: irb -r ./mytest.so | |
module mytest; | |
// Everything in Ruby is a value, which is a pointer under the hood, | |
// but is used as numeric value. IDK what's better here: void* or ulong | |
alias ulong VALUE; | |
// This is a bit tricky: Some methods takes function pointers which are |