Re: [RFC] Common object property boards - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [RFC] Common object property boards
Date
Msg-id 1312818787-sup-2773@alvh.no-ip.org
Whole thread Raw
In response to Re: [RFC] Common object property boards  (Kohei KaiGai <kaigai@kaigai.gr.jp>)
Responses Re: [RFC] Common object property boards
List pgsql-hackers
Excerpts from Kohei KaiGai's message of lun ago 08 03:12:20 -0400 2011:

> Thanks for your suggestion.
> So, it seems to me the interface should return a pointer to the entry
> of array being specified, rather than above approach.
> 
> E.g, the above macro could be probably rewritten as follows:
>   #define get_object_property_attnum_name(objtype) \
>       (get_object_property(objtype)->attnum_name)

I don't understand why don't you just do something like
  #define get_object_property_attnum_name(objtype, attnum_name_value) \      (get_object_property((objtype), NULL,
NULL,(attnum_name_value), NULL, NULL)))
 

and the caller does

AttrNumber    attnum_name;
get_object_property_attnum_name(OBJTYPE_TABLE, &attnum_name);

i.e. the caller must still pass pointers, instead of expecting the
values to be returned.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Yes, WaitLatch is vulnerable to weak-memory-ordering bugs
Next
From: Robert Haas
Date:
Subject: Re: [RFC] Common object property boards