Changeset: 4498c9903a9a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4498c9903a9a
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk_bbp.c
gdk/gdk_bbp.h
Branch: default
Log Message:
Change interface of BBPreclaim.
It now returns void (instead of int which was never checked), and it is
allowed to be called for bats with more than one fix (no assert anymore).
diffs (69 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -217,7 +217,6 @@ bat BBPlimit;
void BBPlock(void);
BAT *BBPquickdesc(bat b);
int BBPreadBBPline(FILE *fp, unsigned bbpversion, int *lineno, BAT *bn, int
*hashash, char *batname, char *filename, char **options);
-int BBPreclaim(BAT *b);
int BBPrelease(bat b);
int BBPrename(BAT *b, const char *nme);
int BBPretain(bat b);
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -3015,30 +3015,6 @@ BATdescriptor(bat i)
}
/*
- * BBPreclaim is a user-exported function; the common way to destroy a
- * BAT the hard way.
- *
- * Return values:
- * -1 = bat cannot be unloaded (it has more than your own memory fix)
- * 0 = unloaded successfully
- * 1 = unload failed (due to write-to-disk failure)
- */
-int
-BBPreclaim(BAT *b)
-{
- bat i;
- bool lock = locked_by == 0 || locked_by != MT_getpid();
-
- if (b == NULL)
- return -1;
- i = b->batCacheid;
-
- assert(BBP_refs(i) == 1);
-
- return decref(i, false, lock, __func__) < 0;
-}
-
-/*
* BBPdescriptor checks whether BAT needs loading and does so if
* necessary. You must have at least one fix on the BAT before calling
* this.
diff --git a/gdk/gdk_bbp.h b/gdk/gdk_bbp.h
--- a/gdk/gdk_bbp.h
+++ b/gdk/gdk_bbp.h
@@ -70,7 +70,6 @@ gdk_export int BBPreadBBPline(FILE *fp,
gdk_export gdk_return BBPaddfarm(const char *dirname, uint32_t rolemask, bool
logerror);
/* update interface */
-gdk_export int BBPreclaim(BAT *b);
gdk_export gdk_return BBPsave(BAT *b);
gdk_export int BBPrename(BAT *b, const char *nme);
@@ -81,6 +80,12 @@ gdk_export bat BBPindex(const char *nme)
gdk_export gdk_return BBPsync(int cnt, bat *restrict subcommit, BUN *restrict
sizes, lng logno, lng transid);
gdk_export int BBPfix(bat b);
gdk_export int BBPunfix(bat b);
+static inline void
+BBPreclaim(BAT *b)
+{
+ if (b != NULL)
+ BBPunfix(b->batCacheid);
+}
gdk_export int BBPretain(bat b);
gdk_export int BBPrelease(bat b);
gdk_export void BBPkeepref(BAT *b)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]