NetworkManager/libnm-core
Thomas Haller 3f36f69156 libnm: refactor NMSettInfoProperty to save memory for simple properties
In total, we register 447 property informations. Out of these,
326 are plain, GObject property based without special implementations.

The NMSettInfoProperty had all function pointers directly embedded,
currently this amounts to 5 function pointers and the "dbus_type" field.

That means, at runtime we have 326 times trivial implementations with
waste 326*6*8 bytes of NULL pointers. We can compact these by moving
them to a separate structure.

Before:

    447 * 5 function pointers
    447 * "dbus_type" pointer
    = 2682 pointers

After:

    447 * 1 pointers (for NMSettInfoProperty.property_type)
     89 * 6 pointers (for the distinct NMSettInfoPropertType data)
    = 981 pointers

So, in total this saves 13608 byes of runtime memory (on 64 bit arch).

The 89 NMSettInfoPropertType instances are the remaining distinct instances.
Note that every NMSettInfoProperty has a "property_type" pointer, but most of them are
shared. That is because the underlying type and the operations are the same.

Also nice is that the NMSettInfoPropertType are actually constant,
static fields and initialized very early.

This change also makes sense form a design point of view. Previously,
NMSettInfoProperty contained both per-property data (the "name") but
also the behavior. Now, the "behavioral" part is moved to a separate
structure (where it is also shared). That means, the parts that are
concerned with the type of the property (the behavior) are separate
from the actual data of the property.
2019-09-30 08:23:19 +02:00
..
tests libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
meson.build libnm-core: add ovs-dpdk setting 2019-06-14 12:10:20 +02:00
nm-connection-private.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-connection.c setting-gsm: add auto-config property 2019-09-11 14:32:05 +02:00
nm-connection.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-core-enum-types.c.template libnm-core: add ovs-dpdk setting 2019-06-14 12:10:20 +02:00
nm-core-enum-types.h.template build: use template files for enum types' sources generation 2017-12-18 11:25:06 +01:00
nm-core-internal.h libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-core-types-internal.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-core-types.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto-gnutls.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto-impl.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto-nss.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-crypto.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-dbus-interface.h libnm: export reload flags 2019-09-17 09:30:18 +02:00
nm-dbus-utils.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-errors.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-errors.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-json.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-json.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-keyfile-internal.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-keyfile-utils.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-keyfile-utils.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-keyfile.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-property-compare.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-property-compare.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-6lowpan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-6lowpan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-8021x.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-8021x.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-adsl.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-adsl.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bluetooth.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bluetooth.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bond.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-bond.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bridge-port.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-bridge-port.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-bridge.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-bridge.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-cdma.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-cdma.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-connection.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-connection.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-dcb.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-dcb.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-dummy.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-dummy.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ethtool.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ethtool.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-generic.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-generic.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-gsm.c setting-gsm: allow empty apn property in verify() 2019-09-11 14:32:05 +02:00
nm-setting-gsm.h setting-gsm: add auto-config property 2019-09-11 14:32:05 +02:00
nm-setting-infiniband.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-infiniband.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip-config.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-ip-config.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip-tunnel.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip-tunnel.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip4-config.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-ip4-config.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ip6-config.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-ip6-config.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-macsec.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-macsec.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-macvlan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-macvlan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-match.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-match.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-olpc-mesh.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-olpc-mesh.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-bridge.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-bridge.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-dpdk.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-dpdk.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-interface.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-interface.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-patch.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-patch.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-port.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ovs-port.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ppp.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-ppp.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-pppoe.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-pppoe.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-private.h libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-proxy.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-proxy.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-serial.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-serial.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-sriov.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-sriov.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-tc-config.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-tc-config.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-team-port.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-team-port.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-team.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-team.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-tun.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-tun.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-user.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-user.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vlan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vlan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vpn.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-vpn.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vxlan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-vxlan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wifi-p2p.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wifi-p2p.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wimax.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wimax.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wired.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-wired.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wireguard.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting-wireguard.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wireless-security.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wireless-security.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wireless.c libnm-core: support SAE when determining AP compatibility 2019-09-20 13:18:18 +02:00
nm-setting-wireless.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wpan.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting-wpan.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-setting.c libnm: refactor NMSettInfoProperty to save memory for simple properties 2019-09-30 08:23:19 +02:00
nm-setting.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-simple-connection.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-simple-connection.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-team-utils.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-team-utils.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-utils-private.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-utils.c libnm: avoid heap allocation in _nm_utils_strdict_to_dbus() 2019-09-30 08:23:19 +02:00
nm-utils.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-version.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-dbus-interface.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-editor-plugin.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-editor-plugin.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-plugin-info.c all: SPDX header conversion 2019-09-10 11:19:56 +02:00
nm-vpn-plugin-info.h all: SPDX header conversion 2019-09-10 11:19:56 +02:00