[prev in list] [next in list] [prev in thread] [next in thread] 

List:       monetdb-checkins
Subject:    MonetDB: Dec2023 - Reduce number of atomic instructions.
From:       Sjoerd Mullender via checkin-list <checkin-list () monetdb ! org>
Date:       2023-11-30 13:08:33
Message-ID: hg.b47e84bc0070.1701349713.3355947183823284212 () dev ! monetdb ! org
[Download RAW message or body]

Changeset: b47e84bc0070 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b47e84bc0070
Modified Files:
	gdk/gdk_bbp.c
Branch: Dec2023
Log Message:

Reduce number of atomic instructions.


diffs (22 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1666,7 +1666,8 @@ BBPjson_upgrade(json_storage_conversion 
 	bat bid;
 	BAT *b;
 	int JSON_type = ATOMindex("json");
-	bat *upd = GDKmalloc(sizeof(bat) * (size_t) ATOMIC_GET(&BBPsize));
+	bat nbat = (bat) ATOMIC_GET(&BBPsize);
+	bat *upd = GDKmalloc(sizeof(bat) * (size_t) nbat);
 	int nupd = 0;
 
 	if (upd == NULL) {
@@ -1677,7 +1678,7 @@ BBPjson_upgrade(json_storage_conversion 
 
 	BBPlock();
 
-	for (bid = 1; bid < (bat) ATOMIC_GET(&BBPsize); bid++) {
+	for (bid = 1; bid < nbat; bid++) {
 		if ((b = BBP_desc(bid)) == NULL) {
 			/* not a valid BAT */
 			continue;
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-leave@monetdb.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic