logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

memory-handling - Golf documentation (memory)

Description

Golf is a memory-safe language. Your application cannot access memory outside of valid statement results. Trying to do so will result in your program erroringout. Memory allocated by Golf statements is tracked and freed at the end of the request. With Golf there is no need to free memory manually. Memory is automatically freed even if it is no longer accessible to the program, thus preventing memory leaks; this is important for stability of long-running processes. Some statements (new-tree, new-hash, new-list, new-array and set-string) have the option of allocating memory that won't get freed at the end of the request and is available to any request served by the same process. This kind of memory is called "process-scoped". A process-scoped string can be manually freed. Golf handles memory references and assignments automatically, preventing dangling memory. String results of any Golf statements will always create new memory, unless stated otherwise. OPENFILEDESCRIPTORS Any files opened by open-file statement are automatically closed by Golf at the end of the request. This enhances stability of long-running server processes because Linux system by default offers only about 1000 open files to a process. A bug can quickly exhaust this pool and cause a malfunction or a crash - Golf prevents this by closing any such open files when the request ends.

Name

memory-handling - Golf documentation (memory)

See Also

Memory memory-handling See all documentation $DATE $VERSION GOLF(2gg)

See Also