@@ -524,6 +524,7 @@ so many of them that they are split into two fields. */
524
524
#define CTL2_NULL_REPLACEMENT 0x00002000u
525
525
#define CTL2_FRAMESIZE 0x00004000u
526
526
527
+ #define CTL2_HEAPFRAMES_SIZE 0x20000000u /* Informational */
527
528
#define CTL2_NL_SET 0x40000000u /* Informational */
528
529
#define CTL2_BSR_SET 0x80000000u /* Informational */
529
530
@@ -682,6 +683,7 @@ static modstruct modlist[] = {
682
683
{ "getall" , MOD_DAT , MOD_CTL , CTL_GETALL , DO (control ) },
683
684
{ "global" , MOD_PNDP , MOD_CTL , CTL_GLOBAL , PO (control ) },
684
685
{ "heap_limit" , MOD_CTM , MOD_INT , 0 , MO (heap_limit ) },
686
+ { "heapframes_size" , MOD_PD , MOD_CTL , CTL2_HEAPFRAMES_SIZE , PO (control2 ) },
685
687
{ "hex" , MOD_PAT , MOD_CTL , CTL_HEXPAT , PO (control ) },
686
688
{ "info" , MOD_PAT , MOD_CTL , CTL_INFO , PO (control ) },
687
689
{ "jit" , MOD_PAT , MOD_IND , 7 , PO (jit ) },
@@ -786,8 +788,8 @@ static modstruct modlist[] = {
786
788
CTL_JITVERIFY|CTL_MEMORY|CTL_PUSH|CTL_PUSHCOPY| \
787
789
CTL_PUSHTABLESCOPY|CTL_USE_LENGTH)
788
790
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)
791
793
792
794
/* Controls that apply only at compile time with 'push'. */
793
795
@@ -4130,7 +4132,7 @@ Returns: nothing
4130
4132
static void
4131
4133
show_controls (uint32_t controls , uint32_t controls2 , const char * before )
4132
4134
{
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 " ,
4134
4136
before ,
4135
4137
((controls & CTL_AFTERTEXT ) != 0 )? " aftertext" : "" ,
4136
4138
((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
4153
4155
((controls & CTL_FULLBINCODE ) != 0 )? " fullbincode" : "" ,
4154
4156
((controls & CTL_GETALL ) != 0 )? " getall" : "" ,
4155
4157
((controls & CTL_GLOBAL ) != 0 )? " global" : "" ,
4158
+ ((controls & CTL2_HEAPFRAMES_SIZE ) != 0 )? " heapframes_size" : "" ,
4156
4159
((controls & CTL_HEXPAT ) != 0 )? " hex" : "" ,
4157
4160
((controls & CTL_INFO ) != 0 )? " info" : "" ,
4158
4161
((controls & CTL_JITFAST ) != 0 )? " jitfast" : "" ,
@@ -4357,6 +4360,31 @@ fprintf(outfile, "Frame size for pcre2_match(): %" SIZ_FORM "\n", frame_size);
4357
4360
4358
4361
4359
4362
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
+
4360
4388
/*************************************************
4361
4389
* Get and output an error message *
4362
4390
*************************************************/
@@ -5971,6 +5999,7 @@ if ((pat_patctl.control2 & CTL2_NL_SET) != 0)
5971
5999
5972
6000
if ((pat_patctl .control & CTL_MEMORY ) != 0 ) show_memory_info ();
5973
6001
if ((pat_patctl .control2 & CTL2_FRAMESIZE ) != 0 ) show_framesize ();
6002
+ if ((pat_patctl .control2 & CTL2_HEAPFRAMES_SIZE ) != 0 ) show_heapframes_size ();
5974
6003
if ((pat_patctl .control & CTL_ANYINFO ) != 0 )
5975
6004
{
5976
6005
int rc = show_pattern_info ();
0 commit comments