diff options
author | Anthony Ramine <[email protected]> | 2014-05-09 16:01:49 +0200 |
---|---|---|
committer | Zandra Hird <[email protected]> | 2015-03-12 10:15:14 +0100 |
commit | 0e464f7be1ae9b54d0fba748ab2dc7bd435ac118 (patch) | |
tree | 13ae71cc4a3b95fce407254783003d0d5d63c70a /erts/emulator/beam/erl_db_util.h | |
parent | 0ec91ff571518e199aac7a4da961a80c153483b9 (diff) | |
download | otp-0e464f7be1ae9b54d0fba748ab2dc7bd435ac118.tar.gz otp-0e464f7be1ae9b54d0fba748ab2dc7bd435ac118.tar.bz2 otp-0e464f7be1ae9b54d0fba748ab2dc7bd435ac118.zip |
Create new BIF ets:update_counter/4
Conflicts:
erts/emulator/beam/bif.tab
lib/stdlib/src/ets.erl
Diffstat (limited to 'erts/emulator/beam/erl_db_util.h')
-rw-r--r-- | erts/emulator/beam/erl_db_util.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/erts/emulator/beam/erl_db_util.h b/erts/emulator/beam/erl_db_util.h index 5ace93c8ed..ca206c7f58 100644 --- a/erts/emulator/beam/erl_db_util.h +++ b/erts/emulator/beam/erl_db_util.h @@ -76,6 +76,9 @@ typedef struct db_term { union db_table; typedef union db_table DbTable; +#define DB_MUST_RESIZE 1 +#define DB_NEW_OBJECT 2 + /* Info about a database entry while it's being updated * (by update_counter or update_element) */ @@ -84,7 +87,7 @@ typedef struct { DbTerm* dbterm; void** bp; /* {Hash|Tree}DbTerm** */ Uint new_size; - int mustResize; + int flags; void* lck; #if HALFWORD_HEAP unsigned char* abs_vec; /* [i] true if dbterm->tpl[i] is absolute Eterm */ @@ -183,15 +186,14 @@ typedef struct db_table_method void *arg); void (*db_check_table)(DbTable* tb); - /* Lookup a dbterm for updating. Return false if not found. - */ - int (*db_lookup_dbterm)(DbTable*, Eterm key, - DbUpdateHandle* handle); /* [out] */ + /* Lookup a dbterm for updating. Return false if not found. */ + int (*db_lookup_dbterm)(Process *, DbTable *, Eterm key, Eterm obj, + DbUpdateHandle* handle); - /* Must be called for each db_lookup_dbterm that returned true, - ** even if dbterm was not updated. - */ - void (*db_finalize_dbterm)(DbUpdateHandle* handle); + /* Must be called for each db_lookup_dbterm that returned true, even if + ** dbterm was not updated. If the handle was of a new object and cret is + ** not DB_ERROR_NONE, the object is removed from the table. */ + void (*db_finalize_dbterm)(int cret, DbUpdateHandle* handle); } DbTableMethod; |