mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Bring back gc() function
Renaming gc() to _gc() was a mistake since the better thing to do is put it behind the _COSMO_SOURCE macro. We need this change because I haven't wanted to use my amazing garbage collector ever since we renamed it. You now need to define _COSMO_SOURCE yourself when using amalgamation header and cosmocc users need to pass the -mcosmo flag to get the gc() function Some other issues relating to cancelation have been fixed along the way. We're also now putting cosmocc in a folder named `.cosmocc` so it can be more safely excluded by grep --exclude-dir=.cosmocc --exclude-dir=o etc.
This commit is contained in:
parent
6cb0354e19
commit
a4b455185b
280 changed files with 1362 additions and 1407 deletions
|
@ -169,7 +169,7 @@ BENCH(p256, bench) {
|
|||
#ifdef MBEDTLS_ECP_C
|
||||
mbedtls_ecp_group_init(&grp);
|
||||
mbedtls_ecp_group_load(&grp, MBEDTLS_ECP_DP_SECP256R1);
|
||||
mbedtls_mpi x = {1, 8, _gc(calloc(8, 8))};
|
||||
mbedtls_mpi x = {1, 8, gc(calloc(8, 8))};
|
||||
rngset(x.p, 8 * 8, _rand64, -1);
|
||||
EZBENCH2("P-256 modulus MbedTLS MPI lib", donothing, P256_MPI(&x));
|
||||
EZBENCH2("P-256 modulus Justine rewrite", donothing, P256_JUSTINE(&x));
|
||||
|
@ -181,7 +181,7 @@ BENCH(p384, bench) {
|
|||
#ifdef MBEDTLS_ECP_C
|
||||
mbedtls_ecp_group_init(&grp);
|
||||
mbedtls_ecp_group_load(&grp, MBEDTLS_ECP_DP_SECP384R1);
|
||||
mbedtls_mpi x = {1, 12, _gc(calloc(12, 8))};
|
||||
mbedtls_mpi x = {1, 12, gc(calloc(12, 8))};
|
||||
EZBENCH2("P-384 modulus MbedTLS MPI lib", donothing, P384_MPI(&x));
|
||||
EZBENCH2("P-384 modulus Justine rewrite", donothing, P384_JUSTINE(&x));
|
||||
mbedtls_ecp_group_free(&grp);
|
||||
|
@ -394,7 +394,7 @@ BENCH(quickjs_remainder, bench) {
|
|||
"2331094682317528819996876363073536047370469375",
|
||||
NULL, BF_PREC_INF, BF_RNDZ | BF_ATOF_NO_NAN_INF);
|
||||
bfdec_rem(&r, &x, &y, BF_PREC_INF, 0, BF_RNDF);
|
||||
t = _gc(bfdec_ftoa(0, &r, BF_PREC_INF, BF_RNDZ | BF_FTOA_FORMAT_FREE));
|
||||
t = gc(bfdec_ftoa(0, &r, BF_PREC_INF, BF_RNDZ | BF_FTOA_FORMAT_FREE));
|
||||
ASSERT_STREQ("327339060789614187001318969682759915221664204604306478"
|
||||
"948329136809613379640467455488327009232590415715088668"
|
||||
"4127560071009217256545885393053328527589375",
|
||||
|
@ -410,7 +410,7 @@ BENCH(quickjs_remainder, bench) {
|
|||
|
||||
BENCH(mpi_remainder, bench) {
|
||||
mbedtls_mpi *x, *y, r;
|
||||
x = _gc(str2mpi(
|
||||
x = gc(str2mpi(
|
||||
"131820409343094310010388979423659136318401916109327276909280345024175692"
|
||||
"811283445510797521231721220331409407564807168230384468176942405812817310"
|
||||
"624525121840385446744443868889563289706427719939300365865529242495144888"
|
||||
|
@ -453,7 +453,7 @@ BENCH(mpi_remainder, bench) {
|
|||
"409401269127676106581410793787580434036114254547441805771508552049371634"
|
||||
"609025127325512605396392214570059772472666763440181556475095153967113514"
|
||||
"87546062479444592779055555421362722504575706910949375"));
|
||||
y = _gc(str2mpi(
|
||||
y = gc(str2mpi(
|
||||
"402702961953621844286950607555369624422784868935557056881131335461307658"
|
||||
"701727371551406721502307932123276358395008895125652043531209418099658895"
|
||||
"323804953421455502359439932416245276659698167468088937570774479761417692"
|
||||
|
@ -488,7 +488,7 @@ BENCH(mpi_remainder, bench) {
|
|||
|
||||
BENCH(mpi_mul_int, bench) {
|
||||
mbedtls_mpi *x, y;
|
||||
x = _gc(str2mpi(
|
||||
x = gc(str2mpi(
|
||||
"131820409343094310010388979423659136318401916109327276909280345024175692"
|
||||
"811283445510797521231721220331409407564807168230384468176942405812817310"
|
||||
"624525121840385446744443868889563289706427719939300365865529242495144888"
|
||||
|
@ -676,7 +676,7 @@ BENCH(gcd, bench) {
|
|||
|
||||
BENCH(inv_mod, bench3) {
|
||||
mbedtls_mpi g = {0};
|
||||
mbedtls_mpi *x = _gc(str2mpi16(
|
||||
mbedtls_mpi *x = gc(str2mpi16(
|
||||
"837B3E23091602B5D14D619D9B2CD79DD039BC9A9F46F0CA1FFD01B398EE42C8EE2142CB"
|
||||
"B295109FC4278DB8AB84A6ADBF319D3297216C349D0EB92925E2794C5FF1AAF664034CB2"
|
||||
"5C15CDA49B7947278AA96BEF9D995C5F99AA4809B12568A1513D8E0A37BB338DC44A1722"
|
||||
|
@ -685,7 +685,7 @@ BENCH(inv_mod, bench3) {
|
|||
"68ED274FA7F7D5BC3E014DDC7BEA4A60DF24805B5F94C998CAF28441FB4A5831755CE935"
|
||||
"2F17F5416647A81A78899E5B2C4D3F6C84A81CEB463C1593392ABCF6BF708A55578EB0EF"
|
||||
"E9ABF572"));
|
||||
mbedtls_mpi *y = _gc(str2mpi16(
|
||||
mbedtls_mpi *y = gc(str2mpi16(
|
||||
"C14DA3DDE7CD1DD104D74972B899AC0E78E43A3C4ACF3A1316D05AE4CDA30088A7EE1E6B"
|
||||
"96A752B490EF2D727A3E249AFCB634AC24F577E026648C9CB0287DA1DAEA8CE6C91C96BC"
|
||||
"FEC10452B336D4A3FAE1B176D890C161B4665236A22653AAAB745E077D1982DB2AD81FA0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue