MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxBigInt_alloc

Function fxBigInt_alloc

xs/sources/xsBigInt.c:914–931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912#endif
913
914txBigInt *fxBigInt_alloc(txMachine* the, txU4 size)
915{
916#ifndef mxCompile
917 txBigInt* bigint;
918 if (size > 0xFFFF) {
919 fxAbort(the, XS_NOT_ENOUGH_MEMORY_EXIT);
920 }
921 mxPushUndefined();
922 bigint = &the->stack->value.bigint;
923 bigint->data = fxNewChunk(the, fxMultiplyChunkSizes(the, size, sizeof(txU4)));
924 bigint->size = size;
925 bigint->sign = 0;
926 the->stack->kind = XS_BIGINT_KIND;
927 return bigint;
928#else
929 return NULL;
930#endif
931}
932
933void fxBigInt_free(txMachine* the, txBigInt *bigint)
934{

Callers 15

pool_getFunction · 0.85
mod_exp_initFunction · 0.85
fxBigInt_mod_exp_LRFunction · 0.85
mont_inFunction · 0.85
mont_outFunction · 0.85
fxBigInt_mont_exp_LRFunction · 0.85
fxBigInt_mont_exp_SWFunction · 0.85
fxBigInt_ec_doubleFunction · 0.85
fxBigInt_ec_addFunction · 0.85
fxBigInt_ec_mulFunction · 0.85

Calls 2

fxNewChunkFunction · 0.85
fxAbortFunction · 0.70

Tested by

no test coverage detected