Do not make "prop" field of struct dynamic_prop_list a pointer.
authorJoel Brobecker <brobecker@adacore.com>
Tue, 24 Mar 2015 18:14:13 +0000 (11:14 -0700)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 24 Mar 2015 18:25:46 +0000 (11:25 -0700)
commit283a99589a0780a3b1fc011885b630bd9223ebba
tree6416ff1ce3ab2294060896c9232e51c7001ff761
parent93a8e2276fadd7dbb323d7cf4b082c33b32073d5
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.
gdb/ChangeLog
gdb/gdbtypes.c
gdb/gdbtypes.h
This page took 0.025983 seconds and 4 git commands to generate.