summaryrefslogtreecommitdiffstats
path: root/lib/lz4hc.h
diff options
context:
space:
mode:
authorjonrumsey <jrumsey@uk.ibm.com>2022-07-11 10:28:32 (GMT)
committerjonrumsey <jrumsey@uk.ibm.com>2022-07-11 10:28:32 (GMT)
commitb4f508608f8f9423350cf48e46dd22c452f0b809 (patch)
tree4cb175fe5ccd15449add65fce82536f80f925b0a /lib/lz4hc.h
parent0b0e3330bcc62b8582ce6fee3a7465391f7b56c7 (diff)
downloadlz4-b4f508608f8f9423350cf48e46dd22c452f0b809.zip
lz4-b4f508608f8f9423350cf48e46dd22c452f0b809.tar.gz
lz4-b4f508608f8f9423350cf48e46dd22c452f0b809.tar.bz2
Change definitions of LZ4_STREAMSIZE, LZ4_STREAMDECODESIZE and LZ4_STREAMHCSIZE to factor in OS400 pointer length and structure alignment rules
Update the length values on platforms where pointers are 16-bytes, factor in implicit compiler padding to ensure proper alignment of members and overall structure lengths
Diffstat (limited to 'lib/lz4hc.h')
-rw-r--r--lib/lz4hc.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/lz4hc.h b/lib/lz4hc.h
index f4afc9b..6176457 100644
--- a/lib/lz4hc.h
+++ b/lib/lz4hc.h
@@ -219,8 +219,26 @@ struct LZ4HC_CCtx_internal
/* Do not use these definitions directly !
* Declare or allocate an LZ4_streamHC_t instead.
+ * Note : OS400 uses 16 byte pointers and so the structure size is larger than other
+ * platforms
+ * |===========================================================
+ * | Offset | Length | Member Name
+ * |===========================================================
+ * | 0 | 131072 | hashTable[32768]
+ * | 131072 | 131072 | chainTable[65536]
+ * | 262144 | 16 | end
+ * | 262160 | 16 | base
+ * | 262176 | 16 | dictBase
+ * | 262192 | 4 | dictLimit
+ * | 262196 | 4 | lowLimit
+ * | 262200 | 4 | nextToUpdate
+ * | 262204 | 2 | compressionLevel
+ * | 262206 | 1 | favorDecSpeed
+ * | 262207 | 1 | dirty
+ * | 262208 | 16 | dictCtx
+ * ============================================================
*/
-#define LZ4_STREAMHCSIZE 262200 /* static size, for inter-version compatibility */
+#define LZ4_STREAMHCSIZE (262200 + ((sizeof(void*)==16) ? 24 : 0)) /* static size, for inter-version compatibility */
#define LZ4_STREAMHCSIZE_VOIDP (LZ4_STREAMHCSIZE / sizeof(void*))
union LZ4_streamHC_u {
void* table[LZ4_STREAMHCSIZE_VOIDP];