Changeset: be2db7647a0e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=be2db7647a0e
Modified Files:
sql/server/rel_sequence.c
Branch: Aug2018
Log Message:
Improve the calculation of the buffer size for storing the generated sequence
names.
It used to compute a size of 1067, now 15. This reduces the size of allocated
memory considerably.
TODO: change the api of function: int store_next_oid(void) in store.c to oid
store_next_oid(void). This needs to be done in default branch.
diffs (12 lines):
diff --git a/sql/server/rel_sequence.c b/sql/server/rel_sequence.c
--- a/sql/server/rel_sequence.c
+++ b/sql/server/rel_sequence.c
@@ -17,7 +17,7 @@ char*
sql_next_seq_name(mvc *m)
{
int id = store_next_oid();
- oid len = 5 + ((id+7)>>3);
+ size_t len = 5 + 10; /* max nr of digits of (4 bytes) int is 10 */
char *msg = sa_alloc(m->sa, len);
snprintf(msg, len, "seq_%d", id);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list