postgresql/src
Peter Eisentraut db6856c991 syncrep parser: pure parser and reentrant scanner
Use the flex %option reentrant and the bison option %pure-parser to
make the generated scanner and parser pure, reentrant, and
thread-safe.

Make the generated scanner use palloc() etc. instead of malloc() etc.
Previously, we only used palloc() for the buffer, but flex would still
use malloc() for its internal structures.  Now, all the memory is
under palloc() control.

Simplify flex scan buffer management: Instead of constructing the
buffer from pieces and then using yy_scan_buffer(), we can just use
yy_scan_string(), which does the same thing internally.

The previous code was necessary because we allocated the buffer with
palloc() and the rest of the state was handled by malloc().  But this
is no longer the case; everything is under palloc() now.

Use flex yyextra to handle context information, instead of global
variables.  This complements the other changes to make the scanner
reentrant.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Discussion: https://www.postgresql.org/message-id/flat/eb6faeac-2a8a-4b69-9189-c33c520e5b7b@eisentraut.org
2024-12-24 18:05:06 +01:00
..
backend syncrep parser: pure parser and reentrant scanner 2024-12-24 18:05:06 +01:00
bin Remove pgrminclude annotations 2024-12-24 11:49:07 +01:00
common Fix outdated comment of scram_build_secret() 2024-12-10 12:54:09 +09:00
fe_utils Fix incorrect source filename references 2024-12-23 19:41:49 +13:00
include syncrep parser: pure parser and reentrant scanner 2024-12-24 18:05:06 +01:00
interfaces libpq: Add service name to PGconn and PQservice() 2024-12-18 14:53:42 +09:00
makefiles Use __attribute__((target(...))) for AVX-512 support. 2024-11-07 13:58:43 -06:00
pl Remove pgrminclude annotations 2024-12-24 11:49:07 +01:00
port Fix elog(FATAL) before PostmasterMain() or just after fork(). 2024-12-10 13:51:59 -08:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test Remove pg_attribute.attcacheoff column 2024-12-20 23:22:37 +13:00
timezone Update time zone data files to tzdata release 2024b. 2024-10-29 11:49:38 -04:00
tools Remove pgrminclude and associated scripts 2024-12-24 14:02:42 +01:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00