libnsutils: branch master updated. b6e898b7518777b41d9d82dd3e861a64016cbe0a
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsutils.git/shortlog/b6e898b7518777b41d...
...commit http://git.netsurf-browser.org/libnsutils.git/commit/b6e898b7518777b41d9d...
...tree http://git.netsurf-browser.org/libnsutils.git/tree/b6e898b7518777b41d9d82...
The branch, master has been updated
via b6e898b7518777b41d9d82dd3e861a64016cbe0a (commit)
from a06e9a8aa7b1612e43ce7ec0868276876278c9a9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libnsutils.git/commit/?id=b6e898b7518777b4...
commit b6e898b7518777b41d9d82dd3e861a64016cbe0a
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
tabs->spaces
diff --git a/src/time.c b/src/time.c
index 72d3ff9..10e2705 100644
--- a/src/time.c
+++ b/src/time.c
@@ -63,7 +63,7 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
#elif defined(__amiga)
struct EClockVal eclockval;
int freq = 0;
- uint64 eclock;
+ uint64 eclock;
/* NB: The calling task must already have opened timer.device
* and obtained the interface.
@@ -74,7 +74,7 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
#endif
freq = ReadEClock(&eclockval) / 1000;
- eclock = ((uint64)eclockval.ev_hi << 32) | (eclockval.ev_lo);
+ eclock = ((uint64)eclockval.ev_hi << 32) | (eclockval.ev_lo);
current = eclock / freq;
#else
#warning "Using dodgy gettimeofday() fallback"
-----------------------------------------------------------------------
Summary of changes:
src/time.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/time.c b/src/time.c
index 72d3ff9..10e2705 100644
--- a/src/time.c
+++ b/src/time.c
@@ -63,7 +63,7 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
#elif defined(__amiga)
struct EClockVal eclockval;
int freq = 0;
- uint64 eclock;
+ uint64 eclock;
/* NB: The calling task must already have opened timer.device
* and obtained the interface.
@@ -74,7 +74,7 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
#endif
freq = ReadEClock(&eclockval) / 1000;
- eclock = ((uint64)eclockval.ev_hi << 32) | (eclockval.ev_lo);
+ eclock = ((uint64)eclockval.ev_hi << 32) | (eclockval.ev_lo);
current = eclock / freq;
#else
#warning "Using dodgy gettimeofday() fallback"
--
NetSurf generalised utility library
8 years, 10 months
libnsutils: branch master updated. a06e9a8aa7b1612e43ce7ec0868276876278c9a9
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsutils.git/shortlog/a06e9a8aa7b1612e43...
...commit http://git.netsurf-browser.org/libnsutils.git/commit/a06e9a8aa7b1612e43ce...
...tree http://git.netsurf-browser.org/libnsutils.git/tree/a06e9a8aa7b1612e43ce7e...
The branch, master has been updated
via a06e9a8aa7b1612e43ce7ec0868276876278c9a9 (commit)
from 4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libnsutils.git/commit/?id=a06e9a8aa7b1612e...
commit a06e9a8aa7b1612e43ce7ec0868276876278c9a9
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Use ReadEClock() instead; AmigaOS 3 compatibility.
This might be marginally quicker.
diff --git a/src/time.c b/src/time.c
index 4a5b8f2..72d3ff9 100644
--- a/src/time.c
+++ b/src/time.c
@@ -24,7 +24,10 @@
#include <mach/mach.h>
#include <mach/clock.h>
#include <mach/mach_time.h>
-#elif defined(__amigaos4__)
+#elif defined(__amiga)
+#ifdef __amigaos4__
+#define __USE_INLINE__ 1
+#endif
#include <assert.h>
#include <proto/timer.h>
#else
@@ -57,16 +60,22 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
mach_port_deallocate(mach_task_self(), cclock);
current = (mts.tv_sec * 1000) + (mts.tv_nsec / 1000000);
-#elif defined(__amigaos4__)
- struct TimeVal tv;
+#elif defined(__amiga)
+ struct EClockVal eclockval;
+ int freq = 0;
+ uint64 eclock;
/* NB: The calling task must already have opened timer.device
* and obtained the interface.
*/
+ assert(TimerBase != NULL);
+#ifdef __amigaos4__
assert(ITimer != NULL);
+#endif
- ITimer->GetUpTime(&tv);
- current = (tv.Seconds * 1000) + (tv.Microseconds / 1000);
+ freq = ReadEClock(&eclockval) / 1000;
+ eclock = ((uint64)eclockval.ev_hi << 32) | (eclockval.ev_lo);
+ current = eclock / freq;
#else
#warning "Using dodgy gettimeofday() fallback"
/** \todo Implement this properly! */
-----------------------------------------------------------------------
Summary of changes:
src/time.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/time.c b/src/time.c
index 4a5b8f2..72d3ff9 100644
--- a/src/time.c
+++ b/src/time.c
@@ -24,7 +24,10 @@
#include <mach/mach.h>
#include <mach/clock.h>
#include <mach/mach_time.h>
-#elif defined(__amigaos4__)
+#elif defined(__amiga)
+#ifdef __amigaos4__
+#define __USE_INLINE__ 1
+#endif
#include <assert.h>
#include <proto/timer.h>
#else
@@ -57,16 +60,22 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
mach_port_deallocate(mach_task_self(), cclock);
current = (mts.tv_sec * 1000) + (mts.tv_nsec / 1000000);
-#elif defined(__amigaos4__)
- struct TimeVal tv;
+#elif defined(__amiga)
+ struct EClockVal eclockval;
+ int freq = 0;
+ uint64 eclock;
/* NB: The calling task must already have opened timer.device
* and obtained the interface.
*/
+ assert(TimerBase != NULL);
+#ifdef __amigaos4__
assert(ITimer != NULL);
+#endif
- ITimer->GetUpTime(&tv);
- current = (tv.Seconds * 1000) + (tv.Microseconds / 1000);
+ freq = ReadEClock(&eclockval) / 1000;
+ eclock = ((uint64)eclockval.ev_hi << 32) | (eclockval.ev_lo);
+ current = eclock / freq;
#else
#warning "Using dodgy gettimeofday() fallback"
/** \todo Implement this properly! */
--
NetSurf generalised utility library
8 years, 10 months
netsurf: branch master updated. release/3.2-505-gca74e00
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/ca74e0060d4baea2f2271...
...commit http://git.netsurf-browser.org/netsurf.git/commit/ca74e0060d4baea2f22714c...
...tree http://git.netsurf-browser.org/netsurf.git/tree/ca74e0060d4baea2f22714c36...
The branch, master has been updated
via ca74e0060d4baea2f22714c36f17a2017b683631 (commit)
via 1c735140b679c53d98110ef28c7be0f3909eb526 (commit)
from 6a2461da8d474a994a69c9b1f7cc9de8afdc3015 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ca74e0060d4baea2f22...
commit ca74e0060d4baea2f22714c36f17a2017b683631
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
release gadget allocation on error path (Coverity 1109875)
diff --git a/render/box_construct.c b/render/box_construct.c
index 97bc111..5bceefd 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -2608,6 +2608,7 @@ bool box_select(BOX_SPECIAL_PARAMS)
err = dom_node_get_first_child(c, &c2);
if (err != DOM_NO_ERR) {
dom_node_unref(c);
+ form_free_control(gadget);
return false;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=1c735140b679c53d981...
commit 1c735140b679c53d98110ef28c7be0f3909eb526
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix resource leak on error (Coverity 1256245)
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index b2eaf78..56091d1 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1411,6 +1411,7 @@ fetch(nsurl *url,
}
} else if (datalen == 0) {
/* caller provided a buffer but no length bad parameter */
+ close(fd);
return NSERROR_BAD_PARAMETER;
}
-----------------------------------------------------------------------
Summary of changes:
content/fs_backing_store.c | 1 +
render/box_construct.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index b2eaf78..56091d1 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1411,6 +1411,7 @@ fetch(nsurl *url,
}
} else if (datalen == 0) {
/* caller provided a buffer but no length bad parameter */
+ close(fd);
return NSERROR_BAD_PARAMETER;
}
diff --git a/render/box_construct.c b/render/box_construct.c
index 97bc111..5bceefd 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -2608,6 +2608,7 @@ bool box_select(BOX_SPECIAL_PARAMS)
err = dom_node_get_first_child(c, &c2);
if (err != DOM_NO_ERR) {
dom_node_unref(c);
+ form_free_control(gadget);
return false;
}
--
NetSurf Browser
8 years, 10 months
netsurf: branch master updated. release/3.2-503-g6a2461d
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/6a2461da8d474a994a69c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/6a2461da8d474a994a69c9b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/6a2461da8d474a994a69c9b1f...
The branch, master has been updated
via 6a2461da8d474a994a69c9b1f7cc9de8afdc3015 (commit)
from 9bc07e8d8f20a81b2afbff63cf287e5a2ec3b4c8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=6a2461da8d474a994a6...
commit 6a2461da8d474a994a69c9b1f7cc9de8afdc3015
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Enable the async write process to be disabled for testing purposes
diff --git a/amiga/fs_backing_store.c b/amiga/fs_backing_store.c
index b2c7347..2eee04b 100644
--- a/amiga/fs_backing_store.c
+++ b/amiga/fs_backing_store.c
@@ -16,6 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* Uncomment the below to disable the async write process */
+//#define NSA_NO_ASYNC_STORE 1
+
#include <proto/dos.h>
#include <proto/exec.h>
@@ -88,7 +91,11 @@ ami_backing_store_store(nsurl *url,
static struct gui_llcache_table amiga_llcache_table = {
.initialise = initialise,
.finalise = finalise,
+#ifdef NSA_NO_ASYNC_STORE
+ .store = store,
+#else
.store = ami_backing_store_store,
+#endif
.fetch = fetch,
.invalidate = invalidate,
.release = release,
-----------------------------------------------------------------------
Summary of changes:
amiga/fs_backing_store.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/amiga/fs_backing_store.c b/amiga/fs_backing_store.c
index b2c7347..2eee04b 100644
--- a/amiga/fs_backing_store.c
+++ b/amiga/fs_backing_store.c
@@ -16,6 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* Uncomment the below to disable the async write process */
+//#define NSA_NO_ASYNC_STORE 1
+
#include <proto/dos.h>
#include <proto/exec.h>
@@ -88,7 +91,11 @@ ami_backing_store_store(nsurl *url,
static struct gui_llcache_table amiga_llcache_table = {
.initialise = initialise,
.finalise = finalise,
+#ifdef NSA_NO_ASYNC_STORE
+ .store = store,
+#else
.store = ami_backing_store_store,
+#endif
.fetch = fetch,
.invalidate = invalidate,
.release = release,
--
NetSurf Browser
8 years, 10 months
netsurf: branch master updated. release/3.2-502-g9bc07e8
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/9bc07e8d8f20a81b2afbf...
...commit http://git.netsurf-browser.org/netsurf.git/commit/9bc07e8d8f20a81b2afbff6...
...tree http://git.netsurf-browser.org/netsurf.git/tree/9bc07e8d8f20a81b2afbff63c...
The branch, master has been updated
via 9bc07e8d8f20a81b2afbff63cf287e5a2ec3b4c8 (commit)
from 61ab2777daf33e858c60f712758493720dcbd3ed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9bc07e8d8f20a81b2af...
commit 9bc07e8d8f20a81b2afbff63cf287e5a2ec3b4c8
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
make coverity build script use updated environment variables
diff --git a/utils/coverity-build.sh b/utils/coverity-build.sh
index 05696f7..8bd9011 100755
--- a/utils/coverity-build.sh
+++ b/utils/coverity-build.sh
@@ -30,17 +30,15 @@
# COVERITY_TOKEN
# COVERITY_USER
# COVERITY_PREFIX path to tools else default is used
+# BUILD
#
# either PREFIX or JENKINS_HOME
# build gtk, framebuffer and monkey frontend by default
TARGETS="gtk framebuffer monkey"
-# We build for the Linux platform by default
-ARTIFACT_TARGET=${TARGET:-Linux}
-
# setup build environment
-export PREFIX=${PREFIX:-${JENKINS_HOME}/artifacts-${ARTIFACT_TARGET}}
+export PREFIX=${PREFIX:-${JENKINS_HOME}/artifacts-${BUILD}}
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PREFIX}/lib
export PATH=${PATH}:${PREFIX}/bin
-----------------------------------------------------------------------
Summary of changes:
utils/coverity-build.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/utils/coverity-build.sh b/utils/coverity-build.sh
index 05696f7..8bd9011 100755
--- a/utils/coverity-build.sh
+++ b/utils/coverity-build.sh
@@ -30,17 +30,15 @@
# COVERITY_TOKEN
# COVERITY_USER
# COVERITY_PREFIX path to tools else default is used
+# BUILD
#
# either PREFIX or JENKINS_HOME
# build gtk, framebuffer and monkey frontend by default
TARGETS="gtk framebuffer monkey"
-# We build for the Linux platform by default
-ARTIFACT_TARGET=${TARGET:-Linux}
-
# setup build environment
-export PREFIX=${PREFIX:-${JENKINS_HOME}/artifacts-${ARTIFACT_TARGET}}
+export PREFIX=${PREFIX:-${JENKINS_HOME}/artifacts-${BUILD}}
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PREFIX}/lib
export PATH=${PATH}:${PREFIX}/bin
--
NetSurf Browser
8 years, 10 months
netsurf: branch master updated. release/3.2-501-g61ab277
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/61ab2777daf33e858c60f...
...commit http://git.netsurf-browser.org/netsurf.git/commit/61ab2777daf33e858c60f71...
...tree http://git.netsurf-browser.org/netsurf.git/tree/61ab2777daf33e858c60f7127...
The branch, master has been updated
via 61ab2777daf33e858c60f712758493720dcbd3ed (commit)
from d08acbc5ae45feee602307c278c8bfe3a4bd3bfd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=61ab2777daf33e858c6...
commit 61ab2777daf33e858c60f712758493720dcbd3ed
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Improve writeout rescheduling if list of objects is completed quickly
diff --git a/content/llcache.c b/content/llcache.c
index 2f7b82b..fb3d716 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -2382,6 +2382,7 @@ static void llcache_persist(void *p)
struct llcache_object **lst; /* candidate object list */
int lst_count; /* number of candidates in list */
int idx; /* current candidate object index in list */
+ int next = -1; /* when the next run should be scheduled for */
unsigned long write_limit; /* max number of bytes to write in this run*/
@@ -2416,6 +2417,7 @@ static void llcache_persist(void *p)
* (bandwidth) for this run being exceeded.
*/
if (total_elapsed > llcache->time_quantum) {
+ LOG(("Overran timeslot"));
/* writeout has exhausted the available time.
* Either the writeout is slow or the last
* object was very large.
@@ -2426,7 +2428,6 @@ static void llcache_persist(void *p)
guit->llcache->finalise();
break;
} else {
- unsigned long next;
if (total_bandwidth > llcache->maximum_bandwidth) {
/* fast writeout of large file
* so calculate delay as if
@@ -2437,14 +2438,11 @@ static void llcache_persist(void *p)
} else {
next = llcache->time_quantum;
}
- LOG(("Overran our timeslot Rescheduling writeout in %dms", next));
- guit->browser->schedule(next,
- llcache_persist, NULL);
break;
}
} else if (total_written > write_limit) {
/* The bandwidth limit has been reached. */
- unsigned long next;
+
if (total_bandwidth > llcache->maximum_bandwidth) {
/* fast writeout of large file so
* calculate delay as if write
@@ -2454,18 +2452,22 @@ static void llcache_persist(void *p)
} else {
next = llcache->time_quantum - total_elapsed;
}
- LOG(("Rescheduling writeout in %dms", next));
- guit->browser->schedule(next, llcache_persist,
- NULL);
break;
}
}
}
+ free(lst);
+
+ if (idx == lst_count) {
+ LOG(("Completed writeout list"));
+ next = llcache->time_quantum - total_elapsed;
+ }
LOG(("writeout size:%d time:%d bandwidth:%dbytes/s",
total_written, total_elapsed, total_bandwidth));
- free(lst);
+ LOG(("Rescheduling writeout in %dms", next));
+ guit->browser->schedule(next, llcache_persist, NULL);
}
-----------------------------------------------------------------------
Summary of changes:
content/llcache.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/content/llcache.c b/content/llcache.c
index 2f7b82b..fb3d716 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -2382,6 +2382,7 @@ static void llcache_persist(void *p)
struct llcache_object **lst; /* candidate object list */
int lst_count; /* number of candidates in list */
int idx; /* current candidate object index in list */
+ int next = -1; /* when the next run should be scheduled for */
unsigned long write_limit; /* max number of bytes to write in this run*/
@@ -2416,6 +2417,7 @@ static void llcache_persist(void *p)
* (bandwidth) for this run being exceeded.
*/
if (total_elapsed > llcache->time_quantum) {
+ LOG(("Overran timeslot"));
/* writeout has exhausted the available time.
* Either the writeout is slow or the last
* object was very large.
@@ -2426,7 +2428,6 @@ static void llcache_persist(void *p)
guit->llcache->finalise();
break;
} else {
- unsigned long next;
if (total_bandwidth > llcache->maximum_bandwidth) {
/* fast writeout of large file
* so calculate delay as if
@@ -2437,14 +2438,11 @@ static void llcache_persist(void *p)
} else {
next = llcache->time_quantum;
}
- LOG(("Overran our timeslot Rescheduling writeout in %dms", next));
- guit->browser->schedule(next,
- llcache_persist, NULL);
break;
}
} else if (total_written > write_limit) {
/* The bandwidth limit has been reached. */
- unsigned long next;
+
if (total_bandwidth > llcache->maximum_bandwidth) {
/* fast writeout of large file so
* calculate delay as if write
@@ -2454,18 +2452,22 @@ static void llcache_persist(void *p)
} else {
next = llcache->time_quantum - total_elapsed;
}
- LOG(("Rescheduling writeout in %dms", next));
- guit->browser->schedule(next, llcache_persist,
- NULL);
break;
}
}
}
+ free(lst);
+
+ if (idx == lst_count) {
+ LOG(("Completed writeout list"));
+ next = llcache->time_quantum - total_elapsed;
+ }
LOG(("writeout size:%d time:%d bandwidth:%dbytes/s",
total_written, total_elapsed, total_bandwidth));
- free(lst);
+ LOG(("Rescheduling writeout in %dms", next));
+ guit->browser->schedule(next, llcache_persist, NULL);
}
--
NetSurf Browser
8 years, 10 months
netsurf: branch master updated. release/3.2-500-gd08acbc
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/d08acbc5ae45feee60230...
...commit http://git.netsurf-browser.org/netsurf.git/commit/d08acbc5ae45feee602307c...
...tree http://git.netsurf-browser.org/netsurf.git/tree/d08acbc5ae45feee602307c27...
The branch, master has been updated
via d08acbc5ae45feee602307c278c8bfe3a4bd3bfd (commit)
from 70e777c30d7eeeb28591ca7769100059808aada8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=d08acbc5ae45feee602...
commit d08acbc5ae45feee602307c278c8bfe3a4bd3bfd
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
correctly calculate writeout bandwidth and properly impose limits
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 27cd952..b2eaf78 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1230,6 +1230,9 @@ initialise(const struct llcache_store_parameters *parameters)
/**
* Finalise the backing store.
*
+ * \todo This will cause the backing store to leak any outstanding memory
+ * allocations. This will probably best be done by a global use count.
+ *
* @return NSERROR_OK on success.
*/
static nserror
diff --git a/content/llcache.c b/content/llcache.c
index e862f90..2f7b82b 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -2262,7 +2262,7 @@ build_candidate_list(struct llcache_object ***lst_out, int *lst_len_out)
int lst_len = 0;
int remaining_lifetime;
-#define MAX_PERSIST_PER_RUN 512
+#define MAX_PERSIST_PER_RUN 128
lst = calloc(MAX_PERSIST_PER_RUN, sizeof(struct llcache_object *));
if (lst == NULL) {
@@ -2379,14 +2379,18 @@ write_backing_store(struct llcache_object *object,
static void llcache_persist(void *p)
{
nserror ret;
- size_t size_written;
- size_t total_written = 0;
- struct llcache_object **lst;
- int lst_count;
- int idx;
- unsigned long write_limit; /* max number of bytes to write */
- unsigned long total_elapsed = 1;
- unsigned long elapsed;
+ struct llcache_object **lst; /* candidate object list */
+ int lst_count; /* number of candidates in list */
+ int idx; /* current candidate object index in list */
+
+ unsigned long write_limit; /* max number of bytes to write in this run*/
+
+ size_t written; /* all bytes written for a single object */
+ unsigned long elapsed; /* how long writing an object took */
+
+ size_t total_written = 0; /* total bytes written in this run */
+ unsigned long total_elapsed = 1; /* total ms used to write bytes */
+ unsigned long total_bandwidth = 0; /* total bandwidth */
ret = build_candidate_list(&lst, &lst_count);
if (ret != NSERROR_OK) {
@@ -2398,28 +2402,68 @@ static void llcache_persist(void *p)
/* obtained a candidate list, make each object persistant in turn */
for (idx = 0; idx < lst_count; idx++) {
- ret = write_backing_store(lst[idx], &size_written, &elapsed);
+ ret = write_backing_store(lst[idx], &written, &elapsed);
if (ret == NSERROR_OK) {
/* sucessfully wrote object to backing store */
- total_written += size_written;
+ total_written += written;
total_elapsed += elapsed;
- LOG(("Wrote %d bytes in %dms %s",
- size_written,
- elapsed,
+ total_bandwidth = (total_written * 1000) / total_elapsed;
+ LOG(("Wrote %d bytes in %dms bw:%d %s",
+ written, elapsed, (written * 1000) / elapsed,
nsurl_access(lst[idx]->url) ));
- if (total_written > write_limit) {
- /* The bandwidth limit has been reached.
- * Writeout scheduled for the remaining objects
+ /* check to for the time quantum or the size
+ * (bandwidth) for this run being exceeded.
+ */
+ if (total_elapsed > llcache->time_quantum) {
+ /* writeout has exhausted the available time.
+ * Either the writeout is slow or the last
+ * object was very large.
*/
- guit->browser->schedule(llcache->time_quantum, llcache_persist, NULL);
+ if (total_bandwidth < llcache->minimum_bandwidth) {
+ LOG(("Cannot write minimum bandwidth"));
+ warn_user("Disc cache write bandwidth is too slow to be useful, disabling cache", 0);
+ guit->llcache->finalise();
+ break;
+ } else {
+ unsigned long next;
+ if (total_bandwidth > llcache->maximum_bandwidth) {
+ /* fast writeout of large file
+ * so calculate delay as if
+ * write happened only at max
+ * limit
+ */
+ next = ((total_written * llcache->time_quantum) / write_limit) - total_elapsed;
+ } else {
+ next = llcache->time_quantum;
+ }
+ LOG(("Overran our timeslot Rescheduling writeout in %dms", next));
+ guit->browser->schedule(next,
+ llcache_persist, NULL);
+ break;
+ }
+ } else if (total_written > write_limit) {
+ /* The bandwidth limit has been reached. */
+ unsigned long next;
+ if (total_bandwidth > llcache->maximum_bandwidth) {
+ /* fast writeout of large file so
+ * calculate delay as if write
+ * happened only at max limit
+ */
+ next = ((total_written * llcache->time_quantum) / write_limit) - total_elapsed;
+ } else {
+ next = llcache->time_quantum - total_elapsed;
+ }
+ LOG(("Rescheduling writeout in %dms", next));
+ guit->browser->schedule(next, llcache_persist,
+ NULL);
break;
}
}
}
LOG(("writeout size:%d time:%d bandwidth:%dbytes/s",
- total_written, total_elapsed, (total_written * 1000) / total_elapsed));
+ total_written, total_elapsed, total_bandwidth));
free(lst);
}
-----------------------------------------------------------------------
Summary of changes:
content/fs_backing_store.c | 3 ++
content/llcache.c | 82 ++++++++++++++++++++++++++++++++++----------
2 files changed, 66 insertions(+), 19 deletions(-)
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 27cd952..b2eaf78 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1230,6 +1230,9 @@ initialise(const struct llcache_store_parameters *parameters)
/**
* Finalise the backing store.
*
+ * \todo This will cause the backing store to leak any outstanding memory
+ * allocations. This will probably best be done by a global use count.
+ *
* @return NSERROR_OK on success.
*/
static nserror
diff --git a/content/llcache.c b/content/llcache.c
index e862f90..2f7b82b 100644
--- a/content/llcache.c
+++ b/content/llcache.c
@@ -2262,7 +2262,7 @@ build_candidate_list(struct llcache_object ***lst_out, int *lst_len_out)
int lst_len = 0;
int remaining_lifetime;
-#define MAX_PERSIST_PER_RUN 512
+#define MAX_PERSIST_PER_RUN 128
lst = calloc(MAX_PERSIST_PER_RUN, sizeof(struct llcache_object *));
if (lst == NULL) {
@@ -2379,14 +2379,18 @@ write_backing_store(struct llcache_object *object,
static void llcache_persist(void *p)
{
nserror ret;
- size_t size_written;
- size_t total_written = 0;
- struct llcache_object **lst;
- int lst_count;
- int idx;
- unsigned long write_limit; /* max number of bytes to write */
- unsigned long total_elapsed = 1;
- unsigned long elapsed;
+ struct llcache_object **lst; /* candidate object list */
+ int lst_count; /* number of candidates in list */
+ int idx; /* current candidate object index in list */
+
+ unsigned long write_limit; /* max number of bytes to write in this run*/
+
+ size_t written; /* all bytes written for a single object */
+ unsigned long elapsed; /* how long writing an object took */
+
+ size_t total_written = 0; /* total bytes written in this run */
+ unsigned long total_elapsed = 1; /* total ms used to write bytes */
+ unsigned long total_bandwidth = 0; /* total bandwidth */
ret = build_candidate_list(&lst, &lst_count);
if (ret != NSERROR_OK) {
@@ -2398,28 +2402,68 @@ static void llcache_persist(void *p)
/* obtained a candidate list, make each object persistant in turn */
for (idx = 0; idx < lst_count; idx++) {
- ret = write_backing_store(lst[idx], &size_written, &elapsed);
+ ret = write_backing_store(lst[idx], &written, &elapsed);
if (ret == NSERROR_OK) {
/* sucessfully wrote object to backing store */
- total_written += size_written;
+ total_written += written;
total_elapsed += elapsed;
- LOG(("Wrote %d bytes in %dms %s",
- size_written,
- elapsed,
+ total_bandwidth = (total_written * 1000) / total_elapsed;
+ LOG(("Wrote %d bytes in %dms bw:%d %s",
+ written, elapsed, (written * 1000) / elapsed,
nsurl_access(lst[idx]->url) ));
- if (total_written > write_limit) {
- /* The bandwidth limit has been reached.
- * Writeout scheduled for the remaining objects
+ /* check to for the time quantum or the size
+ * (bandwidth) for this run being exceeded.
+ */
+ if (total_elapsed > llcache->time_quantum) {
+ /* writeout has exhausted the available time.
+ * Either the writeout is slow or the last
+ * object was very large.
*/
- guit->browser->schedule(llcache->time_quantum, llcache_persist, NULL);
+ if (total_bandwidth < llcache->minimum_bandwidth) {
+ LOG(("Cannot write minimum bandwidth"));
+ warn_user("Disc cache write bandwidth is too slow to be useful, disabling cache", 0);
+ guit->llcache->finalise();
+ break;
+ } else {
+ unsigned long next;
+ if (total_bandwidth > llcache->maximum_bandwidth) {
+ /* fast writeout of large file
+ * so calculate delay as if
+ * write happened only at max
+ * limit
+ */
+ next = ((total_written * llcache->time_quantum) / write_limit) - total_elapsed;
+ } else {
+ next = llcache->time_quantum;
+ }
+ LOG(("Overran our timeslot Rescheduling writeout in %dms", next));
+ guit->browser->schedule(next,
+ llcache_persist, NULL);
+ break;
+ }
+ } else if (total_written > write_limit) {
+ /* The bandwidth limit has been reached. */
+ unsigned long next;
+ if (total_bandwidth > llcache->maximum_bandwidth) {
+ /* fast writeout of large file so
+ * calculate delay as if write
+ * happened only at max limit
+ */
+ next = ((total_written * llcache->time_quantum) / write_limit) - total_elapsed;
+ } else {
+ next = llcache->time_quantum - total_elapsed;
+ }
+ LOG(("Rescheduling writeout in %dms", next));
+ guit->browser->schedule(next, llcache_persist,
+ NULL);
break;
}
}
}
LOG(("writeout size:%d time:%d bandwidth:%dbytes/s",
- total_written, total_elapsed, (total_written * 1000) / total_elapsed));
+ total_written, total_elapsed, total_bandwidth));
free(lst);
}
--
NetSurf Browser
8 years, 10 months
libnsutils: branch master updated. 4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsutils.git/shortlog/4c0f6488b5f7f9d0c0...
...commit http://git.netsurf-browser.org/libnsutils.git/commit/4c0f6488b5f7f9d0c0e0...
...tree http://git.netsurf-browser.org/libnsutils.git/tree/4c0f6488b5f7f9d0c0e0f7...
The branch, master has been updated
via 4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874 (commit)
from c646a6f4e596f64ab388863122fa02636db96148 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libnsutils.git/commit/?id=4c0f6488b5f7f9d0...
commit 4c0f6488b5f7f9d0c0e0f70e989b95e9ad003874
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Change tabs to spaces, and assert that ITimer is not NULL.
diff --git a/src/time.c b/src/time.c
index 46a0be2..4a5b8f2 100644
--- a/src/time.c
+++ b/src/time.c
@@ -25,6 +25,7 @@
#include <mach/clock.h>
#include <mach/mach_time.h>
#elif defined(__amigaos4__)
+#include <assert.h>
#include <proto/timer.h>
#else
#include <sys/time.h>
@@ -57,17 +58,15 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
current = (mts.tv_sec * 1000) + (mts.tv_nsec / 1000000);
#elif defined(__amigaos4__)
- struct TimeVal tv;
+ struct TimeVal tv;
- /* NB: The calling task must already have opened timer.device
- * and obtained the interface.
- */
- if (ITimer != NULL) {
- ITimer->GetUpTime(&tv);
- current = (tv.Seconds * 1000) + (tv.Microseconds / 1000);
- } else {
- current = 0; /* \todo should we be opening timer.device, or printing a warning? */
- }
+ /* NB: The calling task must already have opened timer.device
+ * and obtained the interface.
+ */
+ assert(ITimer != NULL);
+
+ ITimer->GetUpTime(&tv);
+ current = (tv.Seconds * 1000) + (tv.Microseconds / 1000);
#else
#warning "Using dodgy gettimeofday() fallback"
/** \todo Implement this properly! */
-----------------------------------------------------------------------
Summary of changes:
src/time.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/time.c b/src/time.c
index 46a0be2..4a5b8f2 100644
--- a/src/time.c
+++ b/src/time.c
@@ -25,6 +25,7 @@
#include <mach/clock.h>
#include <mach/mach_time.h>
#elif defined(__amigaos4__)
+#include <assert.h>
#include <proto/timer.h>
#else
#include <sys/time.h>
@@ -57,17 +58,15 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
current = (mts.tv_sec * 1000) + (mts.tv_nsec / 1000000);
#elif defined(__amigaos4__)
- struct TimeVal tv;
+ struct TimeVal tv;
- /* NB: The calling task must already have opened timer.device
- * and obtained the interface.
- */
- if (ITimer != NULL) {
- ITimer->GetUpTime(&tv);
- current = (tv.Seconds * 1000) + (tv.Microseconds / 1000);
- } else {
- current = 0; /* \todo should we be opening timer.device, or printing a warning? */
- }
+ /* NB: The calling task must already have opened timer.device
+ * and obtained the interface.
+ */
+ assert(ITimer != NULL);
+
+ ITimer->GetUpTime(&tv);
+ current = (tv.Seconds * 1000) + (tv.Microseconds / 1000);
#else
#warning "Using dodgy gettimeofday() fallback"
/** \todo Implement this properly! */
--
NetSurf generalised utility library
8 years, 10 months
netsurf: branch master updated. release/3.2-499-g70e777c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/70e777c30d7eeeb28591c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/70e777c30d7eeeb28591ca7...
...tree http://git.netsurf-browser.org/netsurf.git/tree/70e777c30d7eeeb28591ca776...
The branch, master has been updated
via 70e777c30d7eeeb28591ca7769100059808aada8 (commit)
from 6b2676d33f2e6c25dc98eda57325e7185a6ff763 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=70e777c30d7eeeb2859...
commit 70e777c30d7eeeb28591ca7769100059808aada8
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add some comments about timer.device.
diff --git a/amiga/libs.c b/amiga/libs.c
index c31e82a..cab02d2 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -105,10 +105,21 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, true)
AMINS_LIB_OPEN("workbench.library", 37, Workbench, "main", 1, true)
+ /* NB: timer.device is opened in schedule.c (ultimately by the scheduler process).
+ * The library base and interface are obtained there, rather than here, due to
+ * the additional complexities of opening devices, which aren't important here
+ * (as we only need the library interface), but are important for the scheduler
+ * (as it also uses the device interface). We trust that the scheduler has
+ * initialised before any other code requires the timer's library interface
+ * (this is ensured by waiting for the scheduler to start up) and that it is
+ * OK to use a child process' timer interface, to avoid opening it twice.
+ */
+
/* BOOPSI classes.
* \todo These should be opened using OpenClass(), however as
* the macros all use the deprecated _GetClass() functions,
- * we may as well just open them normally for now. */
+ * we may as well just open them normally for now.
+ */
AMINS_LIB_OPEN("classes/arexx.class", 50, ARexx, "main", 1, true)
AMINS_LIB_OPEN("images/bevel.image", 50, Bevel, "main", 1, true)
diff --git a/amiga/schedule.c b/amiga/schedule.c
index b5a115d..cab2bee 100755
--- a/amiga/schedule.c
+++ b/amiga/schedule.c
@@ -282,7 +282,7 @@ static void ami_scheduler_run(struct MsgPort *nsmsgport)
static struct MsgPort *ami_schedule_open_timer(void)
{
struct MsgPort *msgport = AllocSysObjectTags(ASOT_PORT,
- ASO_NoTrack,FALSE,
+ ASO_NoTrack, FALSE,
TAG_DONE);
tioreq = (struct TimeRequest *)AllocSysObjectTags(ASOT_IOREQUEST,
@@ -294,7 +294,7 @@ static struct MsgPort *ami_schedule_open_timer(void)
OpenDevice("timer.device", UNIT_WAITUNTIL, (struct IORequest *)tioreq, 0);
TimerBase = (struct Device *)tioreq->Request.io_Device;
- ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase,"main",1,NULL);
+ ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase, "main", 1, NULL);
return msgport;
}
-----------------------------------------------------------------------
Summary of changes:
amiga/libs.c | 13 ++++++++++++-
amiga/schedule.c | 4 ++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/amiga/libs.c b/amiga/libs.c
index c31e82a..cab02d2 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -105,10 +105,21 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, true)
AMINS_LIB_OPEN("workbench.library", 37, Workbench, "main", 1, true)
+ /* NB: timer.device is opened in schedule.c (ultimately by the scheduler process).
+ * The library base and interface are obtained there, rather than here, due to
+ * the additional complexities of opening devices, which aren't important here
+ * (as we only need the library interface), but are important for the scheduler
+ * (as it also uses the device interface). We trust that the scheduler has
+ * initialised before any other code requires the timer's library interface
+ * (this is ensured by waiting for the scheduler to start up) and that it is
+ * OK to use a child process' timer interface, to avoid opening it twice.
+ */
+
/* BOOPSI classes.
* \todo These should be opened using OpenClass(), however as
* the macros all use the deprecated _GetClass() functions,
- * we may as well just open them normally for now. */
+ * we may as well just open them normally for now.
+ */
AMINS_LIB_OPEN("classes/arexx.class", 50, ARexx, "main", 1, true)
AMINS_LIB_OPEN("images/bevel.image", 50, Bevel, "main", 1, true)
diff --git a/amiga/schedule.c b/amiga/schedule.c
index b5a115d..cab2bee 100755
--- a/amiga/schedule.c
+++ b/amiga/schedule.c
@@ -282,7 +282,7 @@ static void ami_scheduler_run(struct MsgPort *nsmsgport)
static struct MsgPort *ami_schedule_open_timer(void)
{
struct MsgPort *msgport = AllocSysObjectTags(ASOT_PORT,
- ASO_NoTrack,FALSE,
+ ASO_NoTrack, FALSE,
TAG_DONE);
tioreq = (struct TimeRequest *)AllocSysObjectTags(ASOT_IOREQUEST,
@@ -294,7 +294,7 @@ static struct MsgPort *ami_schedule_open_timer(void)
OpenDevice("timer.device", UNIT_WAITUNTIL, (struct IORequest *)tioreq, 0);
TimerBase = (struct Device *)tioreq->Request.io_Device;
- ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase,"main",1,NULL);
+ ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase, "main", 1, NULL);
return msgport;
}
--
NetSurf Browser
8 years, 10 months
libnsutils: branch master updated. c646a6f4e596f64ab388863122fa02636db96148
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/libnsutils.git/shortlog/c646a6f4e596f64ab3...
...commit http://git.netsurf-browser.org/libnsutils.git/commit/c646a6f4e596f64ab388...
...tree http://git.netsurf-browser.org/libnsutils.git/tree/c646a6f4e596f64ab38886...
The branch, master has been updated
via c646a6f4e596f64ab388863122fa02636db96148 (commit)
from b662aee6b4a7743ba9ea904ff307ae9d3497bc2d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/libnsutils.git/commit/?id=c646a6f4e596f64a...
commit c646a6f4e596f64ab388863122fa02636db96148
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add monotonic timer for AmigaOS 4.0+
diff --git a/src/time.c b/src/time.c
index 736c982..46a0be2 100644
--- a/src/time.c
+++ b/src/time.c
@@ -24,6 +24,8 @@
#include <mach/mach.h>
#include <mach/clock.h>
#include <mach/mach_time.h>
+#elif defined(__amigaos4__)
+#include <proto/timer.h>
#else
#include <sys/time.h>
#endif
@@ -54,6 +56,18 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
mach_port_deallocate(mach_task_self(), cclock);
current = (mts.tv_sec * 1000) + (mts.tv_nsec / 1000000);
+#elif defined(__amigaos4__)
+ struct TimeVal tv;
+
+ /* NB: The calling task must already have opened timer.device
+ * and obtained the interface.
+ */
+ if (ITimer != NULL) {
+ ITimer->GetUpTime(&tv);
+ current = (tv.Seconds * 1000) + (tv.Microseconds / 1000);
+ } else {
+ current = 0; /* \todo should we be opening timer.device, or printing a warning? */
+ }
#else
#warning "Using dodgy gettimeofday() fallback"
/** \todo Implement this properly! */
-----------------------------------------------------------------------
Summary of changes:
src/time.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/time.c b/src/time.c
index 736c982..46a0be2 100644
--- a/src/time.c
+++ b/src/time.c
@@ -24,6 +24,8 @@
#include <mach/mach.h>
#include <mach/clock.h>
#include <mach/mach_time.h>
+#elif defined(__amigaos4__)
+#include <proto/timer.h>
#else
#include <sys/time.h>
#endif
@@ -54,6 +56,18 @@ nsuerror nsu_getmonotonic_ms(uint64_t *current_out)
mach_port_deallocate(mach_task_self(), cclock);
current = (mts.tv_sec * 1000) + (mts.tv_nsec / 1000000);
+#elif defined(__amigaos4__)
+ struct TimeVal tv;
+
+ /* NB: The calling task must already have opened timer.device
+ * and obtained the interface.
+ */
+ if (ITimer != NULL) {
+ ITimer->GetUpTime(&tv);
+ current = (tv.Seconds * 1000) + (tv.Microseconds / 1000);
+ } else {
+ current = 0; /* \todo should we be opening timer.device, or printing a warning? */
+ }
#else
#warning "Using dodgy gettimeofday() fallback"
/** \todo Implement this properly! */
--
NetSurf generalised utility library
8 years, 10 months