From e12026251ae4817e73a41c00abb1bb6884a2b248 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Tue, 16 Jul 2024 11:15:39 +0300
Subject: [PATCH v2 2/2] rephrase docs paragraph

---
 doc/src/sgml/xfunc.sgml | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index f02a48ead4..7e92e89846 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -3619,21 +3619,20 @@ INJECTION_POINT(name);
     </para>
 
     <para>
-     An injection point with a given <literal>name</literal> can be loaded
-     using macro:
+     Executing an injection point can require allocating a small amount of
+     memory, which can fail. If you need to have an injection point in a
+     critical section where dynamic allocations are not allowed, you can use
+     a two-step approach with the following macros:
 <programlisting>
 INJECTION_POINT_LOAD(name);
-</programlisting>
-
-     This will load the injection point callback into the process cache,
-     doing all memory allocations at this stage without running the callback.
-     This is useful when an injection point is attached in a critical section
-     where no memory can be allocated: load the injection point outside the
-     critical section, then run it in the critical section directly from
-     the process cache:
-<programlisting>
 INJECTION_POINT_CACHED(name);
 </programlisting>
+
+     Before entering the critical section,
+     call <function>INJECTION_POINT_LOAD</function>. It checks the shared
+     memory state, and loads the callback into backend-private memory if it is
+     active. Inside the critical section, use
+     <function>INJECTION_POINT_CACHED</function> to execute the callback.
     </para>
 
     <para>
-- 
2.39.2

