[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch 02/19] new function get_workspace_cases
From: |
John Darrington |
Subject: |
Re: [patch 02/19] new function get_workspace_cases |
Date: |
Thu, 7 Jun 2007 08:01:57 +0800 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
No problems.
On Tue, Jun 05, 2007 at 11:27:29PM -0700, address@hidden wrote:
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.
Index: merge/src/data/settings.c
===================================================================
--- merge.orig/src/data/settings.c 2007-06-02 16:54:54.000000000 -0700
+++ merge/src/data/settings.c 2007-06-02 16:56:03.000000000 -0700
@@ -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: merge/src/data/settings.h
===================================================================
--- merge.orig/src/data/settings.h 2007-06-02 16:54:54.000000000 -0700
+++ merge/src/data/settings.h 2007-06-02 16:56:03.000000000 -0700
@@ -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);
--
_______________________________________________
pspp-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/pspp-dev
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature
- [patch 08/19] case_ordering implementation, (continued)
- [patch 08/19] case_ordering implementation, blp, 2007/06/06
- [patch 11/19] fix assertion in binary_search, blp, 2007/06/06
- [patch 18/19] fairly experimental changes based on what seemed to make sense, blp, 2007/06/06
- [patch 10/19] new function value_cnt_from_width, blp, 2007/06/06
- [patch 02/19] new function get_workspace_cases, blp, 2007/06/06
- Re: [patch 02/19] new function get_workspace_cases,
John Darrington <=
- [patch 06/19] sliding window of cases, blp, 2007/06/06
- [patch 04/19] temporary file for array of cases, blp, 2007/06/06
- [patch 09/19] casegrouper implementation, blp, 2007/06/06
- [patch 01/19] move casenumber to case.h, blp, 2007/06/06
- [patch 13/19] add case initialization infrastructure, blp, 2007/06/06