Minor spelling fix in memnodes.h

Started by Rafia Sabih3 months ago5 messages
#1Rafia Sabih
rafia.pghackers@gmail.com
1 attachment(s)

Hello,

Came across this spelling error alloced -> allocated.
Patch for the fix is attached.

--
Regards,
Rafia Sabih
CYBERTEC PostgreSQL International GmbH

Attachments:

spell_fix.patchapplication/octet-stream; name=spell_fix.patchDownload
diff --git a/src/include/nodes/memnodes.h b/src/include/nodes/memnodes.h
index 5807ef805bd..f8a78095eb9 100644
--- a/src/include/nodes/memnodes.h
+++ b/src/include/nodes/memnodes.h
@@ -120,7 +120,7 @@ typedef struct MemoryContextData
 
 	NodeTag		type;			/* identifies exact kind of context */
 	/* these two fields are placed here to minimize alignment wastage: */
-	bool		isReset;		/* T = no space alloced since last reset */
+	bool		isReset;		/* T = no space allocated since last reset */
 	bool		allowInCritSection; /* allow palloc in critical section */
 	Size		mem_allocated;	/* track memory allocated for this context */
 	const MemoryContextMethods *methods;	/* virtual function table */
#2David Rowley
dgrowleyml@gmail.com
In reply to: Rafia Sabih (#1)
Re: Minor spelling fix in memnodes.h

On Fri, 17 Oct 2025 at 20:39, Rafia Sabih <rafia.pghackers@gmail.com> wrote:

Came across this spelling error alloced -> allocated.
Patch for the fix is attached.

I suspect it is written as Tom intended it. The callback function in
MemoryContextMethods is called 'alloc' so I guess "alloced" is the
function name as a verb.

Maybe it's worth changing if there's confusion.

David

#3Daniel Gustafsson
daniel@yesql.se
In reply to: David Rowley (#2)
Re: Minor spelling fix in memnodes.h

On 17 Oct 2025, at 11:18, David Rowley <dgrowleyml@gmail.com> wrote:

On Fri, 17 Oct 2025 at 20:39, Rafia Sabih <rafia.pghackers@gmail.com> wrote:

Came across this spelling error alloced -> allocated.
Patch for the fix is attached.

I suspect it is written as Tom intended it.

+1, that was my conclusion as well. While I'm personally not a fan of the use,
there are more comments using it as well as variables and struct members.

--
Daniel Gustafsson

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Rowley (#2)
Re: Minor spelling fix in memnodes.h

David Rowley <dgrowleyml@gmail.com> writes:

On Fri, 17 Oct 2025 at 20:39, Rafia Sabih <rafia.pghackers@gmail.com> wrote:

Came across this spelling error alloced -> allocated.
Patch for the fix is attached.

I suspect it is written as Tom intended it. The callback function in
MemoryContextMethods is called 'alloc' so I guess "alloced" is the
function name as a verb.

Yeah, it's not a typo but an intentional abbreviation. Having said
that, I don't have any objection to changing it, especially since
there's now a use of "allocated" just two lines away.

I suspect that I shortened it to "alloced" in service of keeping the
comment on one line ... but it looks like it'd still fit if we added
the additional two characters.

regards, tom lane

#5David Rowley
dgrowleyml@gmail.com
In reply to: Tom Lane (#4)
Re: Minor spelling fix in memnodes.h

On Sat, 18 Oct 2025 at 03:37, Tom Lane <tgl@sss.pgh.pa.us> wrote:

David Rowley <dgrowleyml@gmail.com> writes:

I suspect it is written as Tom intended it. The callback function in
MemoryContextMethods is called 'alloc' so I guess "alloced" is the
function name as a verb.

Yeah, it's not a typo but an intentional abbreviation. Having said
that, I don't have any objection to changing it, especially since
there's now a use of "allocated" just two lines away.

Sounds good. I've pushed the patch.

David