diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index acf6ff74f98..1c0f39e11ec 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -3628,7 +3628,7 @@ CREATE FUNCTION make_array(anyelement) RETURNS anyarray Add-ins can reserve shared memory on server startup. To do so, the add-in's shared library must be preloaded by specifying it in shared_preload_libraries. - The shared library should register callbacks in its + The shared library should register callbacks in its _PG_init function, which then get called at the right stages of the system startup to initialize the shared memory. Here is an example: @@ -3692,11 +3692,11 @@ my_shmem_init(void *arg) } - The request_fn callback is called during system + The shmem_request_fn callback is called during system startup, before the shared memory has been allocated. It should call ShmemRequestStruct() to register the add-in's shared memory needs. Note that ShmemRequestStruct() - doesn'' immediately allocate or initialize the memory, it merely + doesn't immediately allocate or initialize the memory, it merely registers the space to be allocated later in the startup sequence. When the memory is allocated, it is initialized to zero. To any more complex initialization, set the init_fn() callback, which @@ -3726,7 +3726,7 @@ my_shmem_init(void *arg) libraries that are not specified in shared_preload_libraries. However, after startup the allocation can fail if there is not enough - shared memory available. The system reserves a somes memory for + shared memory available. The system reserves some memory for allocations after startup, but that reservation is small. @@ -3739,8 +3739,8 @@ my_shmem_init(void *arg) When RegisterShmemCallbacks() is called after startup, it will immediately call the appropriate callbacks, depending on whether the requested memory areas were already initialized by - another backend. The callbacks will be held while holding an internal - lock, which prevents concurrent two backends from initializating the + another backend. The callbacks will be called while holding an internal + lock, which prevents multiple backends from initializating the memory area concurrently.