mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Introduce an allocation helper for vkd3d_realloc() as well.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
b4e301b2d8
commit
2ebfa91062
@@ -559,6 +559,15 @@ static inline void *hlsl_alloc(struct hlsl_ctx *ctx, size_t size)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static inline void *hlsl_realloc(struct hlsl_ctx *ctx, void *ptr, size_t size)
|
||||
{
|
||||
void *ret = vkd3d_realloc(ptr, size);
|
||||
|
||||
if (!ret)
|
||||
ctx->result = VKD3D_ERROR_OUT_OF_MEMORY;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline char *hlsl_strdup(struct hlsl_ctx *ctx, const char *string)
|
||||
{
|
||||
char *ptr = vkd3d_strdup(string);
|
||||
|
||||
Reference in New Issue
Block a user