mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
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().
This commit is contained in:
parent
d9db67696e
commit
f68d3656dc
3 changed files with 3 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue