Files
scylladb/core/memory.cc
Paweł Dziepak d3504f90a9 memory: fix trimming of allocated spans
Trimmers may request buffers smaller than n_pages, the original value
passed to allocate_large_and_trim(). That's why t.nr_page should be
used as a final size of the allocated span.

Another issue with the handling of span trimming is the order of operations
when pages from the beginning of the buffer are trimmed. In such case
span is updated to point to the actual beginning of the requested buffer,
but afterwards it is used to retrieve span->span_size value which is expected
to be the size of the originally allocated page span. Because the span
pointer was changed the value is invalid and the trimming doesn't free
all trimmed pages.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
2015-03-30 14:21:36 +03:00

33 KiB