GslDataCache diff for 64bit DataHandles
- From: Stefan Westerfeld <stefan space twc de>
- To: beast gnome org
- Cc: timj gtk org
- Subject: GslDataCache diff for 64bit DataHandles
- Date: Sat, 21 Jan 2006 19:13:15 +0100
Hi!
Here are some more changes towards 64 bit sample length: I changed all
types of offsets the data cache deals with.
Index: bse/ChangeLog
===================================================================
RCS file: /cvs/gnome/beast/bse/ChangeLog,v
retrieving revision 1.590
diff -u -p -r1.590 ChangeLog
--- bse/ChangeLog 21 Jan 2006 16:17:34 -0000 1.590
+++ bse/ChangeLog 21 Jan 2006 18:02:15 -0000
@@ -1,3 +1,7 @@
+Sat Jan 21 18:50:44 2006 Stefan Westerfeld <stefan space twc de>
+
+ * gsldatacache.[hc]: Change caching code to handle 64 bit offsets.
+
Fri Jan 20 14:46:43 2006 Stefan Westerfeld <stefan space twc de>
* gsldefs.h: GslLong is now 64-bit on any platform (before, it was
Index: bse/gsldatacache.c
===================================================================
RCS file: /cvs/gnome/beast/bse/gsldatacache.c,v
retrieving revision 1.18
diff -u -p -r1.18 gsldatacache.c
--- bse/gsldatacache.c 31 Dec 2004 12:46:26 -0000 1.18
+++ bse/gsldatacache.c 21 Jan 2006 18:02:15 -0000
@@ -59,7 +59,7 @@
/* --- prototypes --- */
static void dcache_free (GslDataCache *dcache);
static GslDataCacheNode* data_cache_new_node_L (GslDataCache *dcache,
- gsize offset,
+ int64 offset,
guint pos,
gboolean demand_load);
@@ -252,7 +252,7 @@ gsl_data_cache_unref (GslDataCache *dcac
static inline GslDataCacheNode**
data_cache_lookup_nextmost_node_L (GslDataCache *dcache,
- gsize offset)
+ int64 offset)
{
if (dcache->n_nodes > 0)
{
@@ -288,14 +288,14 @@ data_cache_lookup_nextmost_node_L (GslDa
static inline GslDataCacheNode*
data_cache_new_node_L (GslDataCache *dcache,
- gsize offset,
+ int64 offset,
guint pos,
gboolean demand_load)
{
GslDataCacheNode **node_p, *dnode;
GslDataType *data, *node_data;
guint new_node_array_size, old_node_array_size = UPPER_POWER2 (dcache->n_nodes);
- GslLong dhandle_length;
+ int64 dhandle_length;
guint i, size;
gint result;
@@ -335,8 +335,8 @@ data_cache_new_node_L (GslDataCache *dca
GslDataCacheNode *prev_node = pos ? dcache->nodes[pos - 1] : NULL;
if (prev_node)
{
- GslLong prev_node_size = dcache->node_size;
- GslLong prev_node_offset = prev_node->offset;
+ guint prev_node_size = dcache->node_size;
+ int64 prev_node_offset = prev_node->offset;
GslDataType *prev_node_data = prev_node->data;
/* padding around prev_node */
@@ -347,7 +347,7 @@ data_cache_new_node_L (GslDataCache *dca
/* check for overlap */
if (offset < prev_node_offset + prev_node_size)
{
- GslLong overlap = prev_node_offset + prev_node_size - offset;
+ int64 overlap = prev_node_offset + prev_node_size - offset;
memcpy (data, prev_node_data + offset - prev_node_offset, overlap * sizeof (data[0]));
size -= overlap;
offset += overlap;
@@ -387,7 +387,7 @@ data_cache_new_node_L (GslDataCache *dca
GslDataCacheNode*
gsl_data_cache_ref_node (GslDataCache *dcache,
- gsize offset,
+ int64 offset,
GslDataCacheRequest load_request)
{
GslDataCacheNode **node_p, *node;
Index: bse/gsldatacache.h
===================================================================
RCS file: /cvs/gnome/beast/bse/gsldatacache.h,v
retrieving revision 1.7
diff -u -p -r1.7 gsldatacache.h
--- bse/gsldatacache.h 29 Dec 2004 03:24:43 -0000 1.7
+++ bse/gsldatacache.h 21 Jan 2006 18:02:15 -0000
@@ -45,7 +45,7 @@ struct _GslDataCache
};
struct _GslDataCacheNode
{
- gsize offset;
+ int64 offset;
guint ref_count;
guint age;
GslDataType *data; /* NULL while busy */
@@ -66,7 +66,7 @@ void gsl_data_cache_unref (GslDataCa
void gsl_data_cache_open (GslDataCache *dcache);
void gsl_data_cache_close (GslDataCache *dcache);
GslDataCacheNode* gsl_data_cache_ref_node (GslDataCache *dcache,
- gsize offset,
+ int64 offset,
GslDataCacheRequest load_request);
void gsl_data_cache_unref_node (GslDataCache *dcache,
GslDataCacheNode *node);
Cu... Stefan
--
Stefan Westerfeld, Hamburg/Germany, http://space.twc.de/~stefan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]