/* Allocate a buffer large enough to hold values defined by a type string. The caller has to free the buffer. */
void* type_string_alloc(const char *type_str, u32 *count)
/* Allocate a buffer large enough to hold values defined by a type string. The caller has to free the buffer. */
void* type_string_alloc(const char *type_str, u32 *count)
{
	void *data;
	size_t size;
	size = type_string_get_space_size(type_str);
	if (!size)
		return NULL;
	data = malloc(size);
	if (data)
		*count = size;
	return data;
}