aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonpath_internal.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2024-12-02 10:35:37 +0100
committerPeter Eisentraut <peter@eisentraut.org>2024-12-24 18:05:06 +0100
commitdb6856c9913f1af08b5d7bde442fae362913190a (patch)
treee14b8b098387555ada5ba2534606c02c0ca14104 /src/backend/utils/adt/jsonpath_internal.h
parente4a8fb8fefb903fe601f7415098a4fe39a14069a (diff)
downloadpostgresql-db6856c9913f1af08b5d7bde442fae362913190a.tar.gz
postgresql-db6856c9913f1af08b5d7bde442fae362913190a.zip
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
Diffstat (limited to 'src/backend/utils/adt/jsonpath_internal.h')
0 files changed, 0 insertions, 0 deletions