diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-12-15 09:06:04 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-12-15 09:06:04 -0500 |
commit | e1cd4d5eba5c3b9f8997d363e3aef0b4b5730fed (patch) | |
tree | 39f87b7443e744889fecb462bb42bb12bbfc6210 /src/cursor | |
parent | 60366cf06906a23882e310b893c12f925517982c (diff) | |
download | mongo-e1cd4d5eba5c3b9f8997d363e3aef0b4b5730fed.tar.gz |
Most WiredTiger calloc calls are to allocate a single structure,
create the macro __wt_calloc_one that doesn't take a count or a
sizeof.
Diffstat (limited to 'src/cursor')
-rw-r--r-- | src/cursor/cur_backup.c | 2 | ||||
-rw-r--r-- | src/cursor/cur_config.c | 2 | ||||
-rw-r--r-- | src/cursor/cur_ds.c | 2 | ||||
-rw-r--r-- | src/cursor/cur_dump.c | 4 | ||||
-rw-r--r-- | src/cursor/cur_index.c | 2 | ||||
-rw-r--r-- | src/cursor/cur_log.c | 6 | ||||
-rw-r--r-- | src/cursor/cur_metadata.c | 2 | ||||
-rw-r--r-- | src/cursor/cur_stat.c | 2 | ||||
-rw-r--r-- | src/cursor/cur_table.c | 2 |
9 files changed, 12 insertions, 12 deletions
diff --git a/src/cursor/cur_backup.c b/src/cursor/cur_backup.c index b993e3f1af4..5fa3734a690 100644 --- a/src/cursor/cur_backup.c +++ b/src/cursor/cur_backup.c @@ -125,7 +125,7 @@ __wt_curbackup_open(WT_SESSION_IMPL *session, cb = NULL; - WT_RET(__wt_calloc_def(session, 1, &cb)); + WT_RET(__wt_calloc_one(session, &cb)); cursor = &cb->iface; *cursor = iface; cursor->session = &session->iface; diff --git a/src/cursor/cur_config.c b/src/cursor/cur_config.c index 868b144efc1..297e030c6dc 100644 --- a/src/cursor/cur_config.c +++ b/src/cursor/cur_config.c @@ -48,7 +48,7 @@ __wt_curconfig_open(WT_SESSION_IMPL *session, WT_UNUSED(uri); - WT_RET(__wt_calloc_def(session, 1, &cconfig)); + WT_RET(__wt_calloc_one(session, &cconfig)); cursor = &cconfig->iface; *cursor = iface; diff --git a/src/cursor/cur_ds.c b/src/cursor/cur_ds.c index fc742ae7c3d..6dd3fa76e23 100644 --- a/src/cursor/cur_ds.c +++ b/src/cursor/cur_ds.c @@ -473,7 +473,7 @@ __wt_curds_open( data_source = NULL; metaconf = NULL; - WT_RET(__wt_calloc_def(session, 1, &data_source)); + WT_RET(__wt_calloc_one(session, &data_source)); cursor = &data_source->iface; *cursor = iface; cursor->session = &session->iface; diff --git a/src/cursor/cur_dump.c b/src/cursor/cur_dump.c index 003b7e1f961..d632607de29 100644 --- a/src/cursor/cur_dump.c +++ b/src/cursor/cur_dump.c @@ -371,7 +371,7 @@ __wt_curdump_create(WT_CURSOR *child, WT_CURSOR *owner, WT_CURSOR **cursorp) session = (WT_SESSION_IMPL *)child->session; - WT_RET(__wt_calloc_def(session, 1, &cdump)); + WT_RET(__wt_calloc_one(session, &cdump)); cursor = &cdump->iface; *cursor = iface; cursor->session = child->session; @@ -384,7 +384,7 @@ __wt_curdump_create(WT_CURSOR *child, WT_CURSOR *owner, WT_CURSOR **cursorp) F_SET(cursor, F_ISSET(child, WT_CURSTD_DUMP_HEX | WT_CURSTD_DUMP_JSON | WT_CURSTD_DUMP_PRINT)); if (F_ISSET(cursor, WT_CURSTD_DUMP_JSON)) { - WT_ERR(__wt_calloc_def(session, 1, &json)); + WT_ERR(__wt_calloc_one(session, &json)); cursor->json_private = child->json_private = json; } diff --git a/src/cursor/cur_index.c b/src/cursor/cur_index.c index 936337047b8..d9b6815274e 100644 --- a/src/cursor/cur_index.c +++ b/src/cursor/cur_index.c @@ -382,7 +382,7 @@ __wt_curindex_open(WT_SESSION_IMPL *session, namesize = (size_t)(columns - idxname); WT_RET(__wt_schema_open_index(session, table, idxname, namesize, &idx)); - WT_RET(__wt_calloc_def(session, 1, &cindex)); + WT_RET(__wt_calloc_one(session, &cindex)); cursor = &cindex->iface; *cursor = iface; diff --git a/src/cursor/cur_log.c b/src/cursor/cur_log.c index 1c8371fb9b5..00352bd8d3b 100644 --- a/src/cursor/cur_log.c +++ b/src/cursor/cur_log.c @@ -335,12 +335,12 @@ __wt_curlog_open(WT_SESSION_IMPL *session, log = conn->log; cl = NULL; - WT_RET(__wt_calloc_def(session, 1, &cl)); + WT_RET(__wt_calloc_one(session, &cl)); cursor = &cl->iface; *cursor = iface; cursor->session = &session->iface; - WT_ERR(__wt_calloc_def(session, 1, &cl->cur_lsn)); - WT_ERR(__wt_calloc_def(session, 1, &cl->next_lsn)); + WT_ERR(__wt_calloc_one(session, &cl->cur_lsn)); + WT_ERR(__wt_calloc_one(session, &cl->next_lsn)); WT_ERR(__wt_scr_alloc(session, 0, &cl->logrec)); WT_ERR(__wt_scr_alloc(session, 0, &cl->opkey)); WT_ERR(__wt_scr_alloc(session, 0, &cl->opvalue)); diff --git a/src/cursor/cur_metadata.c b/src/cursor/cur_metadata.c index 67c7b07891b..eea8058fa83 100644 --- a/src/cursor/cur_metadata.c +++ b/src/cursor/cur_metadata.c @@ -421,7 +421,7 @@ __wt_curmetadata_open(WT_SESSION_IMPL *session, WT_CURSOR_METADATA *mdc; WT_DECL_RET; - WT_RET(__wt_calloc_def(session, 1, &mdc)); + WT_RET(__wt_calloc_one(session, &mdc)); cursor = &mdc->iface; *cursor = iface; diff --git a/src/cursor/cur_stat.c b/src/cursor/cur_stat.c index b9bc4039619..cbea3e50a56 100644 --- a/src/cursor/cur_stat.c +++ b/src/cursor/cur_stat.c @@ -502,7 +502,7 @@ __wt_curstat_open(WT_SESSION_IMPL *session, conn = S2C(session); - WT_ERR(__wt_calloc_def(session, 1, &cst)); + WT_ERR(__wt_calloc_one(session, &cst)); cursor = &cst->iface; *cursor = iface; cursor->session = &session->iface; diff --git a/src/cursor/cur_table.c b/src/cursor/cur_table.c index 25479a166b1..69e5a00df08 100644 --- a/src/cursor/cur_table.c +++ b/src/cursor/cur_table.c @@ -876,7 +876,7 @@ __wt_curtable_open(WT_SESSION_IMPL *session, return (ret); } - WT_RET(__wt_calloc_def(session, 1, &ctable)); + WT_RET(__wt_calloc_one(session, &ctable)); cursor = &ctable->iface; *cursor = iface; |