From 4d81713cb8e81cb12a2f1de630b373a81a483e6d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Jun 2005 22:59:37 +0200 Subject: assemble libmysqld.a 5-10 times faster! --- libmysqld/Makefile.am | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 6fc919c904f..5f2425d77c8 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -86,29 +86,24 @@ INC_LIB= $(top_builddir)/regex/libregex.a \ # To make it easy for the end user to use the embedded library we # generate a total libmysqld.a from all library files, +# note - InnoDB libraries have circular dependencies, so in INC_LIB +# few libraries are present two times. Metrowerks linker doesn't like +# it at all. Traditional ar has no problems with it, but still there's no +# need to add the same file twice to the library, so 'sort -u' save us +# some time and spares unnecessary work. + libmysqld.a: libmysqld_int.a $(INC_LIB) if DARWIN_MWCC - mwld -lib -o $@ libmysqld_int.a `ls -1 $(INC_LIB) | sort -u` + mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` else if test "$(host_os)" = "netware" ; \ then \ $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \ else \ - if test ! -d tmp ; then mkdir tmp ; fi ; \ - rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a ; \ - cp $(INC_LIB) tmp ; \ - cp libmysqld_int.a libmysqld_int2.a ; \ - cd tmp ; \ - for file in *.a ; do \ - bfile=`basename $$file .a` ; \ - $(AR) x $$file; \ - for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \ - $(AR) q ../libmysqld_int2.a *.o ; \ - rm -f *.o ; \ - done ; \ - cd .. ; \ - mv libmysqld_int2.a libmysqld.a ; \ - rm -f tmp/* ; \ + for arc in ./libmysqld_int.a $(INC_LIB); do \ + arpath=`echo $$arc|sed 's|[^/]*$$||'`; \ + $(AR) t $$arc|sed "s|^|$$arpath|"; \ + done | sort -u | xargs $(AR) cq libmysqld.a ; \ $(RANLIB) libmysqld.a ; \ fi endif -- cgit v1.2.1 From 2906e27a7c3a287be6af12fa2969c034f37f5b40 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Jun 2005 13:43:17 +0200 Subject: yassl template instantiation - don't do too much mysys/my_access.c: remove incorrect fix comments extra/yassl/taocrypt/src/integer.cpp: yassl template instantiation - don't do too much extra/yassl/taocrypt/src/template_instnt.cpp: yassl template instantiation - don't do too much mysys/my_access.c: remove incorrect fix sql/item_func.cc: a couple of comment. assert added. --- extra/yassl/taocrypt/src/integer.cpp | 7 ++++--- extra/yassl/taocrypt/src/template_instnt.cpp | 26 ++++++++++++-------------- mysys/my_access.c | 2 +- sql/item_func.cc | 11 +++++++---- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp index 3df1df9beab..deea376189c 100644 --- a/extra/yassl/taocrypt/src/integer.cpp +++ b/extra/yassl/taocrypt/src/integer.cpp @@ -3940,9 +3940,10 @@ Integer CRT(const Integer &xp, const Integer &p, const Integer &xq, } #ifdef __GNUC__ -template unsigned int DivideThreeWordsByTwo(unsigned int*, unsigned int, unsigned int, DWord*); -template unsigned int DivideThreeWordsByTwo(unsigned int*, unsigned int, unsigned int, Word*); -template unsigned long long DivideThreeWordsByTwo(unsigned long long*, unsigned long long, unsigned long long, DWord*); +#ifndef TAOCRYPT_NATIVE_DWORD_AVAILABLE +template hword DivideThreeWordsByTwo(hword*, hword, hword, Word*); +#endif +template word DivideThreeWordsByTwo(word*, word, word, DWord*); #endif } // namespace diff --git a/extra/yassl/taocrypt/src/template_instnt.cpp b/extra/yassl/taocrypt/src/template_instnt.cpp index 5fed1ee5ae4..81a8273c5c3 100644 --- a/extra/yassl/taocrypt/src/template_instnt.cpp +++ b/extra/yassl/taocrypt/src/template_instnt.cpp @@ -9,29 +9,27 @@ namespace TaoCrypt { #if defined(SSE2_INTRINSICS_AVAILABLE) template AlignedAllocator::pointer StdReallocate >(AlignedAllocator&, unsigned int*, AlignedAllocator::size_type, AlignedAllocator::size_type, bool); #endif -template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, unsigned char*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); -template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, unsigned int*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); -template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, unsigned long long*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); template class RSA_Decryptor; template class RSA_Encryptor; template class RSA_Encryptor; +template void tcDelete(HASH*); +template void tcArrayDelete(byte*); +template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, byte*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); +template void tcArrayDelete(word*); +template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, word*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); +#ifndef TAOCRYPT_SLOW_WORD64 // defined when word != word32 +template void tcArrayDelete(word32*); +template AllocatorWithCleanup::pointer StdReallocate >(AllocatorWithCleanup&, word32*, AllocatorWithCleanup::size_type, AllocatorWithCleanup::size_type, bool); +#endif +template void tcArrayDelete(char*); } namespace mySTL { -template vector* uninit_fill_n*, unsigned int, vector >(vector*, unsigned int, vector const&); -template vector* uninit_fill_n*, unsigned long, vector >(vector*, unsigned long, vector const&); +template vector* uninit_fill_n*, size_t, vector >(vector*, size_t, vector const&); template void destroy*>(vector*, vector*); template TaoCrypt::Integer* uninit_copy(TaoCrypt::Integer*, TaoCrypt::Integer*, TaoCrypt::Integer*); -template TaoCrypt::Integer* uninit_fill_n(TaoCrypt::Integer*, unsigned int, TaoCrypt::Integer const&); -template TaoCrypt::Integer* uninit_fill_n(TaoCrypt::Integer*, unsigned long, TaoCrypt::Integer const&); +template TaoCrypt::Integer* uninit_fill_n(TaoCrypt::Integer*, size_t, TaoCrypt::Integer const&); template void destroy(TaoCrypt::Integer*, TaoCrypt::Integer*); } -namespace TaoCrypt { -template void tcDelete(HASH*); -template void tcArrayDelete(unsigned*); -template void tcArrayDelete(unsigned long long*); -template void tcArrayDelete(unsigned char*); -template void tcArrayDelete(char*); -} #endif diff --git a/mysys/my_access.c b/mysys/my_access.c index 89e90e16f18..28210bdfc7d 100644 --- a/mysys/my_access.c +++ b/mysys/my_access.c @@ -44,7 +44,7 @@ int my_access(const char *path, int amode) result= GetFileAttributesEx(path, GetFileExInfoStandard, &fileinfo); if (! result || - (fileinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) && (amode & F_OK)) + (fileinfo.dwFileAttributes & FILE_ATTRIBUTE_READONLY) && (amode & W_OK)) { my_errno= errno= EACCES; return -1; diff --git a/sql/item_func.cc b/sql/item_func.cc index 18c2efb0ace..5af99cb8132 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -695,8 +695,8 @@ String *Item_int_func::val_str(String *str) /* - Check arguments here to determine result's type for function with two - arguments. + Check arguments here to determine result's type for a numeric + function of two arguments. SYNOPSIS Item_num_op::find_num_type() @@ -722,8 +722,9 @@ void Item_num_op::find_num_type(void) hybrid_type= DECIMAL_RESULT; result_precision(); } - else if (r0 == INT_RESULT && r1 == INT_RESULT) + else { + DBUG_ASSERT(r0 == INT_RESULT && r1 == INT_RESULT); decimals= 0; hybrid_type=INT_RESULT; result_precision(); @@ -738,7 +739,9 @@ void Item_num_op::find_num_type(void) /* - Set result type of function if it (type) is depends only on first argument + Set result type for a numeric function of one argument + (can be also used by a numeric function of many arguments, if the result + type depends only on the first argument) SYNOPSIS Item_func_num1::find_num_type() -- cgit v1.2.1