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
| /* Last tested on: | |
| * Ubuntu 12. | |
| * | |
| * clang version 3.2 | |
| * (https://github.com/faisalv/clang-glambda.git ff891bdfef1794e0e7ad4343a3f696da4785462a) | |
| * (llvm/trunk 167560) | |
| */ | |
| #include <cstdio> | |
| #include <vector> |
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
| #include <vector> | |
| #include <algorithm> | |
| #include <iostream> | |
| constexpr struct { | |
| // Ignore perfect forwarding. Assume basic types. | |
| template< class X, class Y > | |
| auto operator () ( X x, Y y ) | |
| -> decltype(x*y) |
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
| #include <iostream> | |
| #include <utility> | |
| using namespace std; | |
| template< class F, class X > | |
| struct Part { | |
| F f = F(); | |
| X x; |
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
| diff --git a/include/ftl/function.h b/include/ftl/function.h | |
| index 1911efa..605db4f 100644 | |
| --- a/include/ftl/function.h | |
| +++ b/include/ftl/function.h | |
| @@ -331,6 +331,7 @@ namespace ftl { | |
| /* TODO: Make currying work even when we give N > 1, N < Nparams | |
| * arguments to a function of Nparams parameters. | |
| */ | |
| + | |
| template<typename...> |
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
| diff --git a/include/ftl/function.h b/include/ftl/function.h | |
| index 1911efa..c9ccc54 100644 | |
| --- a/include/ftl/function.h | |
| +++ b/include/ftl/function.h | |
| @@ -350,13 +350,30 @@ namespace ftl { | |
| template<typename R, typename P1, typename P2, typename...Ps> | |
| struct curried<R,P1,P2,Ps...> { | |
| - | |
| - function<R(P2,Ps...)> operator() (P1 p1) const { |
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
| #include <iostream> | |
| #include <vector> | |
| #include <list> | |
| #include <algorithm> | |
| #include <string> | |
| #include <cmath> | |
| #include <future> |
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
| {-# LANGUAGE TemplateHaskell, Rank2Types, NoMonomorphismRestriction #-} | |
| import Data.List | |
| import Data.Maybe | |
| import Data.Monoid | |
| import Control.Monad.State | |
| import Control.Monad.Trans.State (state) | |
| import Control.Monad.Identity | |
| import Control.Monad | |
| import Control.Monad.Writer | |
| import Control.Applicative |
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
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") | |
| set(CMAKE_EXE_LINKER_FLAGS "${SMAKE_EXE_LINKER_FLAGS} --coverage") | |
| set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage") | |
| add_library(Alloc alloc.c) | |
| add_executable(Main, main.c) | |
| target_link_libraries(Main, Alloc) |
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
| Flat profile: | |
| Each sample counts as 0.01 seconds. | |
| % cumulative self self total | |
| time seconds seconds calls s/call s/call name | |
| 83.86 66.13 66.13 42180 0.00 0.00 ff_check_visited | |
| 7.16 71.78 5.65 776266823 0.00 0.00 os_file_id_equal | |
| 2.05 73.40 1.62 6152021 0.00 0.00 addstate | |
| 1.22 74.36 0.96 421636 0.00 0.00 nfa_regmatch | |
| 0.82 75.01 0.65 42291 0.00 0.00 os_get_file_id |
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
| movl %edx, %r15d | |
| movq %rsi, %r14 | |
| movq %rdi, %rbp | |
| # kill: RDI<def> RBP<kill> | |
| callq strlen | |
| movq %rax, %rbx | |
| movq %r14, %rdi | |
| callq strlen | |
| leaq 3(%rbx,%rax), %rdi | |
| callq xmalloc |