util: remove duplicated MALLOC_STRUCT and CALLOC_STRUCT
authorMarek Olšák <marek.olsak@amd.com>
Thu, 26 Mar 2020 03:47:36 +0000 (23:47 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 27 Mar 2020 21:00:10 +0000 (21:00 +0000)
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>

src/util/imports.h

index 1e547c3..4ebae04 100644 (file)
 #include <string.h>
 #include "util/compiler.h"
 #include "util/bitscan.h"
+#include "util/u_memory.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 
-/**********************************************************************/
-/** Memory macros */
-/*@{*/
-
-/** Allocate a structure of type \p T */
-#define MALLOC_STRUCT(T)   (struct T *) malloc(sizeof(struct T))
-/** Allocate and zero a structure of type \p T */
-#define CALLOC_STRUCT(T)   (struct T *) calloc(1, sizeof(struct T))
-
-/*@}*/
-
-
 /*
  * For GL_ARB_vertex_buffer_object we need to treat vertex array pointers
  * as offsets into buffer stores.  Since the vertex array pointer and