Eliminate ViewBB in STORABLE_thaw This results in an additional copy of the buffer. To avoid the copy, we'd need something like a read-only RAMFile backed by a Blob. But this code path isn't performance-critical.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/c6ccfdb6 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/c6ccfdb6 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/c6ccfdb6 Branch: refs/heads/master Commit: c6ccfdb6be608d2c37f257f7ad0cbf7c83582449 Parents: 5651dd3 Author: Nick Wellnhofer <[email protected]> Authored: Mon May 4 18:36:52 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Tue May 5 11:23:38 2015 +0200 ---------------------------------------------------------------------- perl/buildlib/Lucy/Build/Binding/Misc.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/c6ccfdb6/perl/buildlib/Lucy/Build/Binding/Misc.pm ---------------------------------------------------------------------- diff --git a/perl/buildlib/Lucy/Build/Binding/Misc.pm b/perl/buildlib/Lucy/Build/Binding/Misc.pm index dbc54d0..8d20418 100644 --- a/perl/buildlib/Lucy/Build/Binding/Misc.pm +++ b/perl/buildlib/Lucy/Build/Binding/Misc.pm @@ -119,8 +119,8 @@ PPCODE: = cfish_Class_singleton((cfish_String*)class_name_str, NULL); STRLEN len; char *ptr = SvPV(serialized_sv, len); - cfish_ViewByteBuf *contents = cfish_ViewBB_new(ptr, len); - lucy_RAMFile *ram_file = lucy_RAMFile_new((cfish_ByteBuf*)contents, true); + cfish_ByteBuf *contents = cfish_BB_new_bytes(ptr, len); + lucy_RAMFile *ram_file = lucy_RAMFile_new(contents, true); lucy_RAMFileHandle *file_handle = lucy_RAMFH_open(NULL, LUCY_FH_READ_ONLY, ram_file); lucy_InStream *instream = lucy_InStream_open((cfish_Obj*)file_handle);
