dsfree (2) --- free a block of dynamic storage 01/07/83 _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n subroutine dsfree (block) pointer block Library: vswtlb (standard Subsystem library) _F_u_n_c_t_i_o_n 'Dsfree' returns a block of storage allocated by 'dsget' to the available space list. The argument must be a pointer returned by 'dsget'. See the remarks under 'dsget' for required initialization measures. _I_m_p_l_e_m_e_n_t_a_t_i_o_n 'Dsfree' is an implementation of Algorithm B on page 440 of Volume 1 of _T_h_e _A_r_t _o_f _C_o_m_p_u_t_e_r _P_r_o_g_r_a_m_m_i_n_g, by Donald E. Knuth. The reader is referred to that source for detailed information. 'Dsfree' and 'dsget' maintain a list of free storage blocks, ordered by address. 'Dsfree' searches the list to find the proper location for the block being returned, and inserts the block into the list at that location. If blocks on either side of the newly-returned block are available, they are coalesced with the new block. If the block address does not correspond to the address of any allocated block, 'dsfree' remarks "attempt to free unallocated block" and waits for the user to type a letter "c" to continue. If any other character is typed, the program is terminated. _C_a_l_l_s getlin, remark _B_u_g_s The algorithm itself is not the best. _S_e_e _A_l_s_o dsget (2), dsinit (2), dsdump (2), dsdbiu (6) dsfree (2) - 1 - dsfree (2)