[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src/data ChangeLog settings.c settings.h
From: |
Ben Pfaff |
Subject: |
[Pspp-cvs] pspp/src/data ChangeLog settings.c settings.h |
Date: |
Thu, 07 Jun 2007 05:15:59 +0000 |
CVSROOT: /cvsroot/pspp
Module name: pspp
Changes by: Ben Pfaff <blp> 07/06/07 05:15:58
Modified files:
src/data : ChangeLog settings.c settings.h
Log message:
In a couple of places we calculate the maximum number of cases to keep
in memory based on the user-defined workspace. Enable centralizing
the calculation through a new function.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/ChangeLog?cvsroot=pspp&r1=1.120&r2=1.121
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/settings.c?cvsroot=pspp&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/settings.h?cvsroot=pspp&r1=1.4&r2=1.5
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/ChangeLog,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -b -r1.120 -r1.121
--- ChangeLog 7 Jun 2007 05:11:50 -0000 1.120
+++ ChangeLog 7 Jun 2007 05:15:58 -0000 1.121
@@ -1,5 +1,13 @@
2007-06-06 Ben Pfaff <address@hidden>
+ In a couple of places we calculate the maximum number of cases to
+ keep in memory based on the user-defined workspace. Enable
+ centralizing the calculation through a new function.
+
+ * settings.c (get_workspace_cases): New function.
+
+2007-06-06 Ben Pfaff <address@hidden>
+
The casenumber type is defined in transformations.h, but case.h is
a more sensible place. Move it.
Index: settings.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/settings.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- settings.c 15 Dec 2006 00:16:02 -0000 1.6
+++ settings.c 7 Jun 2007 05:15:58 -0000 1.7
@@ -425,6 +425,16 @@
return workspace;
}
+/* Approximate maximum number of cases to allocate in-core, given
+ that each case contains VALUE_CNT values. */
+size_t
+get_workspace_cases (size_t value_cnt)
+{
+ size_t case_size = sizeof (union value) * value_cnt + 4 * sizeof (void *);
+ size_t case_cnt = MAX (get_workspace () / case_size, 4);
+ return case_cnt;
+}
+
/* Set approximate maximum amount of memory to use for cases, in
bytes. */
Index: settings.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/settings.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- settings.h 15 Dec 2006 00:16:02 -0000 1.4
+++ settings.h 7 Jun 2007 05:15:58 -0000 1.5
@@ -79,6 +79,7 @@
void set_endcmd (char);
size_t get_workspace (void);
+size_t get_workspace_cases (size_t value_cnt);
void set_workspace (size_t);
const struct fmt_spec *get_format (void);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp/src/data ChangeLog settings.c settings.h,
Ben Pfaff <=