Commit cf2cce5d authored by marko's avatar marko

branches/zip: Use mem_calloc and mem_heap_calloc when possible.

row_ext_create(): After a memset() inside UNIV_DEBUG, flag the memory
uninitialized with UNIV_MEM_ALLOC().
parent 635d049d
......@@ -3165,9 +3165,7 @@ btr_estimate_number_of_different_key_vals(
n_cols = dict_index_get_n_unique(index);
n_diff = mem_alloc((n_cols + 1) * sizeof(ib_longlong));
memset(n_diff, 0, (n_cols + 1) * sizeof(ib_longlong));
n_diff = mem_calloc((n_cols + 1) * sizeof(ib_longlong));
/* We sample some pages in the index to get an estimate */
......
......@@ -43,6 +43,7 @@ row_ext_create(
ret->buf = mem_heap_alloc(heap, n_ext * REC_MAX_INDEX_COL_LEN);
#ifdef UNIV_DEBUG
memset(ret->buf, 0xaa, n_ext * REC_MAX_INDEX_COL_LEN);
UNIV_MEM_ALLOC(ret->buf, n_ext * REC_MAX_INDEX_COL_LEN);
#endif
memset(ret->len, 0, n_ext * sizeof *ret->len);
......
......@@ -599,9 +599,7 @@ row_create_prebuilt(
heap = mem_heap_create(sizeof *prebuilt + 128);
prebuilt = mem_heap_alloc(heap, sizeof *prebuilt);
memset(prebuilt, 0, sizeof *prebuilt);
prebuilt = mem_heap_calloc(heap, sizeof *prebuilt);
prebuilt->magic_n = ROW_PREBUILT_ALLOCATED;
prebuilt->magic_n2 = ROW_PREBUILT_ALLOCATED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment