[Tarantool-patches] [PATCH v4 36/53] sql: introduce mem_set_pointer()

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Tue Mar 30 02:06:12 MSK 2021


Thanks for the patch!

I think mem_set_ptr() name was better. Was shorter and still easy to
understand.

> diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
> index fd2710478..3701741ef 100644
> --- a/src/box/sql/mem.c
> +++ b/src/box/sql/mem.c
> @@ -595,6 +595,15 @@ mem_set_undefined(struct Mem *mem)
>  	mem->field_type = field_type_MAX;
>  }
>  
> +void
> +mem_set_pointer(struct Mem *mem, void *ptr)
> +{
> +	mem_clear(mem);
> +	mem->flags = MEM_Ptr;
> +	mem->u.p = ptr;
> +	mem->field_type = field_type_MAX;

mem_clear() already sets the type.


More information about the Tarantool-patches mailing list