From 8d3f3ef815cf9012ad54a0e0bda21aed8e7afa33 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Fri, 2 Dec 2011 21:10:24 -0200 Subject: [PATCH] reorder struct fields to avoid holes, improving packing --- libkmod/libkmod-loaded.c | 4 ++-- libkmod/libkmod-module.c | 3 +-- libkmod/libkmod.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libkmod/libkmod-loaded.c b/libkmod/libkmod-loaded.c index 2679896..06f7f31 100644 --- a/libkmod/libkmod-loaded.c +++ b/libkmod/libkmod-loaded.c @@ -44,17 +44,17 @@ */ struct kmod_loaded { struct kmod_ctx *ctx; - int refcount; struct kmod_list *modules; + int refcount; bool parsed; }; struct kmod_loaded_module { char *name; long size; - int use_count; char *deps; uintptr_t addr; + int use_count; }; KMOD_EXPORT int kmod_loaded_new(struct kmod_ctx *ctx, struct kmod_loaded **mod) diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index 969d304..ac815b2 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -42,11 +42,10 @@ */ struct kmod_module { struct kmod_ctx *ctx; - int refcount; const char *path; const char *name; struct kmod_list *dep; - + int refcount; struct { bool dep : 1; } init; diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c index c9966e0..af784ea 100644 --- a/libkmod/libkmod.c +++ b/libkmod/libkmod.c @@ -47,12 +47,12 @@ */ struct kmod_ctx { int refcount; + int log_priority; void (*log_fn)(struct kmod_ctx *ctx, int priority, const char *file, int line, const char *fn, const char *format, va_list args); const void *userdata; char *dirname; - int log_priority; struct kmod_config config; }; -- 2.7.4