Changeset: 5b4d233700ba for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5b4d233700ba
Modified Files:
        clients/Tests/exports.stable.out
        gdk/gdk.h
        gdk/gdk_system_private.h
        gdk/gdk_utils.c
        monetdb5/mal/mal_client.c
        monetdb5/mal/mal_instruction.c
        sql/backends/monet5/sql_bincopyconvert.c
        sql/backends/monet5/sql_cat.c
        sql/backends/monet5/sql_execute.c
        sql/backends/monet5/sql_scenario.c
        sql/server/sql_mvc.c
Branch: resource_management
Log Message:

removed ta from allocator


diffs (200 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,12 +572,10 @@ void ma_destroy(allocator *sa);
 void ma_free(allocator *sa, void *);
 exception_buffer *ma_get_eb(allocator *sa) __attribute__((__pure__));
 allocator *ma_get_parent(const allocator *sa);
-allocator *ma_get_ta(allocator *sa);
 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_set_ta(allocator *sa, allocator *ta);
 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
@@ -1755,9 +1755,6 @@ gdk_export void ma_free(allocator *sa, v
 gdk_export exception_buffer *ma_get_eb(allocator *sa)
        __attribute__((__pure__));
 
-gdk_export void ma_set_ta(allocator *sa,  allocator *ta);
-gdk_export allocator *ma_get_ta(allocator *sa);
-
 #define MA_NEW( sa, type )                             ((type*)ma_alloc( sa, 
sizeof(type)))
 #define MA_ZNEW( sa, type )                            ((type*)ma_zalloc( sa, 
sizeof(type)))
 #define MA_NEW_ARRAY( sa, type, size )                 (type*)ma_alloc( sa, 
((size)*sizeof(type)))
diff --git a/gdk/gdk_system_private.h b/gdk/gdk_system_private.h
--- a/gdk/gdk_system_private.h
+++ b/gdk/gdk_system_private.h
@@ -50,7 +50,6 @@ struct freebats *MT_thread_getfreebats(v
 
 struct allocator {
        struct allocator *pa;
-       struct allocator *ta;
        size_t size;     /* size of the allocator in terms of blocks */
        size_t nr;       /* number of blocks allocated */
        char **blks;
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -2095,21 +2095,6 @@ ma_alloc(allocator *sa, size_t sz)
        return sa_fill_in_header(r, sz);
 }
 
-void
-ma_set_ta(allocator *sa, allocator *ta)
-{
-       assert(ta);
-       assert(sa->ta == NULL);
-       sa->ta = ta;
-}
-
-allocator *
-ma_get_ta(allocator *sa)
-{
-       assert(sa->ta);
-       return sa->ta;
-}
-
 allocator *
 create_allocator(allocator *pa, const char *name, bool use_lock)
 {
@@ -2132,7 +2117,6 @@ create_allocator(allocator *pa, const ch
                .blks = blks,
                .first_blk = first_blk,
                .pa = pa,
-               .ta = NULL,
                .nr = 1,
                .usedmem = SA_BLOCK_SIZE,
                .blk_size = SA_BLOCK_SIZE,
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -269,8 +269,6 @@ MCinitClientRecord(Client c, oid user, b
        c->handshake_options = NULL;
        c->query = NULL;
        c->ma = create_allocator(NULL, "MA_Client", false);
-       //c->ta = create_allocator(c->ma, "TA_Client", false);
-       //ma_set_ta(c->ma, c->ta);
 
        char name[MT_NAME_LEN];
        snprintf(name, sizeof(name), "Client%d->s", (int) (c - mal_clients));
diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -127,7 +127,6 @@ newMalBlk(int elements)
                ma_destroy(ma);
                return NULL;
        }
-       ma_set_ta(ma, ta);
        allocator *instr_allocator = create_allocator(ma, "MA_MalInstructions", 
false);
        if (instr_allocator == NULL) {
                ma_destroy(ma);
diff --git a/sql/backends/monet5/sql_bincopyconvert.c 
b/sql/backends/monet5/sql_bincopyconvert.c
--- a/sql/backends/monet5/sql_bincopyconvert.c
+++ b/sql/backends/monet5/sql_bincopyconvert.c
@@ -340,8 +340,6 @@ load_zero_terminated_text(BAT *bat, stre
        void *buffer = NULL;
        size_t buffer_len = 0;
        allocator *sa = create_allocator(NULL, NULL, false);
-       allocator *ta = create_allocator(sa, NULL, false);
-       ma_set_ta(sa, ta);
 
        // convert_and_validate_utf8() above counts on the following property 
to hold:
        assert(strNil((const char[2]){ 0x80, 0 }));
diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -604,7 +604,6 @@ create_trigger(mvc *sql, char *sname, ch
                                sql->sa = sa;
                                throw(SQL, "sql.create_trigger", 
SQLSTATE(HY013) MAL_MALLOC_FAIL);
                        }
-                       ma_set_ta(sql->sa, sql->ta);
                        r = rel_parse(sql, s, buf, m_deps);
                        if (r)
                                r = sql_processrelation(sql, r, 0, 0, 0, 0);
@@ -1101,7 +1100,6 @@ create_func(mvc *sql, char *sname, char 
                        sql->sa = sa;
                        throw(SQL, "sql.create_func", SQLSTATE(HY013) 
MAL_MALLOC_FAIL);
                }
-               ma_set_ta(sql->sa, sql->ta);
                r = rel_parse(sql, s, buf, m_deps);
                if (r)
                        r = sql_processrelation(sql, r, 0, 0, 0, 0);
diff --git a/sql/backends/monet5/sql_execute.c 
b/sql/backends/monet5/sql_execute.c
--- a/sql/backends/monet5/sql_execute.c
+++ b/sql/backends/monet5/sql_execute.c
@@ -244,7 +244,6 @@ SQLstatementIntern(Client c, const char 
                        msg = 
createException(SQL,"sql.statement",SQLSTATE(HY013) MAL_MALLOC_FAIL);
                        goto endofcompile;
                }
-               ma_set_ta(m->sa, m->ta);
        }
 
        /*
@@ -436,10 +435,8 @@ RAstatement(Client c, MalBlkPtr mb, MalS
                return msg;
        if ((msg = SQLtrans(m)) != MAL_SUCCEED)
                return msg;
-       if (!m->sa) {
+       if (!m->sa)
                m->sa = create_allocator(m->pa, NULL, false);
-               ma_set_ta(m->sa, m->ta);
-       }
        if (!m->sa)
                return RAcommit_statement(be, 
createException(SQL,"RAstatement",SQLSTATE(HY013) MAL_MALLOC_FAIL));
        refs = sa_list(m->sa);
@@ -553,10 +550,8 @@ RAstatement2(Client cntxt, MalBlkPtr mb,
                return msg;
        if ((msg = SQLtrans(m)) != MAL_SUCCEED)
                return msg;
-       if (!m->sa) {
+       if (!m->sa)
                m->sa = create_allocator(m->pa, NULL, false);
-               ma_set_ta(m->sa, m->ta);
-       }
        if (!m->sa)
                return RAstatement2_return(be, m, nlevels, gvars, gentries, 
createException(SQL,"RAstatement2",SQLSTATE(HY013) MAL_MALLOC_FAIL));
 
diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -370,7 +370,6 @@ SQLexecPostLoginTriggers(Client c)
                                                m->sa = sa;
                                                throw(SQL, 
"sql.SQLexecPostLoginTriggers", SQLSTATE(HY013) MAL_MALLOC_FAIL);
                                        }
-                                       ma_set_ta(m->sa, m->ta);
                                        r = rel_parse(m, sys, stmt, m_deps);
                                        if (r)
                                                r = sql_processrelation(m, r, 
0, 0, 0, 0);
@@ -826,7 +825,6 @@ SQLinit(Client c, const char *initpasswd
                        m->sa = create_allocator(m->pa, NULL, false);
                        if (!m->sa)
                                msg = createException(MAL, "createdb", 
SQLSTATE(HY013) MAL_MALLOC_FAIL);
-                       ma_set_ta(m->sa, m->ta);
                }
                if (!msg && maybeupgrade) {
                        if ((msg = SQLtrans(m)) == MAL_SUCCEED) {
@@ -1690,7 +1688,6 @@ SQLparser(Client c, backend *be)
                        c->mode = FINISHCLIENT;
                        throw(SQL, "SQLparser", SQLSTATE(HY013) MAL_MALLOC_FAIL 
" for SQL allocator");
                }
-               ma_set_ta(m->sa, m->ta);
        }
        if (eb_savepoint(ma_get_eb(m->sa))) {
                msg = createException(SQL, "SQLparser", "%s", 
ma_get_eb(m->sa)->msg);
diff --git a/sql/server/sql_mvc.c b/sql/server/sql_mvc.c
--- a/sql/server/sql_mvc.c
+++ b/sql/server/sql_mvc.c
@@ -165,7 +165,6 @@ mvc_init(int debug, store_type store_tpe
 
        assert(m->sa == NULL);
        m->sa = create_allocator(m->pa, NULL, false);
-       ma_set_ta(m->sa, m->ta);
        if (!m->sa) {
                mvc_destroy(m);
                mvc_exit(store);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to