mirror of
https://github.com/postgres/postgres.git
synced 2025-09-09 13:09:39 +03:00
Assorted examples of expanded type-safer palloc/pg_malloc API
This adds some uses of the new palloc/pg_malloc variants here and there as a demonstration and test. This is kept separate from the actual API patch, since the latter might be backpatched at some point. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/bb755632-2a43-d523-36f8-a1e7a389a907@enterprisedb.com
This commit is contained in:
@@ -59,7 +59,7 @@ get_controlfile(const char *DataDir, bool *crc_ok_p)
|
||||
|
||||
AssertArg(crc_ok_p);
|
||||
|
||||
ControlFile = palloc(sizeof(ControlFileData));
|
||||
ControlFile = palloc_object(ControlFileData);
|
||||
snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir);
|
||||
|
||||
#ifndef FRONTEND
|
||||
|
Reference in New Issue
Block a user