Bernát Gábor
c79e18a8e5
gh-150717: Avoid mark-array allocation for groupless regex patterns (GH-150719)
...
state_init() always did PyMem_New(state->mark, groups*2), which for a
pattern with no capturing groups is PyMem_Malloc(0) -- a real allocation
(plus matching free) on every match/search/fullmatch call, for an array
that is never read: groupless patterns emit no MARK opcodes and group 0's
span is taken from state->start/ptr.
Guard the allocation with `if (pattern->groups)`. state->mark stays NULL
(set by the preceding memset), and both the error path and state_fini
already PyMem_Free(NULL) safely.
2026-06-02 10:45:30 +03:00
..
2026-05-15 13:25:09 +02:00
2026-06-01 13:41:21 -05:00
2026-05-15 14:42:30 +02:00
2026-06-01 13:01:57 +00:00
2026-05-24 16:16:12 +03:00
2026-05-26 01:37:14 +01:00
2026-05-24 15:02:58 +03:00
2026-06-02 10:45:30 +03:00
2026-03-25 07:44:47 +01:00
2026-05-26 00:03:06 +09:00
2026-05-28 12:27:37 +01:00
2026-05-24 16:16:12 +03:00
2026-04-09 08:52:30 +01:00
2026-05-24 15:03:22 +03:00
2026-05-24 16:16:12 +03:00
2026-05-31 07:29:44 +00:00
2026-05-14 01:21:03 +02:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-06-01 16:26:49 +03:00
2026-04-11 15:18:02 -07:00
2026-05-24 15:02:12 +03:00
2026-05-24 15:02:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-27 13:23:28 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-17 13:09:19 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-03-24 17:47:55 +00:00
2026-04-07 22:56:19 +02:00
2026-05-28 08:05:03 -07:00
2026-05-24 16:16:12 +03:00
2026-04-02 23:20:13 +02:00
2026-06-01 17:32:13 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-18 18:39:54 +03:00
2026-05-03 20:20:51 +00:00
2026-04-15 15:59:02 +02:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-03-26 15:26:34 +01:00
2026-05-06 17:39:30 -04:00
2026-03-17 12:16:35 +02:00
2026-05-22 21:47:32 +02:00
2026-05-05 09:18:04 +02:00
2026-05-24 16:16:12 +03:00
2026-04-08 09:15:11 +02:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-23 00:04:51 +02:00
2026-04-04 13:29:17 +01:00
2026-06-01 11:57:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-12 22:46:46 +03:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-03-09 19:37:33 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-24 16:16:12 +03:00
2026-04-02 23:20:13 +02:00
2026-03-24 17:47:55 +00:00
2026-05-31 07:29:44 +00:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-24 15:04:01 +03:00
2026-03-24 17:47:55 +00:00
2026-05-30 00:23:32 +03:00
2026-05-30 19:26:05 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-13 18:35:50 +02:00
2026-05-13 18:35:50 +02:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-30 16:25:40 +00:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00
2026-05-26 01:37:14 +01:00
2026-02-21 18:27:55 +01:00
2026-05-24 16:17:38 +00:00
2026-02-18 12:58:21 +02:00
2026-05-13 18:35:50 +02:00
2026-05-13 18:35:50 +02:00
2026-05-13 18:35:50 +02:00
2026-03-24 17:47:55 +00:00
2026-03-24 17:47:55 +00:00
2026-05-24 16:16:12 +03:00