Skip to content

Commit 187d723

Browse files
authored
Merge pull request #38 from gkjohnson/smaller-footprint
Slightly smaller memory footprint
2 parents 311dd2c + 9a7f333 commit 187d723

File tree

5 files changed

+188
-186
lines changed

5 files changed

+188
-186
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ spiceInstance.loadKernel(buffer);
334334

335335
## Recompiling cspice.js
336336

337-
`cspice.js` is the massive Javascript file resulting from the automatic porting via Emscripten. As such, if CSPICE updates, this file will need to be recompiled. The current version of cspice.js was created from the [Mac/OSX 64 Bit Toolkit](https://naif.jpl.nasa.gov/naif/toolkit_C_MacIntel_OSX_AppleC_64bit.html) on April 12, 2021 with version emscripten version 2.0.16.
337+
`cspice.js` is the massive Javascript file resulting from the automatic porting via Emscripten. As such, if CSPICE updates, this file will need to be recompiled. The current version of cspice.js was created from the [Mac/OSX 64 Bit Toolkit](https://naif.jpl.nasa.gov/naif/toolkit_C_MacIntel_OSX_AppleC_64bit.html) on April 12, 2021 with version emscripten version 2.0.17.
338338

339339
In order to recompile cspice.js, follow these steps:
340340

generation/generate-cspice.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ HERE=`pwd`
66
# -s SAFE_HEAP=1
77
EMCC_OPTIONS="
88
-Oz
9-
-s TOTAL_MEMORY=117440512
9+
-s TOTAL_MEMORY=106168320
1010
-s ALLOW_MEMORY_GROWTH=1
11+
-s MEMORY_GROWTH_GEOMETRIC_STEP=0.01
1112
-s EXPORTED_FUNCTIONS=@$HERE/exports.json
1213
-s EXTRA_EXPORTED_RUNTIME_METHODS=['FS','ccall','getValue','setValue','UTF8ToString','stringToUTF8']
1314
-s NO_EXIT_RUNTIME=1

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "timecraftjs",
3-
"version": "1.0.1",
3+
"version": "2.0.0-alpha3",
44
"description": "Time conversion using NAIF CSPICE Toolkit in JavaScript via Emscripten.",
55
"main": "cjs/index.js",
66
"module": "src/index.js",

src/cspice.js

Lines changed: 182 additions & 181 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/Timecraft.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { Spice } = require('../cjs/index.js');
44

55
describe('Spice', () => {
66
let spiceInstance = null;
7-
beforeEach(async () => {
7+
beforeAll(async () => {
88
spiceInstance = await new Spice().init();
99
});
1010

@@ -166,7 +166,7 @@ describe('Spice', () => {
166166
expect(spiceInstance.chronos('510593482.204611', '-from et -to sclk -fromtype SECONDS -sc -76')).toEqual('1/0510592221-24314');
167167
});
168168

169-
afterAll(() => {
169+
afterEach(() => {
170170
kernelPaths.forEach(p => {
171171
spiceInstance.unloadKernel(p);
172172
});

0 commit comments

Comments
 (0)