Changeset: 2373bf244937 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2373bf244937
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk.h
gdk/gdk_utils.c
sql/backends/monet5/sql.c
tools/monetdbe/monetdbe.c
Branch: Dec2025
Log Message:
Turn ma_reset into void function since it returns its argument always.
diffs (105 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
@@ -572,7 +572,7 @@ int ma_info(allocator *sa, char *buf, si
const char *ma_name(allocator *sa);
allocator_state ma_open(allocator *sa);
void *ma_realloc(allocator *sa, void *ptr, size_t sz, size_t osz);
-allocator *ma_reset(allocator *sa);
+void ma_reset(allocator *sa);
size_t ma_size(allocator *sa);
char *ma_strconcat(allocator *sa, const char *s1, const char *s2);
char *ma_strdup(allocator *sa, const char *s);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1758,7 +1758,7 @@ gdk_export ValPtr VALinit(allocator *va,
gdk_export allocator *create_allocator(allocator *pa, const char *, bool
use_lock);
gdk_export allocator *ma_get_parent(const allocator *sa);
gdk_export bool ma_tmp_active(const allocator *sa);
-gdk_export allocator *ma_reset(allocator *sa);
+gdk_export void ma_reset(allocator *sa);
gdk_export void *ma_alloc(allocator *sa, size_t sz);
gdk_export void *ma_zalloc(allocator *sa, size_t sz);
gdk_export void *ma_realloc(allocator *sa, void *ptr, size_t sz, size_t osz);
@@ -1888,19 +1888,16 @@ gdk_export int ma_info(allocator *sa, ch
#define ma_reset(sa) \
({ \
allocator *_sa = (sa); \
- allocator *_sa2 = ma_reset(_sa); \
+ ma_reset(_sa); \
TRC_DEBUG(ALLOC, \
- "ma_reset(%p(%s)) -> %p\n", \
- _sa, ma_name(_sa), _sa2); \
- _sa2; \
+ "ma_reset(%p(%s))\n", _sa, ma_name(_sa)); \
})
-#define ma_destroy(sa) \
- ({ \
- allocator *_sa = (sa); \
- TRC_DEBUG(ALLOC, \
- "ma_destroy(%p(%s))\n", \
- _sa, ma_name(_sa)); \
- ma_destroy(_sa); \
+#define ma_destroy(sa) \
+ ({ \
+ allocator *_sa = (sa); \
+ TRC_DEBUG(ALLOC, \
+ "ma_destroy(%p(%s))\n", _sa, ma_name(_sa)); \
+ ma_destroy(_sa); \
})
#endif
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -2183,7 +2183,7 @@ static inline void
* Reset allocator to initial state
*/
#undef ma_reset
-allocator *
+void
ma_reset(allocator *sa)
{
COND_LOCK_ALLOCATOR(sa);
@@ -2192,7 +2192,7 @@ ma_reset(allocator *sa)
COND_UNLOCK_ALLOCATOR(sa);
if (sa->eb.enabled)
eb_error(&sa->eb, "reset failed, allocator has
dependencies", 1000);
- return sa;
+ return;
}
// 1st block is where we live, free the rest
_ma_free_blks(sa, 1);
@@ -2221,7 +2221,6 @@ ma_reset(allocator *sa)
sa->inuse = 0;
sa->tmp_used = 0;
COND_UNLOCK_ALLOCATOR(sa);
- return sa;
}
static void * _ma_alloc_internal(allocator* sa, size_t sz);
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
@@ -172,7 +172,7 @@ sqlcleanup(backend *be, int err)
be->mvc->sym = NULL;
be->mvc->runs = NULL;
if (be->mvc->sa)
- be->mvc->sa = ma_reset(be->mvc->sa);
+ ma_reset(be->mvc->sa);
if (err >0)
be->mvc->session->status = -err;
if (err <0)
diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c
--- a/tools/monetdbe/monetdbe.c
+++ b/tools/monetdbe/monetdbe.c
@@ -399,7 +399,7 @@ monetdbe_query_internal(monetdbe_databas
m->runs = NULL;
m->label = 0;
if (m->sa)
- m->sa = ma_reset(m->sa);
+ ma_reset(m->sa);
m->scanner.mode = LINE_N;
m->scanner.rs = c->fdin;
mvc_query_processed(m);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]