diff options
author | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-04-07 18:00:13 +0000 |
---|---|---|
committer | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-04-07 18:00:13 +0000 |
commit | 1a348ede4934a1ba78f337ee1dffe11a699f4bef (patch) | |
tree | 883d4c1ae282fb67e1720f81c20f564499298ff4 /src/common/db.h | |
parent | 7cb0d361f1b4260b47ab1da99224332947320553 (diff) | |
parent | a6cd6538e4271ea08dc86803e8b7e8c8f235960b (diff) | |
download | hercules-1a348ede4934a1ba78f337ee1dffe11a699f4bef.tar.gz hercules-1a348ede4934a1ba78f337ee1dffe11a699f4bef.tar.bz2 hercules-1a348ede4934a1ba78f337ee1dffe11a699f4bef.tar.xz hercules-1a348ede4934a1ba78f337ee1dffe11a699f4bef.zip |
branch for major stability breakage
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@1440 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/db.h')
-rw-r--r-- | src/common/db.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/common/db.h b/src/common/db.h index ea9aceab0..6980099cf 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -13,6 +13,14 @@ struct dbn { int color; void *key; void *data; + int deleted; // 削除済みフラグ(db_foreach) + struct dbn *next; + struct dbn *prev; +}; + +struct db_free { + struct dbn *z; + struct dbn **root; }; struct dbt { @@ -22,6 +30,15 @@ struct dbt { void (*release)(struct dbn*,int which); int maxlen; struct dbn *ht[HASH_SIZE]; + int item_count; // vf? + const char* alloc_file; // DB?t@C + int alloc_line; // DB?s + // db_foreach 内部でdb_erase される対策として、 + // db_foreach が終わるまでロックすることにする + struct db_free *free_list; + int free_count; + int free_max; + int free_lock; }; #define strdb_search(t,k) db_search((t),(void*)(k)) @@ -34,14 +51,18 @@ struct dbt { #define numdb_erase(t,k) db_erase ((t),(void*)(k)) #define numdb_foreach db_foreach #define numdb_final db_final +#define strdb_init(a) strdb_init_(a,__FILE__,__LINE__) +#define numdb_init() numdb_init_(__FILE__,__LINE__) + +struct dbt* strdb_init_(int maxlen,const char *file,int line); +struct dbt* numdb_init_(const char *file,int line); -struct dbt* strdb_init(int maxlen); -struct dbt* numdb_init(void); void* db_search(struct dbt *table,void* key); void* db_search2(struct dbt *table, const char *key); // [MouseJstr] struct dbn* db_insert(struct dbt *table,void* key,void* data); void* db_erase(struct dbt *table,void* key); void db_foreach(struct dbt*,int(*)(void*,void*,va_list),...); void db_final(struct dbt*,int(*)(void*,void*,va_list),...); +void exit_dbn(void); #endif |