Merge remote-tracking branch 'origin/master' into cargs2-dev

This commit is contained in:
Justin Ethier 2021-03-06 21:37:23 -05:00
commit eca1956400
5 changed files with 13 additions and 22 deletions

View file

@ -1,6 +1,12 @@
# Changelog
## 0.27 - TBD
## 0.28 - TBD
Bug Fixes
- Arthur Maciel replaced high resolution code in the runtime to use `clock_gettime` instead of `gettimeofday`.
## 0.27 - March 5, 2021
Features

View file

@ -4,7 +4,7 @@ MAINTAINER justin.ethier@gmail.com
ARG DEBIAN_FRONTEND=noninteractive
ENV CYCLONE_VERSION v0.26
ENV CYCLONE_VERSION v0.27
RUN apt update -y
RUN apt install -y build-essential git rsync texinfo libtommath-dev libck-dev make gcc

View file

@ -96,12 +96,12 @@ void Cyc_check_bounds(void *data, const char *label, int len, int index)
#ifdef CYC_HIGH_RES_TIMERS
/* High resolution timers */
#include <sys/time.h>
#include <time.h>
long long hrt_get_current()
{
struct timeval tv;
gettimeofday(&tv, NULL); /* TODO: longer-term consider using clock_gettime instead */
long long jiffy = (tv.tv_sec)*1000000LL + tv.tv_usec;
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
long long jiffy = (now.tv_sec)*1000000LL + now.tv_nsec/1000; // nano->microseconds
return jiffy;
}

View file

@ -18,7 +18,7 @@
memloc
)
(begin
(define *version-number* "0.26")
(define *version-number* "0.28")
(define *version-name* "")
(define *version* (string-append *version-number* " " *version-name* ""))

View file

@ -26,21 +26,6 @@
make_double(box, 0.0);
clock_gettime(CLOCK_MONOTONIC, &now);
long long jiffy = (now.tv_sec)*1000000LL + now.tv_nsec/1000; // nano->microseconds
/* Future consideration:
mp_int bn_tmp, bn_tmp2, bn_tmp3;
mp_init(&bn_tmp);
mp_init(&bn_tmp2);
mp_init(&bn_tmp3);
Cyc_int2bignum(tv.tv_sec, &bn_tmp);
Cyc_int2bignum(1000000LL, &bn_tmp2);
Cyc_int2bignum(tv.tv_usec, &bn_tmp3);
alloc_bignum(data, box);
mp_mul(&bn_tmp, &bn_tmp2, &bn_tmp);
mp_add(&bn_tmp, &bn_tmp3, &bignum_value(box));
mp_clear(&bn_tmp);
mp_clear(&bn_tmp2);
mp_clear(&bn_tmp3);
*/
double_value(&box) = jiffy;
return_closcall1(data, k, &box); ")
(define-c jiffies-per-second