[asterisk-bugs] [JIRA] Created: (ASTERISK-20388) Named call pickup groups implementation improvements.

Matt Jordan (JIRA) noreply at issues.asterisk.org
Fri Sep 7 11:52:08 CDT 2012


Named call pickup groups implementation improvements.
-----------------------------------------------------

                 Key: ASTERISK-20388
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20388
             Project: Asterisk
          Issue Type: Improvement
      Security Level: None
          Components: Core/General
    Affects Versions: 11.0.0-beta1
            Reporter: Richard Mudgett


The implementation of the struct ast_namedgroups leaves something to be desired.  There are a lot of little allocations that do not need to be done.

1) The struct ast_namedgroups is opaque everywhere which is good.  However, inside the implementation methods, it could just simply be cast to a struct ao2_container pointer.

2) The struct namedgroup_entry could be redefined so the name does not have to be separately allocated:
{code}
struct namedgroup_entry {
  /*! pre-built hash of groupname string */
  int hash;
  /*! string representation of group (End allocation of name string.) */
  char name[1];
};
{code}
The struct also does not have to be publicly defined.

3) The ast_namedgroups_intersect() routine should iterate over the container with the fewer members.  The other container just looks up the members of the first container in O(1) time.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list