Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/regex/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if env["builtin_pcre2"]:
"pcre2_chartables.c",
"pcre2_chkdint.c",
"pcre2_compile.c",
"pcre2_compile_cgroup.c",
"pcre2_compile_class.c",
"pcre2_config.c",
"pcre2_context.c",
Expand All @@ -31,10 +32,10 @@ if env["builtin_pcre2"]:
"pcre2_extuni.c",
"pcre2_find_bracket.c",
"pcre2_jit_compile.c",
# "pcre2_jit_match.c", "pcre2_jit_misc.c", # Included in `pcre2_jit_compile.c`.
"pcre2_maketables.c",
"pcre2_match.c",
"pcre2_match_data.c",
"pcre2_match_next.c",
"pcre2_newline.c",
"pcre2_ord2utf.c",
"pcre2_pattern_info.c",
Expand All @@ -46,7 +47,6 @@ if env["builtin_pcre2"]:
"pcre2_substring.c",
"pcre2_tables.c",
"pcre2_ucd.c",
# "pcre2_ucptables.c", # Included in `pcre2_tables.c`.
"pcre2_valid_utf.c",
"pcre2_xclass.c",
]
Expand Down
11 changes: 6 additions & 5 deletions thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -890,19 +890,20 @@ Exclude:
Additional:
- Update `openxrLoaderVersion` in `platform/android/java/app/config.gradle`


## pcre2

- Upstream: http://www.pcre.org
- Version: 10.45 (2dce7761b1831fd3f82a9c2bd5476259d945da4d, 2025)
- Version: 10.47 (f454e231fe5006dd7ff8f4693fd2b8eb94333429, 2025)
- License: BSD-3-Clause

Files extracted from upstream source:

- Files listed in the file `NON-AUTOTOOLS-BUILD` steps 1-4
- All `.h` files in `src/` apart from `pcre2posix.h`
- `src/pcre2_jit_match.c`
- `src/pcre2_jit_misc.c`
- `src/pcre2_ucptables.c`
- All `.h` files in `src/` apart from `pcre2posix.h`, `pcre2_printint_inc.h`, `pcre2test_inc.h`
- `src/pcre2_compile_cgroup.c`
- `src/pcre2_match_next.c`
- `src/pcre2_{jit_char,jit_match,jit_misc,jit_simd,ucptables}_inc.h`
- `deps/sljit/sljit_src`
- `AUTHORS.md` and `LICENCE.md`

Expand Down
16 changes: 12 additions & 4 deletions thirdparty/pcre2/AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PCRE2 Authorship and Contributors
=================================

COPYRIGHT
Copyright
---------

Please see the file [LICENCE](./LICENCE.md) in the PCRE2 distribution for
copyright details.


MAINTAINERS
Maintainers
-----------

The PCRE and PCRE2 libraries were authored and maintained by Philip Hazel.
Expand Down Expand Up @@ -62,7 +62,7 @@ Both administrators are volunteers acting in a personal capacity.
</table>


CONTRIBUTORS
Contributors
------------

Many others have participated and contributed to PCRE2 over its history.
Expand All @@ -77,7 +77,7 @@ All names listed alphabetically.

### Contributors to PCRE2

This list includes names up until the PCRE2 10.44 release. New names will be
This list includes names up until the PCRE2 10.47 release. New names will be
added from the Git history on each release.

Scott Bell
Expand All @@ -93,13 +93,16 @@ added from the Git history on each release.
Addison Crump
Alex Dowad
Daniel Engberg
Marco Feuerstein
Daniel Richard G
Isaac Oscar Gariano
David Gaussmann
Andrey Gorbachev
Jordan Griege
Jason Hood
Bumsu Hyeon
Roy Ivy
Nobuhiro Iwamatsu
Martin Joerg
Guillem Jover
Ralf Junker
Expand All @@ -114,13 +117,17 @@ added from the Git history on each release.
Kai Lu
Behzod Mansurov
B. Scott Michel
Greg Minshall
Nathan Moinvaziri
Mike Munday
Marc Mutz
Fabio Pagani
Christian Persch
Alex Reinking
Joshua Rogers
Tristan Ross
William A Rowe Jr
Rocco Ruscitti
David Seifert
Yaakov Selkowitz
Rich Siegel
Expand All @@ -131,6 +138,7 @@ added from the Git history on each release.
Greg Thain
Lucas Trzesniewski
Theodore Tsirpanis
Aaron M. Ucko
Matthew Vernon
Rémi Verschelde
Thomas Voss
Expand Down
9 changes: 5 additions & 4 deletions thirdparty/pcre2/LICENCE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PCRE2 License
PCRE2 Licence
=============

| SPDX-License-Identifier: | BSD-3-Clause WITH PCRE2-exception |
Expand All @@ -16,7 +16,8 @@ testdata directory is not copyrighted and is in the public domain.
The basic library functions are written in C and are freestanding. Also
included in the distribution is a just-in-time compiler that can be used to
optimize pattern matching. This is an optional feature that can be omitted when
the library is built.
the library is built. The just-in-time compiler is separately licensed under the
"2-clause BSD" licence.


COPYRIGHT
Expand Down Expand Up @@ -53,6 +54,8 @@ COPYRIGHT
Copyright (c) 2009-2024 Zoltan Herczeg
All rights reserved.

The code in the `deps/sljit` directory has its own LICENSE file.

### All other contributions

Many other contributors have participated in the authorship of PCRE2. As PCRE2
Expand Down Expand Up @@ -99,5 +102,3 @@ not apply all the way down a chain of software. If binary package A includes
PCRE2, it must respect the condition, but if package B is software that
includes package A, the condition is not imposed on package B unless it uses
PCRE2 independently.

End
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
n - The size of the previous block.

Using these size values we can go forward or backward on the block chain.
The unused blocks are stored in a chain list pointed by free_blocks. This
list is useful if we need to find a suitable memory area when the allocator
is called.
The unused blocks are stored in a chain list pointed by sljit_free_blocks.
This list is useful if we need to find a suitable memory area when the
allocator is called.

When a block is freed, the new free block is connected to its adjacent free
blocks if possible.
Expand Down Expand Up @@ -115,20 +115,20 @@ struct free_block {
#define ALIGN_SIZE(size) (((size) + sizeof(struct block_header) + 7u) & ~(sljit_uw)7)
#define CHUNK_EXTRA_SIZE (sizeof(struct block_header) + CHUNK_HEADER_SIZE)

static struct free_block* free_blocks;
static sljit_uw allocated_size;
static sljit_uw total_size;
static struct free_block* sljit_free_blocks;
static sljit_uw sljit_allocated_size;
static sljit_uw sljit_total_size;

static SLJIT_INLINE void sljit_insert_free_block(struct free_block *free_block, sljit_uw size)
{
free_block->header.size = 0;
free_block->size = size;

free_block->next = free_blocks;
free_block->next = sljit_free_blocks;
free_block->prev = NULL;
if (free_blocks)
free_blocks->prev = free_block;
free_blocks = free_block;
if (sljit_free_blocks)
sljit_free_blocks->prev = free_block;
sljit_free_blocks = free_block;
}

static SLJIT_INLINE void sljit_remove_free_block(struct free_block *free_block)
Expand All @@ -139,8 +139,8 @@ static SLJIT_INLINE void sljit_remove_free_block(struct free_block *free_block)
if (free_block->prev)
free_block->prev->next = free_block->next;
else {
SLJIT_ASSERT(free_blocks == free_block);
free_blocks = free_block->next;
SLJIT_ASSERT(sljit_free_blocks == free_block);
sljit_free_blocks = free_block->next;
}
}

Expand All @@ -166,7 +166,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size)
size = ALIGN_SIZE(size);

SLJIT_ALLOCATOR_LOCK();
free_block = free_blocks;
free_block = sljit_free_blocks;
while (free_block) {
if (free_block->size >= size) {
chunk_size = free_block->size;
Expand All @@ -186,7 +186,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size)
header = (struct block_header*)free_block;
size = chunk_size;
}
allocated_size += size;
sljit_allocated_size += size;
header->size = size;
SLJIT_ALLOCATOR_UNLOCK();
return MEM_START(header);
Expand All @@ -207,7 +207,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size)
#endif /* SLJIT_HAS_EXECUTABLE_OFFSET */

chunk_size -= CHUNK_EXTRA_SIZE;
total_size += chunk_size;
sljit_total_size += chunk_size;

header = (struct block_header*)(((sljit_u8*)chunk_header) + CHUNK_HEADER_SIZE);

Expand All @@ -218,7 +218,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size)

if (chunk_size > size + 64) {
/* Cut the allocated space into a free and a used block. */
allocated_size += size;
sljit_allocated_size += size;
header->size = size;
chunk_size -= size;

Expand All @@ -231,7 +231,7 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_malloc_exec(sljit_uw size)
next_header = AS_BLOCK_HEADER(free_block, chunk_size);
} else {
/* All space belongs to this allocation. */
allocated_size += chunk_size;
sljit_allocated_size += chunk_size;
header->size = chunk_size;
next_header = AS_BLOCK_HEADER(header, chunk_size);
}
Expand All @@ -254,7 +254,7 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void *ptr)
#ifdef SLJIT_HAS_EXECUTABLE_OFFSET
header = AS_BLOCK_HEADER(header, -header->executable_offset);
#endif /* SLJIT_HAS_EXECUTABLE_OFFSET */
allocated_size -= header->size;
sljit_allocated_size -= header->size;

SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 0);

Expand Down Expand Up @@ -282,9 +282,9 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void *ptr)

/* The whole chunk is free. */
if (SLJIT_UNLIKELY(!free_block->header.prev_size && header->size == 1)) {
/* If this block is freed, we still have (allocated_size / 2) free space. */
if (total_size - free_block->size > (allocated_size * 3 / 2)) {
total_size -= free_block->size;
/* If this block is freed, we still have (sljit_allocated_size / 2) free space. */
if (sljit_total_size - free_block->size > (sljit_allocated_size * 3 / 2)) {
sljit_total_size -= free_block->size;
sljit_remove_free_block(free_block);
free_chunk(free_block, free_block->size + CHUNK_EXTRA_SIZE);
}
Expand All @@ -302,19 +302,19 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void)
SLJIT_ALLOCATOR_LOCK();
SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 0);

free_block = free_blocks;
free_block = sljit_free_blocks;
while (free_block) {
next_free_block = free_block->next;
if (!free_block->header.prev_size &&
AS_BLOCK_HEADER(free_block, free_block->size)->size == 1) {
total_size -= free_block->size;
sljit_total_size -= free_block->size;
sljit_remove_free_block(free_block);
free_chunk(free_block, free_block->size + CHUNK_EXTRA_SIZE);
}
free_block = next_free_block;
}

SLJIT_ASSERT(total_size || (!total_size && !free_blocks));
SLJIT_ASSERT(sljit_total_size || (!sljit_total_size && !sljit_free_blocks));
SLJIT_UPDATE_WX_FLAGS(NULL, NULL, 1);
SLJIT_ALLOCATOR_UNLOCK();
}
Expand Down
Loading