diff options
author | Rüdiger Timm <rt@openoffice.org> | 2006-05-02 11:00:28 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2006-05-02 11:00:28 +0000 |
commit | 22fe995be78c1d0f31be904f629a7e14892c4233 (patch) | |
tree | 9536d135e878b96f9e9bcdf0b6d170d73f566201 /bridges | |
parent | 5d77b2b3e76b41e6c90296e58804bb277dcb88b4 (diff) |
INTEGRATION: CWS mhu12 (1.19.18); FILE MERGED
2006/04/19 12:55:29 sb 1.19.18.1: #i47132# Adapted to new functionality from rtl/alloc.h to obtain executable memory for the raw vtable blocks (which contain code snippets together with the vtables).
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx b/bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx index a50daa5796e3..ed8ddf838d32 100644 --- a/bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx @@ -4,9 +4,9 @@ * * $RCSfile: cpp2uno.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: obo $ $Date: 2006-01-16 13:21:49 $ + * last change: $Author: rt $ $Date: 2006-05-02 12:00:28 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -452,21 +452,23 @@ unsigned char * codeSnippet( } -void ** bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(char * block) +void ** bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) { - return reinterpret_cast< void ** >(block) + 1; + return static_cast< void ** >(block) + 1; } -char * bridges::cpp_uno::shared::VtableFactory::createBlock( - sal_Int32 slotCount, void *** slots) +sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( + sal_Int32 slotCount) { - char * block = new char[ - (slotCount + 3) * sizeof (void *) + slotCount * codeSnippetSize]; - *slots = mapBlockToVtable(block) + 2; - (*slots)[-3] = 0; // RTTI - (*slots)[-2] = 0; // null - (*slots)[-1] = 0; // destructor - return block; + return (slotCount + 3) * sizeof (void *) + slotCount * codeSnippetSize; +} + +void ** bridges::cpp_uno::shared::VtableFactory::initializeBlock(void * block) { + void ** slots = mapBlockToVtable(block) + 2; + slots[-3] = 0; // RTTI + slots[-2] = 0; // null + slots[-1] = 0; // destructor + return slots; } unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( |