Do not make "prop" field of struct dynamic_prop_list a pointer.

struct dynamic_prop_list is declared as follow:

    struct dynamic_prop_list
    {
      [...]
      /* The dynamic property itself.  */
      struct dynamic_prop *prop;
      [...]
    };

In this case, the pointer indirection is unnecessary and costing us,
for each dynamic property, the memory needed to store one pointer.
This patch removes this pointer indirection, savin us a tiny bit of
memory, as well as reduces a bit the complexity by removing the need
to allocate memory for the property, as the allocation is now part
of the struct itself.

gdb/ChangeLog:

        * gdbtypes.h (struct dynamic_prop_list) <prop>: Remove
        pointer indirection.
        * gdbtypes.c (get_dyn_prop): Adjust, following change above.
        (add_dyn_prop, copy_dynamic_prop_list): Likewise.

Tested on x86_64-linux.
This commit is contained in:
Joel Brobecker
2015-03-24 11:14:13 -07:00
parent 93a8e2276f
commit 283a99589a
3 changed files with 11 additions and 5 deletions

View File

@@ -449,7 +449,7 @@ struct dynamic_prop_list
enum dynamic_prop_node_kind prop_kind;
/* The dynamic property itself. */
struct dynamic_prop *prop;
struct dynamic_prop prop;
/* A pointer to the next dynamic property. */
struct dynamic_prop_list *next;