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:
Andreas Rumpf 2019-07-05 01:42:17 +02:00 • committed by GitHub
commit 5f515410af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 60 additions and 47 deletions

View file

@ -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.
##