[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, master, updated. gawk-4.1.0-4850-g4b1b9a15
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, master, updated. gawk-4.1.0-4850-g4b1b9a15 |
Date: |
Wed, 10 Aug 2022 11:28:20 -0400 (EDT) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, master has been updated
via 4b1b9a159a1661ba399a642af72ad6f41eaca7d3 (commit)
via ee9168d7a3f9c647e0e979f91694bf9ca80fb4c3 (commit)
via 46864a93a1ee43c7f7e5b6387c8dc65e07af9f4a (commit)
via b4eaca4a9e20e9fb8d4a3ce02c2f30b62233c68f (commit)
via 0b6a9c21b1db2c898a71c774bb8185d669dc71ec (commit)
via 5e42bf53908fcbf2f57077dcb3afedc00b99bcd9 (commit)
via 159ba4af53537c86017581388dbd35314afe148d (commit)
via e9ab318acdf924c41aaa9d5669061c9511d3e75a (commit)
via 78a6c6cea8d2fb90ba28800cb27cdf799378f0dc (commit)
from d2af5c05a2ae0cd80841f58266fc036e6d9afec0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=4b1b9a159a1661ba399a642af72ad6f41eaca7d3
commit 4b1b9a159a1661ba399a642af72ad6f41eaca7d3
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Aug 10 18:27:28 2022 +0300
Make user-defined functions be persistent also.
diff --git a/ChangeLog b/ChangeLog
index da347645..213245a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-08-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * symbol.c (init_the_tables): New function.
+ (init_symbol_table): Reword to make functions persistent also
+ by saving in the root pointer a struct pointing to both the
+ global table and the function table, and restoring this
+ on subsequent runs. The code ended up being nicely cleaner.
+
2022-08-08 Arnold D. Robbins <arnold@skeeve.com>
* awk.h: Include "floatmagic.h" here so that we no longer have to
diff --git a/NEWS b/NEWS
index a5b328f2..f643e276 100644
--- a/NEWS
+++ b/NEWS
@@ -47,9 +47,9 @@ Wherever possible, details were replaced with references to
the online
copy of the manual.
10. Gawk now supports Terence Kelly's "persistent malloc" (pma),
-allowing gawk to preserve the contents of its variables and arrays
-between runs. THIS IS AN EXPERIMENTAL FEATURE! For more information,
-see the manual.
+allowing gawk to preserve its variables, arrays and user-defined
+functions between runs. THIS IS AN EXPERIMENTAL FEATURE!
+For more information, see the manual.
11. Support for OS/2 has been removed. It was not being actively
maintained.
@@ -60,6 +60,9 @@ being actively maintained.
13. Some subtle issues with untyped array elements being passed to
functions have been fixed.
+14. There have been numerous minor code cleanups and bug fixes. See the
+ ChangeLog for details.
+
Changes from 5.1.1 to 5.1.x
---------------------------
diff --git a/doc/ChangeLog b/doc/ChangeLog
index f0240d62..945ed842 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2022-08-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Persistent Memory): Document (extremely briefly)
+ that user-defined functions are also persistent.
+
2022-08-07 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: For `gawk --version' output, unwrap the result,
diff --git a/doc/gawk.info b/doc/gawk.info
index b2ba514c..1c3c6d3f 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -22139,10 +22139,10 @@ File: gawk.info, Node: Persistent Memory, Next:
Extension Philosophy, Prev: P
=================================
Starting with version 5.2, 'gawk' supports "persistent memory". This
-experimental feature stores the values of all of 'gawk''s variables and
-arrays in a persistent heap, which resides in a file in the filesystem.
-When persistent memory is not in use (the normal case), 'gawk''s data
-resides in ephemeral system memory.
+experimental feature stores the values of all of 'gawk''s variables,
+arrays and user-defined functions in a persistent heap, which resides in
+a file in the filesystem. When persistent memory is not in use (the
+normal case), 'gawk''s data resides in ephemeral system memory.
Persistent memory is enabled on certain 64-bit systems supporting the
'mmap()' and 'munmap()' system calls. 'gawk' must be compiled as a
@@ -22196,9 +22196,9 @@ for you.
Interestingly, the program that you execute need not be the same from
run to run; the persistent store only maintains the values of variables
-and arrays, not the totality of 'gawk''s internal state. This lets you
-share data between unrelated programs, eliminating the need for scripts
-to communicate via text files.
+arrays and user-defined functions, not the totality of 'gawk''s internal
+state. This lets you share data between unrelated programs, eliminating
+the need for scripts to communicate via text files.
Terence Kelly, the author of the persistent memory allocator 'gawk'
uses, provides the following advice about the backing file:
@@ -22286,6 +22286,9 @@ fatal error message instructing the user to use the
'GAWK_PERSIST_FILE'
environment variable instead. Except for this paragraph, that option is
otherwise undocumented.
+ The prototype only supported persistent data; it did not support
+persistent functions.
+
As noted earlier, support for persistent memory is _experimental_.
If it becomes burdensome,(1) then the feature will be removed.
@@ -39562,244 +39565,244 @@ Ref: Two-way I/O-Footnote-2884578
Node: TCP/IP Networking884660
Node: Profiling887736
Node: Persistent Memory897042
-Ref: Persistent Memory-Footnote-1904521
-Node: Extension Philosophy904648
-Node: Advanced Features Summary906135
-Node: Internationalization908307
-Node: I18N and L10N909981
-Node: Explaining gettext910668
-Ref: Explaining gettext-Footnote-1916560
-Ref: Explaining gettext-Footnote-2916745
-Node: Programmer i18n916910
-Ref: Programmer i18n-Footnote-1921859
-Node: Translator i18n921908
-Node: String Extraction922702
-Ref: String Extraction-Footnote-1923834
-Node: Printf Ordering923920
-Ref: Printf Ordering-Footnote-1926706
-Node: I18N Portability926770
-Ref: I18N Portability-Footnote-1929226
-Node: I18N Example929289
-Ref: I18N Example-Footnote-1932564
-Ref: I18N Example-Footnote-2932637
-Node: Gawk I18N932746
-Node: I18N Summary933368
-Node: Debugger934709
-Node: Debugging935709
-Node: Debugging Concepts936150
-Node: Debugging Terms937959
-Node: Awk Debugging940534
-Ref: Awk Debugging-Footnote-1941479
-Node: Sample Debugging Session941611
-Node: Debugger Invocation942145
-Node: Finding The Bug943531
-Node: List of Debugger Commands950005
-Node: Breakpoint Control951338
-Node: Debugger Execution Control955032
-Node: Viewing And Changing Data958394
-Node: Execution Stack961935
-Node: Debugger Info963572
-Node: Miscellaneous Debugger Commands967643
-Node: Readline Support972705
-Node: Limitations973601
-Node: Debugging Summary976155
-Node: Namespaces977434
-Node: Global Namespace978545
-Node: Qualified Names979943
-Node: Default Namespace980942
-Node: Changing The Namespace981683
-Node: Naming Rules983297
-Node: Internal Name Management985145
-Node: Namespace Example986187
-Node: Namespace And Features988749
-Node: Namespace Summary990184
-Node: Arbitrary Precision Arithmetic991661
-Node: Computer Arithmetic993148
-Ref: table-numeric-ranges996914
-Ref: table-floating-point-ranges997408
-Ref: Computer Arithmetic-Footnote-1998067
-Node: Math Definitions998124
-Ref: table-ieee-formats1001100
-Node: MPFR features1001668
-Node: MPFR On Parole1002113
-Ref: MPFR On Parole-Footnote-11002942
-Node: MPFR Intro1003097
-Node: FP Math Caution1004748
-Ref: FP Math Caution-Footnote-11005820
-Node: Inexactness of computations1006189
-Node: Inexact representation1007220
-Node: Comparing FP Values1008580
-Node: Errors accumulate1009821
-Node: Strange values1011277
-Ref: Strange values-Footnote-11013865
-Node: Getting Accuracy1013970
-Node: Try To Round1016680
-Node: Setting precision1017579
-Ref: table-predefined-precision-strings1018276
-Node: Setting the rounding mode1020107
-Ref: table-gawk-rounding-modes1020481
-Ref: Setting the rounding mode-Footnote-11024413
-Node: Arbitrary Precision Integers1024592
-Ref: Arbitrary Precision Integers-Footnote-11027767
-Node: Checking for MPFR1027916
-Node: POSIX Floating Point Problems1029390
-Ref: POSIX Floating Point Problems-Footnote-11034043
-Node: Floating point summary1034081
-Node: Dynamic Extensions1036271
-Node: Extension Intro1037824
-Node: Plugin License1039090
-Node: Extension Mechanism Outline1039887
-Ref: figure-load-extension1040326
-Ref: figure-register-new-function1041892
-Ref: figure-call-new-function1042985
-Node: Extension API Description1045048
-Node: Extension API Functions Introduction1046761
-Ref: table-api-std-headers1048597
-Node: General Data Types1052847
-Ref: General Data Types-Footnote-11061553
-Node: Memory Allocation Functions1061852
-Ref: Memory Allocation Functions-Footnote-11066353
-Node: Constructor Functions1066452
-Node: API Ownership of MPFR and GMP Values1070105
-Node: Registration Functions1071638
-Node: Extension Functions1072338
-Node: Exit Callback Functions1077660
-Node: Extension Version String1078910
-Node: Input Parsers1079573
-Node: Output Wrappers1092294
-Node: Two-way processors1096806
-Node: Printing Messages1099071
-Ref: Printing Messages-Footnote-11100242
-Node: Updating ERRNO1100395
-Node: Requesting Values1101134
-Ref: table-value-types-returned1101871
-Node: Accessing Parameters1102980
-Node: Symbol Table Access1104217
-Node: Symbol table by name1104729
-Ref: Symbol table by name-Footnote-11107754
-Node: Symbol table by cookie1107882
-Ref: Symbol table by cookie-Footnote-11112067
-Node: Cached values1112131
-Ref: Cached values-Footnote-11115667
-Node: Array Manipulation1115820
-Ref: Array Manipulation-Footnote-11116911
-Node: Array Data Types1116948
-Ref: Array Data Types-Footnote-11119606
-Node: Array Functions1119698
-Node: Flattening Arrays1124483
-Node: Creating Arrays1131459
-Node: Redirection API1136226
-Node: Extension API Variables1139059
-Node: Extension Versioning1139770
-Ref: gawk-api-version1140199
-Node: Extension GMP/MPFR Versioning1141931
-Node: Extension API Informational Variables1143559
-Node: Extension API Boilerplate1144632
-Node: Changes from API V11148606
-Node: Finding Extensions1150178
-Node: Extension Example1150737
-Node: Internal File Description1151535
-Node: Internal File Ops1155615
-Ref: Internal File Ops-Footnote-11166965
-Node: Using Internal File Ops1167105
-Ref: Using Internal File Ops-Footnote-11169488
-Node: Extension Samples1169762
-Node: Extension Sample File Functions1171291
-Node: Extension Sample Fnmatch1178940
-Node: Extension Sample Fork1180427
-Node: Extension Sample Inplace1181645
-Node: Extension Sample Ord1185271
-Node: Extension Sample Readdir1186107
-Ref: table-readdir-file-types1186996
-Node: Extension Sample Revout1188064
-Node: Extension Sample Rev2way1188653
-Node: Extension Sample Read write array1189393
-Node: Extension Sample Readfile1192558
-Node: Extension Sample Time1193653
-Node: Extension Sample API Tests1195405
-Node: gawkextlib1195897
-Node: Extension summary1198815
-Node: Extension Exercises1202517
-Node: Language History1203759
-Node: V7/SVR3.11205415
-Node: SVR41207567
-Node: POSIX1209001
-Node: BTL1210382
-Node: POSIX/GNU1211111
-Node: Feature History1217017
-Node: Common Extensions1234756
-Node: Ranges and Locales1236039
-Ref: Ranges and Locales-Footnote-11240655
-Ref: Ranges and Locales-Footnote-21240682
-Ref: Ranges and Locales-Footnote-31240917
-Node: Contributors1241140
-Node: History summary1247137
-Node: Installation1248517
-Node: Gawk Distribution1249461
-Node: Getting1249945
-Node: Extracting1250908
-Node: Distribution contents1252546
-Node: Unix Installation1259607
-Node: Quick Installation1260411
-Node: Compiling with MPFR1262831
-Node: Shell Startup Files1263521
-Node: Additional Configuration Options1264610
-Node: Configuration Philosophy1266925
-Node: Compiling from Git1269321
-Node: Building the Documentation1269876
-Node: Non-Unix Installation1271260
-Node: PC Installation1271720
-Node: PC Binary Installation1272561
-Node: PC Compiling1273434
-Node: PC Using1274540
-Node: Cygwin1278036
-Node: MSYS1279260
-Node: VMS Installation1279862
-Node: VMS Compilation1280581
-Ref: VMS Compilation-Footnote-11281810
-Node: VMS Dynamic Extensions1281868
-Node: VMS Installation Details1283553
-Node: VMS Running1285815
-Node: VMS GNV1290094
-Node: Bugs1290808
-Node: Bug definition1291720
-Node: Bug address1294656
-Node: Usenet1297844
-Node: Performance bugs1299033
-Node: Asking for help1301954
-Node: Maintainers1303921
-Node: Other Versions1304928
-Node: Installation summary1313198
-Node: Notes1314555
-Node: Compatibility Mode1315349
-Node: Additions1316131
-Node: Accessing The Source1317056
-Node: Adding Code1318493
-Node: New Ports1325308
-Node: Derived Files1329683
-Ref: Derived Files-Footnote-11335343
-Ref: Derived Files-Footnote-21335378
-Ref: Derived Files-Footnote-31335976
-Node: Future Extensions1336090
-Node: Implementation Limitations1336748
-Node: Extension Design1337958
-Node: Old Extension Problems1339102
-Ref: Old Extension Problems-Footnote-11340620
-Node: Extension New Mechanism Goals1340677
-Ref: Extension New Mechanism Goals-Footnote-11344041
-Node: Extension Other Design Decisions1344230
-Node: Extension Future Growth1346343
-Node: Notes summary1346949
-Node: Basic Concepts1348107
-Node: Basic High Level1348788
-Ref: figure-general-flow1349070
-Ref: figure-process-flow1349756
-Ref: Basic High Level-Footnote-11353058
-Node: Basic Data Typing1353243
-Node: Glossary1356571
-Node: Copying1388458
-Node: GNU Free Documentation License1426001
-Node: Index1451121
+Ref: Persistent Memory-Footnote-1904660
+Node: Extension Philosophy904787
+Node: Advanced Features Summary906274
+Node: Internationalization908446
+Node: I18N and L10N910120
+Node: Explaining gettext910807
+Ref: Explaining gettext-Footnote-1916699
+Ref: Explaining gettext-Footnote-2916884
+Node: Programmer i18n917049
+Ref: Programmer i18n-Footnote-1921998
+Node: Translator i18n922047
+Node: String Extraction922841
+Ref: String Extraction-Footnote-1923973
+Node: Printf Ordering924059
+Ref: Printf Ordering-Footnote-1926845
+Node: I18N Portability926909
+Ref: I18N Portability-Footnote-1929365
+Node: I18N Example929428
+Ref: I18N Example-Footnote-1932703
+Ref: I18N Example-Footnote-2932776
+Node: Gawk I18N932885
+Node: I18N Summary933507
+Node: Debugger934848
+Node: Debugging935848
+Node: Debugging Concepts936289
+Node: Debugging Terms938098
+Node: Awk Debugging940673
+Ref: Awk Debugging-Footnote-1941618
+Node: Sample Debugging Session941750
+Node: Debugger Invocation942284
+Node: Finding The Bug943670
+Node: List of Debugger Commands950144
+Node: Breakpoint Control951477
+Node: Debugger Execution Control955171
+Node: Viewing And Changing Data958533
+Node: Execution Stack962074
+Node: Debugger Info963711
+Node: Miscellaneous Debugger Commands967782
+Node: Readline Support972844
+Node: Limitations973740
+Node: Debugging Summary976294
+Node: Namespaces977573
+Node: Global Namespace978684
+Node: Qualified Names980082
+Node: Default Namespace981081
+Node: Changing The Namespace981822
+Node: Naming Rules983436
+Node: Internal Name Management985284
+Node: Namespace Example986326
+Node: Namespace And Features988888
+Node: Namespace Summary990323
+Node: Arbitrary Precision Arithmetic991800
+Node: Computer Arithmetic993287
+Ref: table-numeric-ranges997053
+Ref: table-floating-point-ranges997547
+Ref: Computer Arithmetic-Footnote-1998206
+Node: Math Definitions998263
+Ref: table-ieee-formats1001239
+Node: MPFR features1001807
+Node: MPFR On Parole1002252
+Ref: MPFR On Parole-Footnote-11003081
+Node: MPFR Intro1003236
+Node: FP Math Caution1004887
+Ref: FP Math Caution-Footnote-11005959
+Node: Inexactness of computations1006328
+Node: Inexact representation1007359
+Node: Comparing FP Values1008719
+Node: Errors accumulate1009960
+Node: Strange values1011416
+Ref: Strange values-Footnote-11014004
+Node: Getting Accuracy1014109
+Node: Try To Round1016819
+Node: Setting precision1017718
+Ref: table-predefined-precision-strings1018415
+Node: Setting the rounding mode1020246
+Ref: table-gawk-rounding-modes1020620
+Ref: Setting the rounding mode-Footnote-11024552
+Node: Arbitrary Precision Integers1024731
+Ref: Arbitrary Precision Integers-Footnote-11027906
+Node: Checking for MPFR1028055
+Node: POSIX Floating Point Problems1029529
+Ref: POSIX Floating Point Problems-Footnote-11034182
+Node: Floating point summary1034220
+Node: Dynamic Extensions1036410
+Node: Extension Intro1037963
+Node: Plugin License1039229
+Node: Extension Mechanism Outline1040026
+Ref: figure-load-extension1040465
+Ref: figure-register-new-function1042031
+Ref: figure-call-new-function1043124
+Node: Extension API Description1045187
+Node: Extension API Functions Introduction1046900
+Ref: table-api-std-headers1048736
+Node: General Data Types1052986
+Ref: General Data Types-Footnote-11061692
+Node: Memory Allocation Functions1061991
+Ref: Memory Allocation Functions-Footnote-11066492
+Node: Constructor Functions1066591
+Node: API Ownership of MPFR and GMP Values1070244
+Node: Registration Functions1071777
+Node: Extension Functions1072477
+Node: Exit Callback Functions1077799
+Node: Extension Version String1079049
+Node: Input Parsers1079712
+Node: Output Wrappers1092433
+Node: Two-way processors1096945
+Node: Printing Messages1099210
+Ref: Printing Messages-Footnote-11100381
+Node: Updating ERRNO1100534
+Node: Requesting Values1101273
+Ref: table-value-types-returned1102010
+Node: Accessing Parameters1103119
+Node: Symbol Table Access1104356
+Node: Symbol table by name1104868
+Ref: Symbol table by name-Footnote-11107893
+Node: Symbol table by cookie1108021
+Ref: Symbol table by cookie-Footnote-11112206
+Node: Cached values1112270
+Ref: Cached values-Footnote-11115806
+Node: Array Manipulation1115959
+Ref: Array Manipulation-Footnote-11117050
+Node: Array Data Types1117087
+Ref: Array Data Types-Footnote-11119745
+Node: Array Functions1119837
+Node: Flattening Arrays1124622
+Node: Creating Arrays1131598
+Node: Redirection API1136365
+Node: Extension API Variables1139198
+Node: Extension Versioning1139909
+Ref: gawk-api-version1140338
+Node: Extension GMP/MPFR Versioning1142070
+Node: Extension API Informational Variables1143698
+Node: Extension API Boilerplate1144771
+Node: Changes from API V11148745
+Node: Finding Extensions1150317
+Node: Extension Example1150876
+Node: Internal File Description1151674
+Node: Internal File Ops1155754
+Ref: Internal File Ops-Footnote-11167104
+Node: Using Internal File Ops1167244
+Ref: Using Internal File Ops-Footnote-11169627
+Node: Extension Samples1169901
+Node: Extension Sample File Functions1171430
+Node: Extension Sample Fnmatch1179079
+Node: Extension Sample Fork1180566
+Node: Extension Sample Inplace1181784
+Node: Extension Sample Ord1185410
+Node: Extension Sample Readdir1186246
+Ref: table-readdir-file-types1187135
+Node: Extension Sample Revout1188203
+Node: Extension Sample Rev2way1188792
+Node: Extension Sample Read write array1189532
+Node: Extension Sample Readfile1192697
+Node: Extension Sample Time1193792
+Node: Extension Sample API Tests1195544
+Node: gawkextlib1196036
+Node: Extension summary1198954
+Node: Extension Exercises1202656
+Node: Language History1203898
+Node: V7/SVR3.11205554
+Node: SVR41207706
+Node: POSIX1209140
+Node: BTL1210521
+Node: POSIX/GNU1211250
+Node: Feature History1217156
+Node: Common Extensions1234895
+Node: Ranges and Locales1236178
+Ref: Ranges and Locales-Footnote-11240794
+Ref: Ranges and Locales-Footnote-21240821
+Ref: Ranges and Locales-Footnote-31241056
+Node: Contributors1241279
+Node: History summary1247276
+Node: Installation1248656
+Node: Gawk Distribution1249600
+Node: Getting1250084
+Node: Extracting1251047
+Node: Distribution contents1252685
+Node: Unix Installation1259746
+Node: Quick Installation1260550
+Node: Compiling with MPFR1262970
+Node: Shell Startup Files1263660
+Node: Additional Configuration Options1264749
+Node: Configuration Philosophy1267064
+Node: Compiling from Git1269460
+Node: Building the Documentation1270015
+Node: Non-Unix Installation1271399
+Node: PC Installation1271859
+Node: PC Binary Installation1272700
+Node: PC Compiling1273573
+Node: PC Using1274679
+Node: Cygwin1278175
+Node: MSYS1279399
+Node: VMS Installation1280001
+Node: VMS Compilation1280720
+Ref: VMS Compilation-Footnote-11281949
+Node: VMS Dynamic Extensions1282007
+Node: VMS Installation Details1283692
+Node: VMS Running1285954
+Node: VMS GNV1290233
+Node: Bugs1290947
+Node: Bug definition1291859
+Node: Bug address1294795
+Node: Usenet1297983
+Node: Performance bugs1299172
+Node: Asking for help1302093
+Node: Maintainers1304060
+Node: Other Versions1305067
+Node: Installation summary1313337
+Node: Notes1314694
+Node: Compatibility Mode1315488
+Node: Additions1316270
+Node: Accessing The Source1317195
+Node: Adding Code1318632
+Node: New Ports1325447
+Node: Derived Files1329822
+Ref: Derived Files-Footnote-11335482
+Ref: Derived Files-Footnote-21335517
+Ref: Derived Files-Footnote-31336115
+Node: Future Extensions1336229
+Node: Implementation Limitations1336887
+Node: Extension Design1338097
+Node: Old Extension Problems1339241
+Ref: Old Extension Problems-Footnote-11340759
+Node: Extension New Mechanism Goals1340816
+Ref: Extension New Mechanism Goals-Footnote-11344180
+Node: Extension Other Design Decisions1344369
+Node: Extension Future Growth1346482
+Node: Notes summary1347088
+Node: Basic Concepts1348246
+Node: Basic High Level1348927
+Ref: figure-general-flow1349209
+Ref: figure-process-flow1349895
+Ref: Basic High Level-Footnote-11353197
+Node: Basic Data Typing1353382
+Node: Glossary1356710
+Node: Copying1388597
+Node: GNU Free Documentation License1426140
+Node: Index1451260
End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index ea7ceb46..39036349 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -31038,8 +31038,8 @@ code, it will appear that way in the output.
Starting with @value{PVERSION} 5.2, @command{gawk} supports
@dfn{persistent memory}. This experimental feature stores the values of
-all of @command{gawk}'s variables and arrays in a persistent heap,
-which resides in a file in
+all of @command{gawk}'s variables, arrays and user-defined functions
+in a persistent heap, which resides in a file in
the filesystem. When persistent memory is not in use (the normal case),
@command{gawk}'s data resides in ephemeral system memory.
@@ -31079,7 +31079,6 @@ utility:
$ @kbd{truncate -s 4G data.pma}
@end example
-
@cindex @env{GAWK_PERSIST_FILE} environment variable
@cindex environment variables @subentry @env{GAWK_PERSIST_FILE}
@item
@@ -31112,7 +31111,7 @@ Only the variables defined by the program are preserved
across runs.
Interestingly, the program that you execute need not be the same from
run to run; the persistent store only maintains the values of variables
-and arrays, not the totality of @command{gawk}'s internal state.
+arrays and user-defined functions, not the totality of @command{gawk}'s
internal state.
This lets you share data between unrelated programs, eliminating
the need for scripts to communicate via text files.
@@ -31230,6 +31229,9 @@ it produces a fatal error message instructing the user
to use the
@env{GAWK_PERSIST_FILE} environment variable instead. Except for this
paragraph, that option is otherwise undocumented.
+The prototype only supported persistent data; it did not
+support persistent functions.
+
As noted earlier, support for persistent memory is @emph{experimental}.
If it becomes burdensome,@footnote{Meaning, there are too many
bug reports, or too many strange differences in behavior from when
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 07ef03f6..2955848f 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -29920,8 +29920,8 @@ code, it will appear that way in the output.
Starting with @value{PVERSION} 5.2, @command{gawk} supports
@dfn{persistent memory}. This experimental feature stores the values of
-all of @command{gawk}'s variables and arrays in a persistent heap,
-which resides in a file in
+all of @command{gawk}'s variables, arrays and user-defined functions
+in a persistent heap, which resides in a file in
the filesystem. When persistent memory is not in use (the normal case),
@command{gawk}'s data resides in ephemeral system memory.
@@ -29961,7 +29961,6 @@ utility:
$ @kbd{truncate -s 4G data.pma}
@end example
-
@cindex @env{GAWK_PERSIST_FILE} environment variable
@cindex environment variables @subentry @env{GAWK_PERSIST_FILE}
@item
@@ -29994,7 +29993,7 @@ Only the variables defined by the program are preserved
across runs.
Interestingly, the program that you execute need not be the same from
run to run; the persistent store only maintains the values of variables
-and arrays, not the totality of @command{gawk}'s internal state.
+arrays and user-defined functions, not the totality of @command{gawk}'s
internal state.
This lets you share data between unrelated programs, eliminating
the need for scripts to communicate via text files.
@@ -30112,6 +30111,9 @@ it produces a fatal error message instructing the user
to use the
@env{GAWK_PERSIST_FILE} environment variable instead. Except for this
paragraph, that option is otherwise undocumented.
+The prototype only supported persistent data; it did not
+support persistent functions.
+
As noted earlier, support for persistent memory is @emph{experimental}.
If it becomes burdensome,@footnote{Meaning, there are too many
bug reports, or too many strange differences in behavior from when
diff --git a/symbol.c b/symbol.c
index 0d10a520..8c6914fb 100644
--- a/symbol.c
+++ b/symbol.c
@@ -50,25 +50,14 @@ NODE *symbol_table, *func_table;
/* Use a flag to avoid a strcmp() call inside install() */
static bool installing_specials = false;
-/* init_symbol_table --- make sure the symbol tables are initialized */
+/* init_the_tables --- deal with the tables for in memory use */
-void
-init_symbol_table()
+static void
+init_the_tables(void)
{
- NODE *pma_root_node = NULL;
-
- if (using_persistent_malloc) {
- pma_root_node = (NODE *) pma_get_root();
- if (pma_root_node != NULL) {
- global_table = pma_root_node;
- }
- }
-
- if (global_table == NULL) {
- getnode(global_table);
- memset(global_table, '\0', sizeof(NODE));
- null_array(global_table);
- }
+ getnode(global_table);
+ memset(global_table, '\0', sizeof(NODE));
+ null_array(global_table);
getnode(param_table);
memset(param_table, '\0', sizeof(NODE));
@@ -76,16 +65,55 @@ init_symbol_table()
installing_specials = true;
func_table = install_symbol(estrdup("FUNCTAB", 7), Node_var_array);
+ symbol_table = install_symbol(estrdup("SYMTAB", 6), Node_var_array);
+ installing_specials = false;
+}
- if (using_persistent_malloc && pma_root_node != NULL)
- symbol_table = lookup("SYMTAB");
- else
- symbol_table = install_symbol(estrdup("SYMTAB", 6),
Node_var_array);
+/* init_symbol_table --- make sure the symbol tables are initialized */
- installing_specials = false;
+void
+init_symbol_table()
+{
+ if (! using_persistent_malloc) {
+ // normal case, initialize regularly, return
+ init_the_tables();
+ return;
+ }
+
+ // using persistent memory, get the root pointer
+ // which holds this struct:
+ struct root_pointers {
+ NODE *global_table;
+ NODE *func_table;
+ } *root_pointers = NULL;
+
+ root_pointers = (struct root_pointers *) pma_get_root();
- if (using_persistent_malloc && pma_root_node == 0)
- pma_set_root(global_table);
+ if (root_pointers == NULL) {
+ // very first time!
+
+ // set up the tables
+ init_the_tables();
+
+ // save the pointers for the next time.
+ emalloc(root_pointers, struct root_pointers *, sizeof(struct
root_pointers), "init_symbol_table");
+ root_pointers->global_table = global_table;
+ root_pointers->func_table = func_table;
+ pma_set_root(root_pointers);
+ } else {
+ // this is the next time, get the saved pointers and put them
back in place
+ global_table = root_pointers->global_table;
+ func_table = root_pointers->func_table;
+
+ // still need to set this one up as usual
+ getnode(param_table);
+ memset(param_table, '\0', sizeof(NODE));
+ null_array(param_table);
+
+ // set the global variables
+ symbol_table = lookup("SYMTAB");
+ func_table = lookup("FUNCTAB");
+ }
}
/*
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=ee9168d7a3f9c647e0e979f91694bf9ca80fb4c3
commit ee9168d7a3f9c647e0e979f91694bf9ca80fb4c3
Merge: 46864a93 b4eaca4a
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Aug 10 18:25:10 2022 +0300
Merge branch 'feature/docit'
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=46864a93a1ee43c7f7e5b6387c8dc65e07af9f4a
commit 46864a93a1ee43c7f7e5b6387c8dc65e07af9f4a
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Aug 10 18:18:22 2022 +0300
Small fix in README_d/README.pc.
diff --git a/README_d/ChangeLog b/README_d/ChangeLog
index a05027a4..328ef0f8 100644
--- a/README_d/ChangeLog
+++ b/README_d/ChangeLog
@@ -1,3 +1,7 @@
+2022-08-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * README.pc: Revise numbers of tests that can be expected to fail.
+
2022-08-06 John E. Malmberg <wb8tyw@qsl.net>
* README.VMS: VAX building and testing is dropped.
diff --git a/README_d/README.pc b/README_d/README.pc
index e67590cf..6755de31 100644
--- a/README_d/README.pc
+++ b/README_d/README.pc
@@ -61,9 +61,9 @@ their end-of-line markers converted, as described in
Makefile.tst.
One change you will have to make for testing the MinGW port using the
MSYS Bash is to set SLASH to //.
-Testing Gawk built with MPFR support should report 31 tests failed, and
+Testing Gawk built with MPFR support should report 30 tests failed, and
if your ls.exe doesn't produce inode numbers consistent with the readdir
-extension, you should see 32 failures. If you see more failures, you
+extension, you should see 31 failures. If you see more failures, you
should investigate the reasons.
It is routine to install by hand, but note that the install target also
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 +
NEWS | 9 +-
README_d/ChangeLog | 4 +
README_d/README.pc | 4 +-
doc/ChangeLog | 5 +
doc/gawk.info | 493 +++++++++++++++++++++++++++--------------------------
doc/gawk.texi | 10 +-
doc/gawktexi.in | 10 +-
doc/it/ChangeLog | 4 +
doc/it/gawktexi.in | 22 ++-
po/ChangeLog | 4 +
po/it.po | 413 ++++++++++++++++++++++----------------------
symbol.c | 76 ++++++---
13 files changed, 568 insertions(+), 494 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, master, updated. gawk-4.1.0-4850-g4b1b9a15,
Arnold Robbins <=