diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-04-30 12:11:31 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2008-04-30 12:11:31 +0000 |
commit | ef73dbc1301bc42c132d15ae6ca866233c0beeb4 (patch) | |
tree | 7386ab88c4f2c43ac417a2ea0b0b19239bdc0b19 /nscd/nscd.h | |
parent | 14e44061ad888abbea7239599a9109b41776e41c (diff) |
Diffstat (limited to 'nscd/nscd.h')
-rw-r--r-- | nscd/nscd.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/nscd/nscd.h b/nscd/nscd.h index ec2d9454ca..66813e7480 100644 --- a/nscd/nscd.h +++ b/nscd/nscd.h @@ -130,7 +130,7 @@ struct database_dyn /* Global variables. */ -extern struct database_dyn dbs[lastdb]; +extern struct database_dyn dbs[lastdb] attribute_hidden; extern const char *const dbnames[lastdb]; extern const char *const serv2str[LASTREQ]; @@ -181,6 +181,31 @@ extern uid_t old_uid; extern gid_t old_gid; +/* Memory allocation in flight. Each thread can have a limited number + of allocation in flight. No need to create dynamic data + structures. We use fixed indices. */ +enum in_flight + { + IDX_result_data = 0, + /* Keep the IDX_record_data entry last at all times. */ + IDX_record_data = 1, + IDX_last + }; +extern __thread struct mem_in_flight +{ + struct + { + int dbidx; + nscd_ssize_t blocklen; + void *blockaddr; + } block[IDX_last]; + + struct mem_in_flight *next; +} mem_in_flight attribute_tls_model_ie; +/* Global list of the mem_in_flight variables of all the threads. */ +extern struct mem_in_flight *mem_in_flight_list; + + /* Prototypes for global functions. */ /* nscd.c */ @@ -271,7 +296,8 @@ extern void readdservbyport (struct database_dyn *db, struct hashentry *he, struct datahead *dh); /* mem.c */ -extern void *mempool_alloc (struct database_dyn *db, size_t len); +extern void *mempool_alloc (struct database_dyn *db, size_t len, + enum in_flight idx); extern void gc (struct database_dyn *db); |