diff --git a/doc/Glossary-Concise.txt b/doc/Glossary-Concise.txt index e820615..bf80019 100644 --- a/doc/Glossary-Concise.txt +++ b/doc/Glossary-Concise.txt @@ -1105,25 +1105,25 @@ Compare n1 and n2. Return `TRUE` if n1 is less than n2, or `FALSE` otherwise. lteq? D: nn-f A: - F: - Compare n1 and n2. Return `TRUE` if n1 is less than or equal to n2, or `FALSE` otherwise. -mem:alloc D: n-nn A: - F: - +mem:alloc D: n-n A: - F: - Use malloc to allocate memory. Returns a double cell pointer to this memory. -mem:cell+ D: nnn-n A: - F: - +mem:cell+ D: nn-n A: - F: - Return address of next cell. Uses a double cell pointer on the stack. mem:fetch D: nn-n A: - F: - Fetch value from malloc'd memory region. Address is a double cell value. -mem:fetch-double D: nn-n A: - F: - +mem:fetch-double D: nn-nn A: - F: - Fetch a double cell value from a malloc memory region. -mem:free D: nn- A: - F: - +mem:free D: n- A: - F: - Fre a malloc'd region of memory. Pass a double cell pointer to the memory to free. -mem:resize D: mmn- A: - F: - +mem:resize D: mn- A: - F: - Resize a malloc'd memory area. -mem:store D: xnn- A: - F: - +mem:store D: xn- A: - F: - Store a value into a malloc'd memory region. Uses a double cell pointer for the address. mod D: nm-o A: - F: - diff --git a/interface/malloc.retro b/interface/malloc.retro index e9b947a..9a1f129 100644 --- a/interface/malloc.retro +++ b/interface/malloc.retro @@ -13,16 +13,16 @@ ---reveal--- - :mem:alloc (n--aa) ALLOC mem:invoke ; - :mem:store (an--) STORE mem:invoke ; - :mem:fetch (a--n) FETCH mem:invoke ; - :mem:free (aa--) FREE mem:invoke ; - :mem:resize (aan--) RESIZE mem:invoke ; + :mem:alloc (n--a) ALLOC mem:invoke ; + :mem:store (an--) STORE mem:invoke ; + :mem:fetch (a--n) FETCH mem:invoke ; + :mem:free (a--) FREE mem:invoke ; + :mem:resize (an--) RESIZE mem:invoke ; }} -:mem:cell+ (nnn-n) #4 * + ; +:mem:cell+ (nn-n) #8 * + ; :mem:fetch-double (n-nn) - dup-pair #1 mem:cell+ fetch push mem:fetch pop ; -:mem:store-double (aann-nn) + dup #1 mem:cell+ fetch push mem:fetch pop ; +:mem:store-double (ann-nn) push push dup-pair #1 mem:cell+ pop mem:store pop mem:store ; ~~~ diff --git a/vm/nga-c/image.c b/vm/nga-c/image.c index f8122ae..3961544 100644 --- a/vm/nga-c/image.c +++ b/vm/nga-c/image.c @@ -10,8 +10,8 @@ #define CELL_MAX LLONG_MAX - 1 #endif #endif -CELL ngaImageCells = 19825; -CELL ngaImage[] = { 1793,19332,19780,19824,202301,410,382,1242,1535,0,10,1,10,2,10,3,10,4,10, +CELL ngaImageCells = 19824; +CELL ngaImage[] = { 1793,19331,19779,19823,202301,410,382,1242,1535,0,10,1,10,2,10,3,10,4,10, 5,10,6,10,7,10,8,10,11,10,12,10,13,10,14,10,15,10,16,10, 17,10,18,10,19,10,20,10,21,10,22,10,23,10,24,10,25,68223234,1,2575, 85000450,1,656912,161,178,268505089,63,62,285281281,0,63,2063,10,101384453,0,9,10,68485378,255,18350338, @@ -20,8 +20,8 @@ CELL ngaImage[] = { 1793,19332,19780,19824,202301,410,382,1242,1535,0,10,1,10,2, 101777669,1,17565186,107,524545,111,64,167838467,-1,134287105,3,59,659457,3,459023,128,2049,56,25,2049, 128,1793,135,2049,135,117506307,0,128,0,524545,26,133,168820993,0,147,1642241,147,134283523,11,133, 1793,128,524545,2049,128,1793,128,16846593,147,161,178,1793,64,16846593,147,133,178,1793,64,7, - 10,659713,1,659713,2,659713,3,659713,4,659713,5,1793,19587,17108737,3,2,524559,128,2049,128, - 2049,128,524545,0,128,524545,0,128,2049,142,168820998,2,18568,1242,167841793,211,9,17826049,0,211, + 10,659713,1,659713,2,659713,3,659713,4,659713,5,1793,19586,17108737,3,2,524559,128,2049,128, + 2049,128,524545,0,128,524545,0,128,2049,142,168820998,2,18567,1242,167841793,211,9,17826049,0,211, 2,15,25,524546,188,134287105,212,116,2305,213,459023,221,134287361,212,216,659201,211,10,659969,7, 2049,56,25,17694978,58,237,9,84152833,48,319750404,236,117507601,239,184618754,45,25,16974851,-1,168886532,1, 134284289,1,252,134284289,0,239,660227,32,0,0,115,105,103,105,108,58,105,0,285278479,269, @@ -170,7 +170,7 @@ CELL ngaImage[] = { 1793,19332,19780,19824,202301,410,382,1242,1535,0,10,1,10,2, 110,58,105,110,99,0,659713,1,10,3114,3139,166,16180,210720197721,110,58,100,101,99,0, 659969,1,10,3128,3158,166,16180,8246617666422322998,110,58,98,101,116,119,101,101,110,63,0,67503109, 1793,3166,67503109,67503109,2049,3106,10,1,3161,2049,2241,11,10,3142,3187,166,16180,249861296566813883,83,99, - 111,112,101,76,105,115,116,0,19682,19736,10,3172,3198,166,16180,5864091,123,123,0,2049, + 111,112,101,76,105,115,116,0,19681,19735,10,3172,3198,166,16180,5864091,123,123,0,2049, 1576,2,1,3187,2049,59,16,10,3190,3225,166,16180,-6305314778776785742,45,45,45,114,101,118,101, 97,108,45,45,45,0,2049,1576,1,3187,2049,3125,16,10,3207,3241,166,16180,5864159,125, 125,0,1,3187,2049,56,4,15,11,1793,3255,3841,3187,4097,2,10,1,3250,1793,3281, @@ -935,71 +935,71 @@ CELL ngaImage[] = { 1793,19332,19780,19824,202301,410,382,1242,1535,0,10,1,10,2, 1,3,2049,18302,10,18404,18438,166,0,7572664961638592,109,101,109,58,102,114,101,101,0,1, 1,2049,18302,10,18424,18459,166,0,8246632143679146032,109,101,109,58,114,101,115,105,122,101,0, 1,4,2049,18302,10,18443,18479,166,0,249897943730056489,109,101,109,58,99,101,108,108,43,0, - 1,4,19,17,10,18464,18506,166,0,1050530996183190288,109,101,109,58,102,101,116,99,104,45, - 100,111,117,98,108,101,0,2049,2217,1,1,2049,18479,15,5,2049,18419,6,10,18484, - 18540,166,0,1730340976492540563,109,101,109,58,115,116,111,114,101,45,100,111,117,98,108,101, - 0,5,5,2049,2217,1,1,2049,18479,6,2049,18399,6,2049,18399,10,18518,18564,166,19351, - 193470948,84,73,66,0,1,7,15,10,18555,18584,166,19351,8246457295145463473,105,109,97,103,101,58, - 115,97,118,101,0,1,1000,2049,10655,2049,10636,10,18568,18602,166,0,0,101,100,105, - 116,63,0,2,1793,18609,1,8,11,10,1,18605,1793,18617,1,127,11,10,1,18613, - 2049,2255,22,10,18591,18635,166,0,0,103,97,116,104,101,114,0,2049,18602,1,15, - 1,4134,2049,64,10,18623,18655,166,0,0,99,121,99,108,101,0,2049,10985,2049,2217, - 4,8,2049,2644,25,3,2049,18635,1,18655,7,10,18568,18688,166,19351,-4557881830897049127,112,97,114, - 115,101,45,117,110,116,105,108,0,1793,18700,2049,4451,2049,4234,2049,18655,771,2049,4096, - 10,1,18690,2049,4260,10,18671,18716,166,19351,210726130610,115,58,103,101,116,0,1793,18738,1793, - 18724,1,13,11,10,1,18720,1793,18732,1,10,11,10,1,18728,2049,2255,22,10,1, - 18718,2049,18688,10,18705,18754,166,19351,210708950412,99,108,101,97,114,0,2049,4472,92,94,91, - 50,74,92,94,91,48,59,48,72,0,1,18756,2049,8246,2049,10761,10,18743,18788,154, - 19351,6952575930081,78,111,69,99,104,111,0,0,18776,18798,154,0,0,69,79,84,0,0, - 18789,18813,154,0,0,73,103,110,111,114,105,110,103,0,0,18799,18829,166,0,0, - 105,103,110,111,114,105,110,103,63,0,3841,18813,10,18814,18845,166,0,0,118,101, - 114,115,105,111,110,0,3841,4,1,100,20,10,18832,18862,166,0,0,100,111,110, - 101,63,0,2,4097,18798,1793,18871,1,13,11,10,1,18867,1793,18879,1,10,11,10, - 1,18875,1793,18887,1,32,11,10,1,18883,2049,2298,22,22,10,18851,18904,166,0,0, - 101,111,108,63,0,3841,18798,1793,18912,1,13,11,10,1,18908,1793,18920,1,10,11, - 10,1,18916,2049,2255,22,10,18894,18938,166,0,0,118,97,108,105,100,63,0,2, - 2049,102,2049,2812,10,18926,18959,166,0,0,99,104,101,99,107,45,101,111,102,0, - 2,1793,18966,1,-1,11,10,1,18962,1793,18974,1,4,11,10,1,18970,2049,2255,22, - 1793,18984,2049,11052,10,1,18981,9,10,18944,18996,166,0,0,98,115,0,2049,4212,1, - 2,2049,2675,1793,19008,2049,4160,3,10,1,19004,9,2049,4160,3,10,18988,19029,166,0, - 0,99,104,101,99,107,45,98,115,0,2,1793,19036,1,8,11,10,1,19032,1793, - 19044,1,127,11,10,1,19040,2049,2255,22,1793,19054,2049,18996,10,1,19051,9,10,19015, - 19069,166,0,0,99,104,101,99,107,0,2049,18959,2049,19029,10,19058,19089,166,0,0, - 99,104,97,114,97,99,116,101,114,0,2049,10985,2,2049,4134,10,19074,19107,166,0, - 0,98,117,102,102,101,114,0,1793,19117,2049,18564,2049,4234,8,2049,4096,10,1,19109, - 2049,4260,10,19095,19138,166,0,0,114,101,97,100,45,116,111,107,101,110,0,1793, - 19154,1793,19149,2049,19089,2049,19069,2049,18862,10,1,19142,2049,2397,10,1,19140,2049,19107,2049, - 4587,10,19122,19172,166,0,0,105,110,112,117,116,0,2049,19138,2049,18938,10,19161,19190, - 166,0,0,112,114,111,99,101,115,115,0,2049,18829,1793,19208,771,2049,18904,1793,19204, - 1,18813,2049,3931,10,1,19199,9,10,1,19194,2049,2862,1,410,1,15,2049,64,10, - 18776,19227,178,19351,5861507,47,47,0,2049,15624,1,18813,2049,3916,10,19219,19246,166,19351,6953343520347, - 98,97,110,110,101,114,0,2049,18845,2049,4472,82,69,84,82,79,32,49,50,32, - 40,37,110,46,37,110,41,92,110,0,1,19250,2049,8246,2049,10761,2049,10837,2049,1545, - 2049,10837,18,2049,1545,2049,4472,37,110,32,77,97,120,44,32,37,110,32,85,115, - 101,100,44,32,37,110,32,70,114,101,101,92,110,0,1,19286,2049,8246,2049,10761, - 10,19234,19332,166,19351,6953744547860,108,105,115,116,101,110,0,3841,18788,1793,19339,2049,19246,10, - 1,19336,2049,72,2049,19172,2049,19190,1,19343,7,10,105,110,116,101,114,102,97,99, - 101,47,114,101,116,114,111,45,117,110,105,120,46,114,101,116,114,111,0,19320, - 19391,154,0,0,83,111,117,114,99,101,115,0,1,19630,0,0,0,0,0,0, + 1,8,19,17,10,18464,18506,166,0,1050530996183190288,109,101,109,58,102,101,116,99,104,45, + 100,111,117,98,108,101,0,2,1,1,2049,18479,15,5,2049,18419,6,10,18484,18539, + 166,0,1730340976492540563,109,101,109,58,115,116,111,114,101,45,100,111,117,98,108,101,0, + 5,5,2049,2217,1,1,2049,18479,6,2049,18399,6,2049,18399,10,18517,18563,166,19350,193470948, + 84,73,66,0,1,7,15,10,18554,18583,166,19350,8246457295145463473,105,109,97,103,101,58,115, + 97,118,101,0,1,1000,2049,10655,2049,10636,10,18567,18601,166,0,0,101,100,105,116, + 63,0,2,1793,18608,1,8,11,10,1,18604,1793,18616,1,127,11,10,1,18612,2049, + 2255,22,10,18590,18634,166,0,0,103,97,116,104,101,114,0,2049,18601,1,15,1, + 4134,2049,64,10,18622,18654,166,0,0,99,121,99,108,101,0,2049,10985,2049,2217,4, + 8,2049,2644,25,3,2049,18634,1,18654,7,10,18567,18687,166,19350,-4557881830897049127,112,97,114,115, + 101,45,117,110,116,105,108,0,1793,18699,2049,4451,2049,4234,2049,18654,771,2049,4096,10, + 1,18689,2049,4260,10,18670,18715,166,19350,210726130610,115,58,103,101,116,0,1793,18737,1793,18723, + 1,13,11,10,1,18719,1793,18731,1,10,11,10,1,18727,2049,2255,22,10,1,18717, + 2049,18687,10,18704,18753,166,19350,210708950412,99,108,101,97,114,0,2049,4472,92,94,91,50, + 74,92,94,91,48,59,48,72,0,1,18755,2049,8246,2049,10761,10,18742,18787,154,19350, + 6952575930081,78,111,69,99,104,111,0,0,18775,18797,154,0,0,69,79,84,0,0,18788, + 18812,154,0,0,73,103,110,111,114,105,110,103,0,0,18798,18828,166,0,0,105, + 103,110,111,114,105,110,103,63,0,3841,18812,10,18813,18844,166,0,0,118,101,114, + 115,105,111,110,0,3841,4,1,100,20,10,18831,18861,166,0,0,100,111,110,101, + 63,0,2,4097,18797,1793,18870,1,13,11,10,1,18866,1793,18878,1,10,11,10,1, + 18874,1793,18886,1,32,11,10,1,18882,2049,2298,22,22,10,18850,18903,166,0,0,101, + 111,108,63,0,3841,18797,1793,18911,1,13,11,10,1,18907,1793,18919,1,10,11,10, + 1,18915,2049,2255,22,10,18893,18937,166,0,0,118,97,108,105,100,63,0,2,2049, + 102,2049,2812,10,18925,18958,166,0,0,99,104,101,99,107,45,101,111,102,0,2, + 1793,18965,1,-1,11,10,1,18961,1793,18973,1,4,11,10,1,18969,2049,2255,22,1793, + 18983,2049,11052,10,1,18980,9,10,18943,18995,166,0,0,98,115,0,2049,4212,1,2, + 2049,2675,1793,19007,2049,4160,3,10,1,19003,9,2049,4160,3,10,18987,19028,166,0,0, + 99,104,101,99,107,45,98,115,0,2,1793,19035,1,8,11,10,1,19031,1793,19043, + 1,127,11,10,1,19039,2049,2255,22,1793,19053,2049,18995,10,1,19050,9,10,19014,19068, + 166,0,0,99,104,101,99,107,0,2049,18958,2049,19028,10,19057,19088,166,0,0,99, + 104,97,114,97,99,116,101,114,0,2049,10985,2,2049,4134,10,19073,19106,166,0,0, + 98,117,102,102,101,114,0,1793,19116,2049,18563,2049,4234,8,2049,4096,10,1,19108,2049, + 4260,10,19094,19137,166,0,0,114,101,97,100,45,116,111,107,101,110,0,1793,19153, + 1793,19148,2049,19088,2049,19068,2049,18861,10,1,19141,2049,2397,10,1,19139,2049,19106,2049,4587, + 10,19121,19171,166,0,0,105,110,112,117,116,0,2049,19137,2049,18937,10,19160,19189,166, + 0,0,112,114,111,99,101,115,115,0,2049,18828,1793,19207,771,2049,18903,1793,19203,1, + 18812,2049,3931,10,1,19198,9,10,1,19193,2049,2862,1,410,1,15,2049,64,10,18775, + 19226,178,19350,5861507,47,47,0,2049,15624,1,18812,2049,3916,10,19218,19245,166,19350,6953343520347,98, + 97,110,110,101,114,0,2049,18844,2049,4472,82,69,84,82,79,32,49,50,32,40, + 37,110,46,37,110,41,92,110,0,1,19249,2049,8246,2049,10761,2049,10837,2049,1545,2049, + 10837,18,2049,1545,2049,4472,37,110,32,77,97,120,44,32,37,110,32,85,115,101, + 100,44,32,37,110,32,70,114,101,101,92,110,0,1,19285,2049,8246,2049,10761,10, + 19233,19331,166,19350,6953744547860,108,105,115,116,101,110,0,3841,18787,1793,19338,2049,19245,10,1, + 19335,2049,72,2049,19171,2049,19189,1,19342,7,10,105,110,116,101,114,102,97,99,101, + 47,114,101,116,114,111,45,117,110,105,120,46,114,101,116,114,111,0,19319,19390, + 154,0,0,83,111,117,114,99,101,115,0,1,19629,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 19378,19531,166,0,0,107,110,111,119,110,63,0,2,1,19391,2049,9003,10,19519,19548, - 166,0,0,105,110,100,101,120,0,1,19391,4,2049,9320,1,19391,4,2049,9140,10, - 19537,19571,166,0,0,114,101,99,111,114,100,0,2049,4500,2,1,19391,2049,3864,3841, - 19391,1,19391,17,16,10,1793,19628,2049,15559,2049,19531,1793,19596,2049,19548,10,1,19593,1793, - 19603,2049,19571,10,1,19600,2049,64,1793,19616,1,190,1,2,17,8,10,1,19609,2049, - 2229,2049,1576,2049,184,16,2049,11116,10,1,19587,100,105,99,116,45,119,111,114,100, - 115,45,108,105,115,116,105,110,103,46,102,111,114,116,104,0,19320,19668,166,19630, - 229461403550098,100,58,119,111,114,100,115,0,1793,19677,2049,188,2049,10761,2049,10731,10,1,19670, - 2049,8491,10,19655,19700,166,19630,-3502157631813457253,100,58,119,111,114,100,115,45,119,105,116,104, - 0,2049,1977,2049,5573,1793,19731,2049,188,2,2049,1977,2049,5286,1793,19720,2049,10761,2049,10731, - 10,1,19715,1793,19726,3,10,1,19724,2049,64,10,1,19706,2049,8491,10,19682,19757,166, - 19630,2818131571306626127,100,105,115,112,108,97,121,45,105,102,45,108,101,102,116,0,2,2049, - 1977,2049,5519,1793,19769,2049,10761,2049,10731,10,1,19764,1793,19775,3,10,1,19773,2049,64, - 10,19682,19808,166,19630,2947807019553410009,100,58,119,111,114,100,115,45,98,101,103,105,110,110, - 105,110,103,45,119,105,116,104,0,2049,1977,2049,5573,1793,19819,2049,188,2049,19757,10, - 1,19814,2049,8491,10,0 }; + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19377, + 19530,166,0,0,107,110,111,119,110,63,0,2,1,19390,2049,9003,10,19518,19547,166, + 0,0,105,110,100,101,120,0,1,19390,4,2049,9320,1,19390,4,2049,9140,10,19536, + 19570,166,0,0,114,101,99,111,114,100,0,2049,4500,2,1,19390,2049,3864,3841,19390, + 1,19390,17,16,10,1793,19627,2049,15559,2049,19530,1793,19595,2049,19547,10,1,19592,1793,19602, + 2049,19570,10,1,19599,2049,64,1793,19615,1,190,1,2,17,8,10,1,19608,2049,2229, + 2049,1576,2049,184,16,2049,11116,10,1,19586,100,105,99,116,45,119,111,114,100,115, + 45,108,105,115,116,105,110,103,46,102,111,114,116,104,0,19319,19667,166,19629,229461403550098, + 100,58,119,111,114,100,115,0,1793,19676,2049,188,2049,10761,2049,10731,10,1,19669,2049, + 8491,10,19654,19699,166,19629,-3502157631813457253,100,58,119,111,114,100,115,45,119,105,116,104,0, + 2049,1977,2049,5573,1793,19730,2049,188,2,2049,1977,2049,5286,1793,19719,2049,10761,2049,10731,10, + 1,19714,1793,19725,3,10,1,19723,2049,64,10,1,19705,2049,8491,10,19681,19756,166,19629, + 2818131571306626127,100,105,115,112,108,97,121,45,105,102,45,108,101,102,116,0,2,2049,1977, + 2049,5519,1793,19768,2049,10761,2049,10731,10,1,19763,1793,19774,3,10,1,19772,2049,64,10, + 19681,19807,166,19629,2947807019553410009,100,58,119,111,114,100,115,45,98,101,103,105,110,110,105, + 110,103,45,119,105,116,104,0,2049,1977,2049,5573,1793,19818,2049,188,2049,19756,10,1, + 19813,2049,8491,10,0 }; diff --git a/vm/nga-c/retro.c b/vm/nga-c/retro.c index febf6ce..c67eb20 100644 --- a/vm/nga-c/retro.c +++ b/vm/nga-c/retro.c @@ -187,8 +187,10 @@ void io_socket(NgaState *); void query_socket(NgaState *); #endif #ifdef ENABLE_MALLOC +#ifdef BIT64 void io_malloc(NgaState *); void query_malloc(NgaState *); #endif +#endif void io_image(NgaState *); void query_image(NgaState *); @@ -231,6 +233,7 @@ void inst_iq(NgaState *); void inst_ii(NgaState *); /* Dynamic Memory / `malloc` support --------------------------------- */ #ifdef ENABLE_MALLOC +#ifdef BIT64 typedef union { void* val; struct { @@ -259,45 +262,32 @@ void double_divmod(NgaState *vm) { } void malloc_allocate(NgaState *vm) { - // TODO: Conditionally compile based on host word size? - double_cell addr = { .val = malloc(stack_pop(vm)) }; - stack_push(vm, addr.lsw); - stack_push(vm, addr.msw); + stack_push(vm, (CELL)malloc(stack_pop(vm))); } void malloc_free(NgaState *vm) { - double_cell addr; - addr.msw = stack_pop(vm); - addr.lsw = stack_pop(vm); - free(addr.val); + free((CELL*)stack_pop(vm)); } void malloc_store(NgaState *vm) { CELL value = stack_pop(vm); double_cell addr; - addr.msw = stack_pop(vm); - addr.lsw = stack_pop(vm); - *(CELL *) addr.val = value; + *(CELL *) stack_pop(vm) = value; } void malloc_fetch(NgaState *vm) { double_cell addr; - addr.msw = stack_pop(vm); - addr.lsw = stack_pop(vm); - CELL value = *(CELL *)addr.val; + CELL value = *(CELL *)stack_pop(vm); stack_push(vm, value); } void malloc_realloc(NgaState *vm) { CELL bytes = stack_pop(vm); - double_cell addr1; - addr1.msw = stack_pop(vm); - addr1.lsw = stack_pop(vm); - - double_cell addr2; - addr2.val = realloc(addr1.val, bytes); - stack_push(vm, addr2.lsw); - stack_push(vm, addr2.msw); + CELL* addr1; + addr1 = (CELL*)stack_pop(vm); + CELL* addr2; + addr2 = (CELL*)realloc(addr1, bytes); + stack_push(vm, (CELL)addr2); } void query_malloc(NgaState *vm) { @@ -317,6 +307,7 @@ void io_malloc(NgaState *vm) { stack_push(vm, -1); } #endif +#endif /* Multi Core Support ------------------------------------------------ */ #ifdef ENABLE_MULTICORE @@ -1905,8 +1896,10 @@ int main(int argc, char **argv) { register_device(vm, io_unix, query_unix); #endif #ifdef ENABLE_MALLOC +#ifdef BIT64 register_device(vm, io_malloc, query_malloc); #endif +#endif #ifdef ENABLE_CLOCK register_device(vm, io_clock, query_clock); #endif