[Tarantool-patches] [PATCH v3 1/2] b-tree: return NULL on matras_alloc fail

Konstantin Osipov kostja.osipov at gmail.com
Fri Jan 31 11:18:55 MSK 2020


* Nikita Pettik <korablev at tarantool.org> [20/01/21 13:37]:
> On 20 Jan 21:13, Ilya Kosarev wrote:
> > In bps_tree_create_leaf we use matras_alloc in case
> > bps_tree_garbage_pop didn't work out. However it also might not
> > succeed. Then we need to return NULL instead of dereferencing NULL
> > pointer.

I don't understand the attempt to fix it.

The reason the allocations are not checked - most likely -because
BPS should refuse to even begin an operation if there is not
enough memory in matras.

Most likely Alexander Lyapunov was relying on that, and this is why you
don't have these checks all over bps code.



-- 
Konstantin Osipov, Moscow, Russia


More information about the Tarantool-patches mailing list