newruntime for async (#11650)
* fixes overloading resolution for passing owned(Future[string]) to Future[T] * WIP: make --newruntime work with .async * memtracker: make it compile again * make Nimble compile again
This commit is contained in:
parent
d914dca513
commit
5f515410af
12 changed files with 60 additions and 47 deletions
|
|
@ -6,7 +6,7 @@ type
|
|||
|
||||
CallbackList = object
|
||||
function: CallbackFunc
|
||||
next: ref CallbackList
|
||||
next: owned(ref CallbackList)
|
||||
|
||||
FutureBase* = ref object of RootObj ## Untyped future.
|
||||
callbacks: CallbackList
|
||||
|
|
@ -99,7 +99,7 @@ template setupFutureBase(fromProc: string) =
|
|||
result.fromProc = fromProc
|
||||
currentID.inc()
|
||||
|
||||
proc newFuture*[T](fromProc: string = "unspecified"): Future[T] =
|
||||
proc newFuture*[T](fromProc: string = "unspecified"): owned(Future[T]) =
|
||||
## Creates a new future.
|
||||
##
|
||||
## Specifying ``fromProc``, which is a string specifying the name of the proc
|
||||
|
|
@ -107,7 +107,7 @@ proc newFuture*[T](fromProc: string = "unspecified"): Future[T] =
|
|||
setupFutureBase(fromProc)
|
||||
when isFutureLoggingEnabled: logFutureStart(result)
|
||||
|
||||
proc newFutureVar*[T](fromProc = "unspecified"): FutureVar[T] =
|
||||
proc newFutureVar*[T](fromProc = "unspecified"): owned(FutureVar[T]) =
|
||||
## Create a new ``FutureVar``. This Future type is ideally suited for
|
||||
## situations where you want to avoid unnecessary allocations of Futures.
|
||||
##
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue