@@ -524,6 +524,7 @@ so many of them that they are split into two fields. */
524524#define  CTL2_NULL_REPLACEMENT             0x00002000u
525525#define  CTL2_FRAMESIZE                    0x00004000u
526526
527+ #define  CTL2_HEAPFRAMES_SIZE              0x20000000u  /* Informational */ 
527528#define  CTL2_NL_SET                       0x40000000u  /* Informational */ 
528529#define  CTL2_BSR_SET                      0x80000000u  /* Informational */ 
529530
@@ -682,6 +683,7 @@ static modstruct modlist[] = {
682683  { "getall" ,                      MOD_DAT ,  MOD_CTL , CTL_GETALL ,                 DO (control ) },
683684  { "global" ,                      MOD_PNDP , MOD_CTL , CTL_GLOBAL ,                 PO (control ) },
684685  { "heap_limit" ,                  MOD_CTM ,  MOD_INT , 0 ,                          MO (heap_limit ) },
686+   { "heapframes_size" ,             MOD_PD ,   MOD_CTL , CTL2_HEAPFRAMES_SIZE ,       PO (control2 ) },
685687  { "hex" ,                         MOD_PAT ,  MOD_CTL , CTL_HEXPAT ,                 PO (control ) },
686688  { "info" ,                        MOD_PAT ,  MOD_CTL , CTL_INFO ,                   PO (control ) },
687689  { "jit" ,                         MOD_PAT ,  MOD_IND , 7 ,                          PO (jit ) },
@@ -786,8 +788,8 @@ static modstruct modlist[] = {
786788  CTL_JITVERIFY|CTL_MEMORY|CTL_PUSH|CTL_PUSHCOPY| \
787789  CTL_PUSHTABLESCOPY|CTL_USE_LENGTH)
788790
789- #define  PUSH_SUPPORTED_COMPILE_CONTROLS2  (CTL2_BSR_SET|CTL2_FRAMESIZE|  \
790-   CTL2_NL_SET)
791+ #define  PUSH_SUPPORTED_COMPILE_CONTROLS2  (CTL2_BSR_SET| \
792+   CTL2_HEAPFRAMES_SIZE|CTL2_FRAMESIZE| CTL2_NL_SET)
791793
792794/* Controls that apply only at compile time with 'push'. */ 
793795
@@ -4130,7 +4132,7 @@ Returns:      nothing
41304132static  void 
41314133show_controls (uint32_t  controls , uint32_t  controls2 , const  char  * before )
41324134{
4133- fprintf (outfile , "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s" ,
4135+ fprintf (outfile , "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s " ,
41344136  before ,
41354137  ((controls  &  CTL_AFTERTEXT ) !=  0 )? " aftertext"  : "" ,
41364138  ((controls  &  CTL_ALLAFTERTEXT ) !=  0 )? " allaftertext"  : "" ,
@@ -4153,6 +4155,7 @@ fprintf(outfile, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s
41534155  ((controls  &  CTL_FULLBINCODE ) !=  0 )? " fullbincode"  : "" ,
41544156  ((controls  &  CTL_GETALL ) !=  0 )? " getall"  : "" ,
41554157  ((controls  &  CTL_GLOBAL ) !=  0 )? " global"  : "" ,
4158+   ((controls  &  CTL2_HEAPFRAMES_SIZE ) !=  0 )? " heapframes_size"  : "" ,
41564159  ((controls  &  CTL_HEXPAT ) !=  0 )? " hex"  : "" ,
41574160  ((controls  &  CTL_INFO ) !=  0 )? " info"  : "" ,
41584161  ((controls  &  CTL_JITFAST ) !=  0 )? " jitfast"  : "" ,
@@ -4357,6 +4360,31 @@ fprintf(outfile, "Frame size for pcre2_match(): %" SIZ_FORM "\n", frame_size);
43574360
43584361
43594362
4363+ /************************************************* 
4364+ *   Show heapframes size info for a match_data   * 
4365+ *************************************************/ 
4366+ 
4367+ static  void 
4368+ show_heapframes_size (void )
4369+ {
4370+ size_t  heapframes_size ;
4371+ #ifdef  SUPPORT_PCRE2_8 
4372+ if  (code_unit_size  ==  1 )
4373+   heapframes_size  =  pcre2_get_match_data_heapframes_size_8 (match_data8 );
4374+ #endif 
4375+ #ifdef  SUPPORT_PCRE2_16 
4376+ if  (code_unit_size  ==  2 )
4377+   heapframes_size  =  pcre2_get_match_data_heapframes_size_16 (match_data16 );
4378+ #endif 
4379+ #ifdef  SUPPORT_PCRE2_32 
4380+ if  (code_unit_size  ==  4 )
4381+   heapframes_size  =  pcre2_get_match_data_heapframes_size_32 (match_data32 );
4382+ #endif 
4383+ fprintf (outfile , "Heapframes size for pcre2_match(): %"  SIZ_FORM  "\n" , heapframes_size );
4384+ }
4385+ 
4386+ 
4387+ 
43604388/************************************************* 
43614389*         Get and output an error message        * 
43624390*************************************************/ 
@@ -5971,6 +5999,7 @@ if ((pat_patctl.control2 & CTL2_NL_SET) != 0)
59715999
59726000if  ((pat_patctl .control  &  CTL_MEMORY ) !=  0 ) show_memory_info ();
59736001if  ((pat_patctl .control2  &  CTL2_FRAMESIZE ) !=  0 ) show_framesize ();
6002+ if  ((pat_patctl .control2  &  CTL2_HEAPFRAMES_SIZE ) !=  0 ) show_heapframes_size ();
59746003if  ((pat_patctl .control  &  CTL_ANYINFO ) !=  0 )
59756004  {
59766005  int  rc  =  show_pattern_info ();
0 commit comments