diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2016-01-26 21:26:12 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2016-01-26 21:26:12 (GMT) |
commit | 8bbdc947c4f92fc9b1711adc0b00337dae2ed666 (patch) | |
tree | 4f5f3edadeece803b46ed1c3a84f11a7d266e9ec /src/H5HG.c | |
parent | 8aa7c27fb717f481d924ea5f7793b10f35c29947 (diff) | |
download | hdf5-8bbdc947c4f92fc9b1711adc0b00337dae2ed666.zip hdf5-8bbdc947c4f92fc9b1711adc0b00337dae2ed666.tar.gz hdf5-8bbdc947c4f92fc9b1711adc0b00337dae2ed666.tar.bz2 |
[svn-r28972] Removed option to clear file buffers from autotools, CMake, and library.
Buffers that will be written to disk will now always be cleared since
not doing this has huge security implications.
Tested on: 64-bit Ubuntu 15.10 (Linux 4.2.0, x86_64) gcc 5.2.1
serial autotools
parallel autotools (MPICH 3.1.4)
serial CMake
Diffstat (limited to 'src/H5HG.c')
-rw-r--r-- | src/H5HG.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -154,22 +154,20 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) /* Create it */ H5_CHECK_OVERFLOW(size, size_t, hsize_t); if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_GHEAP, dxpl_id, (hsize_t)size))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file space for global heap") + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file space for global heap") if(NULL == (heap = H5FL_MALLOC(H5HG_heap_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") heap->addr = addr; heap->size = size; heap->shared = H5F_SHARED(f); if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") -#ifdef H5_CLEAR_MEMORY -HDmemset(heap->chunk, 0, size); -#endif /* H5_CLEAR_MEMORY */ + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") + HDmemset(heap->chunk, 0, size); heap->nalloc = H5HG_NOBJS(f, size); heap->nused = 1; /* account for index 0, which is used for the free object */ if(NULL == (heap->obj = H5FL_SEQ_MALLOC(H5HG_obj_t, heap->nalloc))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") /* Initialize the header */ HDmemcpy(heap->chunk, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -452,9 +450,7 @@ H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) /* Re-allocate the heap information in memory */ if(NULL == (new_chunk = H5FL_BLK_REALLOC(gheap_chunk, heap->chunk, (heap->size + need)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "new heap allocation failed") -#ifdef H5_CLEAR_MEMORY -HDmemset(new_chunk + heap->size, 0, need); -#endif /* H5_CLEAR_MEMORY */ + HDmemset(new_chunk + heap->size, 0, need); /* Adjust the size of the heap */ old_size = heap->size; |