Skip to content
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

feat: add unlimited syntax for allowedActivations #71

Merged
merged 1 commit into from
Jul 27, 2024

Conversation

ahmad-kemsan
Copy link
Collaborator

feat: add unlimited syntax for allowedDeactivation

feat: add unlimited syntax for licenseMeterAttributes

feat: add unlimited syntax for allowedDeactivation

feat: add unlimited syntax for licenseMeterAttributes
@ahmad-kemsan ahmad-kemsan marked this pull request as ready for review July 26, 2024 04:14
const grossUses = new Uint32Array(1);
const allowedUses = new BigInt64Array(1);
const totalUses = new BigUint64Array(1);
const grossUses = new BigUint64Array(1);
const status = LexActivatorNative.GetLicenseMeterAttribute(name, allowedUses, totalUses, grossUses);
switch (status) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adnan-kamili Since the values from the C library are either int64_t * or uint64_t *, and we use typed arrays in JavaScript to match it to the pointers used by the C functions, we have to use BigInt64Array and BigUint64Array in this case. This ensures that we can handle 64-bit integer values correctly.

To avoid any loss of data when dealing with these 64-bit integers, the return type must be bigint instead of number.

@adnan-kamili adnan-kamili merged commit 77e5357 into ahmad/unlimited-syntax Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants