/* The container for objects stored in "struct attr_hashmap" */
struct attr_hash_entry {
- struct hashmap_entry ent; /* must be the first member! */
+ struct hashmap_entry ent;
const char *key; /* the key; memory should be owned by value */
size_t keylen; /* length of the key */
void *value; /* the stored value */
}
struct refname_hash_entry {
- struct hashmap_entry ent; /* must be the first member */
+ struct hashmap_entry ent;
struct object_id oid;
int ignore;
char refname[FLEX_ARRAY];
*
* struct hashmap map;
* struct long2string {
- * struct hashmap_entry ent; // must be the first member!
+ * struct hashmap_entry ent;
* long key;
* char value[FLEX_ARRAY]; // be careful with allocating on stack!
* };
/*
* struct hashmap_entry is an opaque structure representing an entry in the
- * hash table, which must be used as first member of user data structures.
+ * hash table.
* Ideally it should be followed by an int-sized member to prevent unused
* memory on 64-bit systems due to alignment.
*/
* in get_directory_renames() for details
*/
struct dir_rename_entry {
- struct hashmap_entry ent; /* must be the first member! */
+ struct hashmap_entry ent;
char *dir;
unsigned non_unique_new_dir:1;
struct strbuf new_dir;
};
struct collision_entry {
- struct hashmap_entry ent; /* must be the first member! */
+ struct hashmap_entry ent;
char *target_file;
struct string_list source_files;
unsigned reported_already:1;
} oi, oi_deref;
struct ref_to_worktree_entry {
- struct hashmap_entry ent; /* must be the first member! */
+ struct hashmap_entry ent;
struct worktree *wt; /* key is wt->head_ref */
};
struct ref_store_hash_entry
{
- struct hashmap_entry ent; /* must be the first member! */
+ struct hashmap_entry ent;
struct ref_store *refs;
};
struct remote {
- struct hashmap_entry ent; /* must be first */
+ struct hashmap_entry ent;
const char *name;
int origin, configured_in_repo;
/* Members should not be accessed directly. */
struct subprocess_entry {
- struct hashmap_entry ent; /* must be the first member! */
+ struct hashmap_entry ent;
const char *cmd;
struct child_process process;
};
struct test_entry
{
+ int padding; /* hashmap entry no longer needs to be the first member */
struct hashmap_entry ent;
/* key and value as two \0-terminated strings */
char key[FLEX_ARRAY];