swapmemory               package:rhdf5               R Documentation

_F_u_n_c_t_i_o_n_s _t_o _h_a_n_d_l_e _a_d_d_i_n_g _R _m_e_m_o_r_y _t_o _H_D_F_5 _o_b_j_e_c_t_s.

_D_e_s_c_r_i_p_t_i_o_n:

     These functions manipulate memory that is stored using the
     protected slot in the external reference.

_U_s_a_g_e:

     swapmemory(set1, set2)
     addmemory(set1)
     freememory(set1)
     hasmemory(set1)
     getmemory(set1)

_A_r_g_u_m_e_n_t_s:

    set1: An HDF5 dataset. 

    set2: An HDF5 dataset. 

_D_e_t_a_i_l_s:

     Sometimes, in the interest of efficiency we may want to
     preallocate memory that will subsequently be used to perform
     calculations on an HDF5 data set. For example, if a number of
     identical images are going to be processed by a C/Fortran routine
     then it will be more efficient to allocate one piece of memory and
     swap it between HDF5 objects.

     These functions provide a primitive interface to that
     functionality.

_V_a_l_u_e:

     'hasmemory' returns 'TRUE' if the HDF5 dataset has memory
     allocated for it.

     'freememory' sets the memory to NULL and the memory that was
     stored will be collected by the garbage collector the next time it
     runs.

     'swapmemory' swaps the memory held by 'set1' to 'set2'. The memory
     will be NULL for 'set1' after this operation.

     'addmemory' adds a vector of R allocated memory that is large
     enough to hold the entire hdf5 object. At some point in time it
     might be useful to have the option of allocating for a selected
     dataspace.

     'getmemory' returns the memory, as a vector. It may not be
     initialized. This could be an option at some later date.

_A_u_t_h_o_r(_s):

     R. Gentleman

_S_e_e _A_l_s_o:

     'hdf5'

_E_x_a_m_p_l_e_s:

     #we need a testing paradigm

