-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ets:update_counter #1406
Add ets:update_counter #1406
Conversation
0be618b
to
4d64c65
Compare
8b5e005
to
ce7fa79
Compare
ecfc907
to
4522c6b
Compare
src/libAtomVM/nifs.c
Outdated
case EtsBadEntry: | ||
RAISE_ERROR(BADARG_ATOM); | ||
case EtsAllocationFailure: | ||
RAISE_ERROR(MEMORY_ATOM); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean OUT_OF_MEMORY_ATOM
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I also refactor other ets functions? Most of them are raising MEMORY_ATOM in this place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do that on a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I will also format ets_table line to be shorter there ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4522c6b
to
c662a19
Compare
f807e22
to
9ca0d2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also check all calls term_to_int()
, term_to_int() -> avm_int_t
9ca0d2c
to
056e8be
Compare
Signed-off-by: Tomasz Sobkiewicz <tomasz.sobkiewicz@swmansion.com>
056e8be
to
2e927e7
Compare
Currently this solution doesn't support list of UpdateOp to update multiple counters.
Based on:
#1405
https://www.erlang.org/docs/23/man/ets#update_counter-3
These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later