This file contains hidden or 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
| private enum staticMapExpandFactor = 150; | |
| private string generateCases() | |
| { | |
| string[staticMapExpandFactor] chunks; | |
| chunks[0] = q{}; | |
| static foreach (enum i; 0 .. staticMapExpandFactor - 1) | |
| chunks[i + 1] = chunks[i] ~ `F!(Args[` ~ i.stringof ~ `]),`; | |
| string ret = `AliasSeq!(`; | |
| foreach (chunk; chunks) | |
| ret ~= `q{alias staticMap = AliasSeq!(` ~ chunk ~ `);},`; |
This file contains hidden or 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
| # compiler commit hash: 0e837363832a5deb0447e10f9e615c0497e521f7 | |
| # which got compiled with the following commandline: | |
| # make -f posix.mak HOST_DMD=~/d/ldc2-1.23.0-linux-x86_64/bin/ldmd2 DFLAGS+="-g -O3" | |
| uplimk@uplimk-virtual-machine:~/d/dmd$ hyperfine -w 10 "generated/linux/release/64/dmd xx_tf.d -sktf -c" "generated/linux/release/64/dmd xx.d -c " "generated/linux/release/64/dmd xx_adam.d -c" | |
| Benchmark #1: generated/linux/release/64/dmd xx_tf.d -sktf -c | |
| Time (mean ± σ): 9.1 ms ± 0.4 ms [User: 5.8 ms, System: 3.2 ms] | |
| Range (min … max): 8.5 ms … 10.7 ms 288 runs | |
| 0.02user 0.01system 0:00.04elapsed 92%CPU (0avgtext+0avgdata 11672maxresident)k |
This file contains hidden or 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
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() | |
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() | |
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() | |
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() | |
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() | |
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() | |
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() | |
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() | |
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() | |
| src/dmd/dimport.d(269): bytes: 136 Pool!(TypeIdentifier).makeNew() |
This file contains hidden or 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
| static string skipWhiteBeforeAndAfter(const string s, out string rest) | |
| pure nothrow @nogc @safe | |
| { | |
| string result = null; | |
| size_t startAt = 0; | |
| size_t stopAt = 0; | |
| while(s.length > startAt) | |
| { |
This file contains hidden or 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
| #!/bin/bash | |
| orig_lines=$(cloc ${1} | tail -n 2 | head -n 1 | rev | cut -d ' ' -f 1 | rev) | |
| time dmd -c -vcg-ast -o- ${1} | |
| mv ${1}.cg expanded_${1} | |
| exp_lines=$(cloc expanded_${1} | tail -n 2 | head -n 1 | rev | cut -d ' ' -f 1 | rev) | |
| exp_factor=$(expr $exp_lines / $orig_lines) | |
| echo "" | |
| echo "${1} lines: $orig_lines" | |
| echo "expanded ${1} lines: $exp_lines" | |
| echo "-------------------------------" |
This file contains hidden or 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
| bool strtoull(string input, out ulong result) | |
| { | |
| ptrdiff_t length = 0; | |
| // ulong result = 0; | |
| ptrdiff_t input_length = input.length; | |
| char c = void; | |
| do { c = input.ptr[length++]; } | |
| while ((c >= '0' && c <= '9') && (input_length-- > 0)); | |
| --length; |
This file contains hidden or 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
| /******************************************************* | |
| HIDAPI - Multi-Platform library for | |
| communication with HID devices. | |
| Alan Ott | |
| Signal 11 Software | |
| 8/22/2009 | |
| Copyright 2009, All Rights Reserved. |
This file contains hidden or 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.stdio; | |
| import std.algorithm; | |
| import std.file; | |
| import std.path; | |
| import std.range; | |
| import std.conv; | |
| struct build | |
| { | |
| string[] include_paths; |
This file contains hidden or 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
| // D's new runtime reflection preview! | |
| import core.reflect.type; | |
| import core.reflect.node; | |
| import core.reflect.decl; | |
| extern (C) void*** fnXXfn(void* p, void** pp); | |
| static immutable fn_x = cast(immutable FunctionDeclaration) nodeFromName("fnXXfn"); | |
| pragma(msg, StructToString(cppfn_decl)); | |
| static immutable cppfn_decl = cast(immutable FunctionDeclaration) nodeFromName("cppfn"); |