src/core/alloc_func.hpp
branchNewGRF_ports
changeset 10994 cd9968b6f96b
parent 10274 b3c58f3df92b
equal deleted inserted replaced
10991:d8811e327d12 10994:cd9968b6f96b
    88 	t_ptr = (T*)realloc(t_ptr, num_elements * sizeof(T));
    88 	t_ptr = (T*)realloc(t_ptr, num_elements * sizeof(T));
    89 	if (t_ptr == NULL) ReallocError(num_elements * sizeof(T));
    89 	if (t_ptr == NULL) ReallocError(num_elements * sizeof(T));
    90 	return t_ptr;
    90 	return t_ptr;
    91 }
    91 }
    92 
    92 
       
    93 /** alloca() has to be called in the parent function, so define AllocaM() as a macro */
       
    94 #define AllocaM(T, num_elements) ((T*)alloca((num_elements) * sizeof(T)))
       
    95 
    93 #endif /* ALLOC_FUNC_HPP */
    96 #endif /* ALLOC_FUNC_HPP */