aboutsummaryrefslogtreecommitdiffstats
path: root/community/sphinx/sphinx-pagesize.patch
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-08-22 07:55:13 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-08-22 07:55:13 +0000
commit623a8e0ecf210686179171915777ac0e0c5308b1 (patch)
tree2eb2c607aa26ea3fea3152d31ca67b3793397e87 /community/sphinx/sphinx-pagesize.patch
parent8ce0f835b722d4427705adaf542f994da5012b4d (diff)
downloadaports-623a8e0ecf210686179171915777ac0e0c5308b1.tar.bz2
aports-623a8e0ecf210686179171915777ac0e0c5308b1.tar.xz
community/sphinx: moved from testing
Diffstat (limited to 'community/sphinx/sphinx-pagesize.patch')
-rw-r--r--community/sphinx/sphinx-pagesize.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/community/sphinx/sphinx-pagesize.patch b/community/sphinx/sphinx-pagesize.patch
new file mode 100644
index 0000000000..83a63b0ad5
--- /dev/null
+++ b/community/sphinx/sphinx-pagesize.patch
@@ -0,0 +1,72 @@
+diff --git a/src/sphinx.cpp b/src/sphinx.cpp
+index 71f75f3..b65aeaa 100644
+--- a/src/sphinx.cpp
++++ b/src/sphinx.cpp
+@@ -8706,7 +8706,7 @@ protected:
+ static const int MAX_BITS = 12;
+ static const int NUM_SIZES = MAX_BITS-MIN_BITS+2; ///< one for 0 (empty pages), and one for each size from min to max
+
+- static const int PAGE_SIZE = 1<<MAX_BITS;
++ static const int PAGE_SIZES = 1<<MAX_BITS;
+ static const int PAGE_ALLOCS = 1<<( MAX_BITS-MIN_BITS);
+ static const int PAGE_BITMAP = ( PAGE_ALLOCS+8*sizeof(DWORD)-1 )/( 8*sizeof(DWORD) );
+
+@@ -8820,9 +8820,9 @@ DWORD * CSphArena::ReInit ( int uMaxBytes )
+
+ DWORD * CSphArena::Init ( int uMaxBytes )
+ {
+- m_iPages = ( uMaxBytes+PAGE_SIZE-1 ) / PAGE_SIZE;
++ m_iPages = ( uMaxBytes+PAGE_SIZES-1 ) / PAGE_SIZES;
+
+- int iData = m_iPages*PAGE_SIZE; // data size, bytes
++ int iData = m_iPages*PAGE_SIZES; // data size, bytes
+ int iMyTaglist = sizeof(int) + MAX_TAGS*sizeof(TagDesc_t); // int length, TagDesc_t[] tags; NOLINT
+ int iMy = m_iPages*sizeof(PageDesc_t) + NUM_SIZES*sizeof(int) + iMyTaglist; // my internal structures size, bytes; NOLINT
+ #if ARENADEBUG
+@@ -8950,7 +8950,7 @@ int CSphArena::RawAlloc ( int iBytes )
+ pPage->m_uBitmap[i] |= ( 1<<iFree );
+
+ pPage->m_iUsed++;
+- if ( pPage->m_iUsed==( PAGE_SIZE >> pPage->m_iSizeBits ) )
++ if ( pPage->m_iUsed==( PAGE_SIZES >> pPage->m_iSizeBits ) )
+ {
+ // this page is full now, unchain from the free-list
+ assert ( m_pFreelistHeads[iSizeSlot]==pPage-m_pPages );
+@@ -8970,7 +8970,7 @@ int CSphArena::RawAlloc ( int iBytes )
+
+ CheckFreelists ();
+
+- int iOffset = ( pPage-m_pPages )*PAGE_SIZE + ( i*32+iFree )*( 1<<iSizeBits ); // raw internal byte offset (FIXME! optimize with shifts?)
++ int iOffset = ( pPage-m_pPages )*PAGE_SIZES + ( i*32+iFree )*( 1<<iSizeBits ); // raw internal byte offset (FIXME! optimize with shifts?)
+ int iIndex = 2 + ( iOffset/sizeof(DWORD) ); // dword index with tag and backtrack fixup
+
+ m_pBasePtr[iIndex-1] = DWORD(-1); // untagged by default
+@@ -8988,7 +8988,7 @@ void CSphArena::RawFree ( int iIndex )
+ CheckFreelists ();
+
+ int iOffset = (iIndex-2)*sizeof(DWORD); // remove tag fixup, and go to raw internal byte offset
+- int iPage = iOffset / PAGE_SIZE;
++ int iPage = iOffset / PAGE_SIZES;
+
+ if ( iPage<0 || iPage>m_iPages )
+ {
+@@ -8997,8 +8997,8 @@ void CSphArena::RawFree ( int iIndex )
+ }
+
+ PageDesc_t * pPage = m_pPages + iPage;
+- int iBit = ( iOffset % PAGE_SIZE ) >> pPage->m_iSizeBits;
+- assert ( ( iOffset % PAGE_SIZE )==( iBit << pPage->m_iSizeBits ) && "internal error, freed offset is unaligned" );
++ int iBit = ( iOffset % PAGE_SIZES ) >> pPage->m_iSizeBits;
++ assert ( ( iOffset % PAGE_SIZES )==( iBit << pPage->m_iSizeBits ) && "internal error, freed offset is unaligned" );
+
+ if (!( pPage->m_uBitmap[iBit>>5] & ( 1UL<<(iBit & 31) ) ))
+ {
+@@ -9018,7 +9018,7 @@ void CSphArena::RawFree ( int iIndex )
+
+ int iSizeSlot = pPage->m_iSizeBits-MIN_BITS+1;
+
+- if ( pPage->m_iUsed==( PAGE_SIZE >> pPage->m_iSizeBits )-1 )
++ if ( pPage->m_iUsed==( PAGE_SIZES >> pPage->m_iSizeBits )-1 )
+ {
+ // this page was full, but it's semi-free now
+ // chain to free-list