Changeset: 49b456b02186 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/49b456b02186
Modified Files:
        gdk/gdk_logger.c
Branch: nested
Log Message:

allow for larger atom types in the log


diffs (23 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -615,8 +615,18 @@ log_read_updates(logger *lg, trans *tr, 
                                }
                        } else {
                                if (!ATOMvarsized(tpe)) {
+                                       size_t sz = ATOMsize(tpe);
+                                       if (sz > lg->rbufsize) {
+                                               char *buf = lg->rbuf;
+                                               if (!(buf = 
GDKrealloc(lg->rbuf, sz))) {
+                                                       TRC_CRITICAL(GDK, 
"couldn't grow string buffer\n");
+                                                       return LOG_ERR;
+                                               }
+                                               lg->rbuf = buf;
+                                               lg->rbufsize = sz;
+                                       }
                                        size_t cnt = 0, snr = (size_t) nr;
-                                       size_t tlen = lg->rbufsize / 
ATOMsize(tpe), ntlen = lg->rbufsize;
+                                       size_t tlen = lg->rbufsize / sz, ntlen 
= lg->rbufsize;
                                        assert(tlen);
                                        /* read in chunks of max
                                         * BUFSIZE/width rows */
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to