static struct table *table_template_copy(struct table_template *tbl_template)
{
- struct table *copy = mp_alloc_zero(tbl_template->pool, sizeof(struct table));
+ struct table *copy = xmalloc_zero(sizeof(struct table));
copy->column_count = tbl_template->column_count;
copy->pool = mp_new(4096);
{
int col_count = 0; // count the number of columns in the struct table
- if(!tbl_template->pool) {
- tbl_template->pool = mp_new(4096);
- }
-
struct table *tbl = table_template_copy(tbl_template);
for(;;) {
{
mp_delete(tbl->pool);
memset(tbl, 0, sizeof(struct table));
+ xfree(tbl);
}
// TODO: test default column order
* -----------------
***/
-// FIXME: update documentation according to the changes made in recent comments!
+// FIXME: update documentation according to the changes made in recent commits!
/** Types of columns. These are seldom used explicitly, using a column definition macro is preferred. **/
enum column_type {
const char *col_delimiter; // [*] Delimiter that is placed between columns
// Back-end used for table formatting and its private data
struct table_formatter *formatter;
-
- struct mempool *pool; // Memory pool used for storing table handles.
};
/**