Changeset: db605ea291b2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=db605ea291b2
Modified Files:
        monetdb5/mal/mal_resource.c
        monetdb5/mal/mal_resource.h
        sql/backends/monet5/sql.c
Branch: default
Log Message:

Minor reordering


diffs (79 lines):

diff --git a/monetdb5/mal/mal_resource.c b/monetdb5/mal/mal_resource.c
--- a/monetdb5/mal/mal_resource.c
+++ b/monetdb5/mal/mal_resource.c
@@ -12,9 +12,6 @@
 #include "mal_resource.h"
 #include "mal_private.h"
 
-#define heapinfo(X) if ((X) && (X)->base) vol = (X)->free; else vol = 0;
-#define hashinfo(X) if ((X) && (X) != (Hash *) 1 && (X)->mask) vol = 
(((X)->mask + cnt ) * (X)-> width); else vol = 0;
-
 /* MEMORY admission does not seem to have a major impact */
 lng memorypool = 0;      /* memory claimed by concurrent threads */
 int memoryclaims = 0;    /* number of threads active with expensive operations 
*/
@@ -66,9 +63,8 @@ mal_resource_reset(void)
 lng
 getMemoryClaim(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci, int i, int flag)
 {
-       lng total = 0, vol = 0;
+       lng total = 0;
        BAT *b;
-       BUN cnt;
 
        (void)mb;
        if (stk->stk[getArg(pci, i)].vtype == TYPE_bat) {
@@ -79,15 +75,14 @@ getMemoryClaim(MalBlkPtr mb, MalStkPtr s
                        BBPunfix(b->batCacheid);
                        return 0;
                }
-               cnt = BATcount(b);
 
-               heapinfo(&b->T->heap); total += vol;
+               total += heapinfo(&b->T->heap); 
                // string heaps can be shared, consider them as space-less views
                if ( b->T->vheap && b->T->vheap->parentid ){
-                       heapinfo(b->T->vheap); total += vol;
+                       total += heapinfo(b->T->vheap); 
                }
-               hashinfo(b->T->hash); total += vol;
-               total = total > (lng)(MEMORY_THRESHOLD ) ? 
(lng)(MEMORY_THRESHOLD ) : total;
+               //total += hashinfo(b->T->hash); 
+               //total = total > (lng)(MEMORY_THRESHOLD ) ? 
(lng)(MEMORY_THRESHOLD ) : total;
                BBPunfix(b->batCacheid);
        }
        return total;
diff --git a/monetdb5/mal/mal_resource.h b/monetdb5/mal/mal_resource.h
--- a/monetdb5/mal/mal_resource.h
+++ b/monetdb5/mal/mal_resource.h
@@ -15,6 +15,9 @@
 #define DELAYUNIT 2 /* ms delay in parallel processing decisions */
 #define MAX_DELAYS 1000 /* never wait forever */
 
+#define heapinfo(X) ((X) && (X)->base ? (X)->free: 0)
+#define hashinfo(X) ( (X)? heapinfo((X)->heap):0)
+
 #define USE_MAL_ADMISSION
 #ifdef USE_MAL_ADMISSION
 mal_export int MALadmission(lng argclaim, lng hotclaim);
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -35,6 +35,7 @@
 #include <opt_pipes.h>
 #include "clients.h"
 #include "mal_instruction.h"
+#include "mal_resource.h"
 
 static int
 rel_is_table(sql_rel *rel)
@@ -4864,10 +4865,6 @@ sql_storage(Client cntxt, MalBlkPtr mb, 
                                                                }
                                                                BUNappend(atom, 
&w, FALSE);
 
-#define heapinfo(X) ((X) && (X)->base ? (X)->free: 0)
-#define hashinfo(X) ( (X)? heapinfo((X)->heap):0)
-
-
                                                                sz = 
heapinfo(&bn->T->heap);
                                                                BUNappend(size, 
&sz, FALSE);
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to