blob: 4caa2df5f73db7dc3ce760b3491e6be3817f5d86 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstrad59c3892019-11-28 20:53:39 +01002 void garbage_collection()
3 void garbage_collection(string filename)
Zesstra715ec202025-07-09 22:18:31 +02004 void garbage_collection(string filename, int flag)
MG Mud User88f12472016-06-24 23:31:02 +02005
Zesstra715ec202025-07-09 22:18:31 +02006DESCRIPTION
7 Tell the parser to initiate a garbage collection after the
8 current execution ended. Depending on the type of memory
9 allocator used, this GC is more less thorough.
MG Mud User88f12472016-06-24 23:31:02 +020010
Zesstra715ec202025-07-09 22:18:31 +020011 If the 'smalloc' memory allocator is used, the GC produces
12 output to a log file. The default name of the log file is
13 specified at program start, but can be modified at runtime:
MG Mud User88f12472016-06-24 23:31:02 +020014
Zesstra715ec202025-07-09 22:18:31 +020015 With the <filename> argument a log file for the GC output
16 different from the default log file can be specified.
MG Mud User88f12472016-06-24 23:31:02 +020017
Zesstra715ec202025-07-09 22:18:31 +020018 If <flag> is not given or 0, the output from the next
19 and only the next GC will go into the log file. If the file
20 already exists, the new output will be appended.
Zesstrad59c3892019-11-28 20:53:39 +010021
Zesstra715ec202025-07-09 22:18:31 +020022 If <flag> is 1, the <filename> will be used as the new
23 default log file for all following GCs. If the file already
24 exists, it will be overwritten from the start.
Zesstrad59c3892019-11-28 20:53:39 +010025
Zesstra715ec202025-07-09 22:18:31 +020026 If a different memory allocator is used, the GC does not produce
27 output and the <filename> and <flag> arguments are ignored.
28
29 Calling this efun causes a privilege_violation.
30
31EXAMPLES
32 garbage_collection()
33 [ GC occurs -> logs into default file ]
34
35 garbage_collection("/GCLOG")
36 [ GC occurs -> logs into "/GCLOG" ]
37
38 garbage_collection("/GCLOG", 1)
39 [ GC occurs -> logs into "/GCLOG", sets default log to "/GCLOG" ]
40
41 garbage_collection("/GCLOG")
42 garbage_collection("/GCLOG2")
43 [ GC occurs -> logs into "/GCLOG" ]
44
45 garbage_collection("/GCLOG", 1)
46 garbage_collection("/GCLOG2")
47 [ GC occurs -> logs into "/GCLOG2", sets default log to "/GCLOG" ]
48
49HISTORY
50 LDMud 3.2.9 added the <filename> argument.
51 LDMud 3.3.209 added the <flag> argument.
52 LDMUd 3.5.0 made the efun privileged.
53
54SEE ALSO
Zesstrad59c3892019-11-28 20:53:39 +010055 rusage(E), valid_write(M), privilege_violation(M)