Skip to content

Commit

Permalink
Try to improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanEngelen authored and Hardcode84 committed Sep 5, 2018
1 parent a95f42d commit 42f34c8
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions runtime/jit-rt/d/ldc/dynamic_compile.d
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,21 @@ void compileDynamicCode(in CompilerSettings settings = CompilerSettings.init)
}

/++
+ Return reference-counted functional object based on function or delegate
+ Returns a reference-counted functional object based on a function or delegate
+ with values bound to some parameters.
+ Each arg must be either value, convertible to function parameter, or
+ placeholder.
+ func must be a pointer to function or delegate.
+ Jit runtime will generate efficient function specialization based on args.
+ Function must be marked @dynamicCompile or @dynamicCompileEmit to be
+ efficiently optimized.
+ compileDynamicCode() must be called before making calls to returned
+ Each argument in `args` must be either a value, convertible to function parameter,
+ or `ldc.dynamic_compile.placeholder`.
+ `func` must be a pointer to a function or to a delegate.
+ The JIT runtime will generate an efficient function specialization based on `args`.
+ The passed function (or delegate) must be marked `@dynamicCompile` or
+ `@dynamicCompileEmit` to be efficiently optimized.
+
+ `compileDynamicCode()` must be called before making calls to the returned
+ functional object.
+
+ toDelegate() can be called on returned object to get callable delegate.
+ Returned delegate doesn't prolong lifetime of original object and
+ copy of it must be kept as long as delegate live.
+ `toDelegate()` can be called on the returned object to get a callable delegate.
+ The returned delegate does not prolong the lifetime of the original object (and
+ thus a copy of the original object must be kept as long as this delegate is alive).
+
+ Example:
+ ---
Expand Down

0 comments on commit 42f34c8

Please sign in to comment.