mpstream: get rid of mpstream_reset
Proposed ASAN implementation of region allocator does not support double reservation for the sake of simplicity. Every reservation is supposed to be followed by one or more allocations. This restiction does not work well with mpstream currently. The issue is mpstream_init/mpstream_reserve do reservation of size 0. For example In case of region slab of min order is reserved (a chunk of memory of page size currently). If the first data we want to write to mpstream is larger then the reservation done then we make reservation again. Let's get rid of this reservation at the beginning as it is suboptimal behaviour. Moreover let's get rid of mpstream_reset as mpstream_init is lightweight and we can create a new mpstream instead of reusing exiting. Also while we at it avoid allocation of 0 size in mpstream_flush as it is done in mpstream_reserve_slow (see 3.0.0-alpha3-19-g8159347d0 "misc: avoid allocations of size 0 for region" for details). NO_TEST=internal NO_CHANGELOG=internal NO_DOC=internal
Loading
Please register or sign in to comment