Changeset: c80950ae8724 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c80950ae8724
Modified Files:
        monetdb5/modules/kernel/batstr.c
        sql/backends/monet5/UDF/udf/udf.c
Branch: alloc-less-str
Log Message:

Set theap to dirty before returning from str function and avoid allocation at 
reverse scalar case


diffs (truncated from 382 to 300 lines):

diff --git a/monetdb5/modules/kernel/batstr.c b/monetdb5/modules/kernel/batstr.c
--- a/monetdb5/modules/kernel/batstr.c
+++ b/monetdb5/modules/kernel/batstr.c
@@ -68,6 +68,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -127,6 +128,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -179,6 +181,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -232,6 +235,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -286,6 +290,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -342,6 +347,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -406,6 +412,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -464,6 +471,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -529,6 +537,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -587,6 +596,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -652,6 +662,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -718,6 +729,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -787,6 +799,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -985,6 +998,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1043,6 +1057,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1109,6 +1124,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1155,6 +1171,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1209,6 +1226,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1255,6 +1273,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1315,6 +1334,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1368,6 +1388,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1423,6 +1444,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1505,6 +1527,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1597,6 +1620,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1682,6 +1706,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = b->tsorted;
                bn->trevsorted = b->trevsorted;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1752,6 +1777,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1807,6 +1833,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = b->tsorted;
                bn->trevsorted = b->trevsorted;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1869,6 +1896,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = b->tsorted;
                bn->trevsorted = b->trevsorted;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1932,6 +1960,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = b->tsorted;
                bn->trevsorted = b->trevsorted;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -1998,6 +2027,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -2071,6 +2101,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -2140,6 +2171,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -2195,6 +2227,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = b->tsorted;
                bn->trevsorted = b->trevsorted;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -2253,6 +2286,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = b->tsorted;
                bn->trevsorted = b->trevsorted;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -2315,6 +2349,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = b->tsorted;
                bn->trevsorted = b->trevsorted;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -2377,6 +2412,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = b->tsorted;
                bn->trevsorted = b->trevsorted;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -2442,6 +2478,7 @@ bailout:
                bn->tkey = BATcount(bn) <= 1;
                bn->tsorted = BATcount(bn) <= 1;
                bn->trevsorted = BATcount(bn) <= 1;
+               bn->theap.dirty = true;
                BBPkeepref(*res = bn->batCacheid);
        } else if (bn)
                BBPreclaim(bn);
@@ -2488,6 +2525,7 @@ bailout:
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to