Go to the source code of this file.
◆ PGLZ_MAX_OUTPUT
◆ PGLZ_Strategy
◆ pglz_compress()
Definition at line 509 of file pg_lzcompress.c.
511{
512 unsigned char *
bp = (
unsigned char *) dest;
520 unsigned char ctrlb = 0;
521 unsigned char ctrl = 0;
531 int mask;
532
533
534
535
536 if (strategy ==
NULL)
538
539
540
541
542
546 return -1;
547
548
549
550
556
562
568
569
570
571
572
573
575 {
576
578 }
579 else
581
582
583
584
585
586
587
594 else if (
slen < 1024)
596 else
599
600
601
602
603
605
606
607
608
610 {
611
612
613
614
615
616
617
619 return -1;
620
621
622
623
624
625
626
628 return -1;
629
630
631
632
635 {
636
637
638
639
642 {
647
648 }
650 }
651 else
652 {
653
654
655
661
662 }
663 }
664
665
666
667
668
672 return -1;
673
674
675 return result_size;
676}
static int16 hist_start[PGLZ_MAX_HISTORY_LISTS]
const PGLZ_Strategy *const PGLZ_strategy_default
static int pglz_find_match(int16 *hstart, const char *input, const char *end, int *lenp, int *offp, int good_match, int good_drop, int mask)
static PGLZ_HistEntry hist_entries[PGLZ_HISTORY_SIZE+1]
#define pglz_out_tag(_ctrlp, _ctrlb, _ctrl, _buf, _len, _off)
#define pglz_out_literal(_ctrlp, _ctrlb, _ctrl, _buf, _byte)
#define pglz_hist_add(_hs, _he, _hn, _recycle, _s, _e, _mask)
static rewind_source * source
References fb(), PGLZ_Strategy::first_success_by, hist_entries, hist_start, PGLZ_Strategy::match_size_drop, PGLZ_Strategy::match_size_good, PGLZ_Strategy::max_input_size, PGLZ_Strategy::min_comp_rate, pglz_find_match(), pglz_hist_add, PGLZ_MAX_MATCH, pglz_out_literal, pglz_out_tag, PGLZ_strategy_default, and source.
Referenced by pglz_compress_datum(), and XLogCompressBackupBlock().
◆ pglz_decompress()
Definition at line 692 of file pg_lzcompress.c.
694{
695 const unsigned char *
sp;
696 const unsigned char *
srcend;
699
700 sp = (
const unsigned char *)
source;
702 dp = (
unsigned char *) dest;
704
706 {
707
708
709
710
711 unsigned char ctrl = *
sp++;
713
715 {
717 {
718
719
720
721
722
723
724
725
726
729
730 len = (
sp[0] & 0x0f) + 3;
731 off = ((
sp[0] & 0xf0) << 4) |
sp[1];
735
736
737
738
739
740
741
742
743
744
746 off > (
dp - (
unsigned char *)
dest)))
747 return -1;
748
749
750
751
753
754
755
756
757
758
759
760
761
762
764 {
765
766
767
768
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797 off += off;
798 }
801 }
802 else
803 {
804
805
806
807
809 }
810
811
812
813
815 }
816 }
817
818
819
820
822 return -1;
823
824
825
826
827 return (
char *)
dp -
dest;
828}
References fb(), len, Min, source, and unlikely.
Referenced by pglz_decompress_datum(), pglz_decompress_datum_slice(), and RestoreBlockImage().
◆ pglz_maximum_compressed_size()
| int32 pglz_maximum_compressed_size |
( |
int32 |
rawsize, |
|
|
int32 |
total_compressed_size |
|
) |
| |
|
extern |
◆ PGLZ_strategy_always
◆ PGLZ_strategy_default