Changeset: f316538f4bc4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f316538f4bc4
Modified Files:
gdk/gdk_bbp.c
monetdb5/mal/mal.h
monetdb5/modules/mal/pipeline.h
monetdb5/modules/mal/pp_sort.c
Branch: default
Log Message:
Added "counted_by" attributes to some flexible array members.
diffs (56 lines):
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4878,7 +4878,7 @@ typedef struct gdk_callback {
lng last_called; // timestamp GDKusec
gdk_return (*func)(int argc, void *argv[]);
struct gdk_callback *next;
- void *argv[];
+ void *argv[] __attribute__((__counted_by__(argc)));
} gdk_callback;
static struct {
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -224,7 +224,7 @@ typedef struct MALSTK {
struct MALSTK *up; /* stack trace list */
struct MALBLK *blk; /* associated definition */
- ValRecord stk[];
+ ValRecord stk[] __attribute__((__counted_by__(stksize)));
} MalStack, *MalStkPtr;
#endif /* _MAL_H */
diff --git a/monetdb5/modules/mal/pipeline.h b/monetdb5/modules/mal/pipeline.h
--- a/monetdb5/modules/mal/pipeline.h
+++ b/monetdb5/modules/mal/pipeline.h
@@ -58,7 +58,7 @@ struct pipeline_concat {
int max;
bool started;
int *cur;
- BAT *srcs[];
+ BAT *srcs[] __attribute__((__counted_by__(max)));
};
struct pipeline_resultset {
diff --git a/monetdb5/modules/mal/pp_sort.c b/monetdb5/modules/mal/pp_sort.c
--- a/monetdb5/modules/mal/pp_sort.c
+++ b/monetdb5/modules/mal/pp_sort.c
@@ -706,7 +706,7 @@ typedef struct sop_t {
MT_Lock l;
part_t *h, *t;
- part_t *workers[];
+ part_t *workers[] __attribute__((__counted_by__(nr_workers)));
} sop_t;
static void
@@ -756,6 +756,7 @@ SOPnew(Client cntxt, MalBlkPtr mb, MalSt
if (!q)
throw(MAL, "sop.new", SQLSTATE(HY013) MAL_MALLOC_FAIL);
+ q->nr_workers = nr_workers;
q->nr = 0;
q->h = NULL;
q->t = NULL;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]