summaryrefslogtreecommitdiff
path: root/bridges/source/cpp_uno/shared/vtablefactory.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bridges/source/cpp_uno/shared/vtablefactory.cxx')
-rw-r--r--bridges/source/cpp_uno/shared/vtablefactory.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index ca77aea72e50..226a994bf664 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -229,9 +229,14 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
sal_Size size = getBlockSize(slotCount);
sal_Size pagesize = sysconf(_SC_PAGESIZE);
block.size = (size + (pagesize - 1)) & ~(pagesize - 1);
- block.start = block.exec = NULL;
block.fd = -1;
+ // Try non-doublemmaped allocation first:
+ block.start = block.exec = rtl_arena_alloc(m_arena, &block.size);
+ if (block.start != nullptr) {
+ return true;
+ }
+
osl::Security aSecurity;
OUString strDirectory;
OUString strURLDirectory;
@@ -290,12 +295,6 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
strDirectory.clear();
}
- if (!block.start || !block.exec || block.fd == -1)
- {
- //Fall back to non-doublemmaped allocation
- block.fd = -1;
- block.start = block.exec = rtl_arena_alloc(m_arena, &block.size);
- }
return (block.start != 0 && block.exec != 0);
}