File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ export declare interface RtraceOptions {
2727 getMemory ( ) : WebAssembly . Memory ;
2828}
2929
30+ /** Overhead between a pointer to a block and its unmanaged data. */
31+ export declare const BLOCK_OVERHEAD ;
32+ /** Overhead between a pointer to a block's unmanaged data to its managed data. */
33+ export declare const OBJECT_OVERHEAD ;
34+ /** Overhead between a pointer to a block and its managed data. */
35+ export declare const TOTAL_OVERHEAD ;
36+
3037export declare class Rtrace {
3138 [ key : string ] : unknown ; // can be used as a Wasm import
3239
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ const PTR_SIZE = 1 << PTR_SIZE_BITS;
99const PTR_MASK = PTR_SIZE - 1 ;
1010const PTR_VIEW = Uint32Array ;
1111
12- const BLOCK_OVERHEAD = PTR_SIZE ;
12+ export const BLOCK_OVERHEAD = PTR_SIZE ;
13+ export const OBJECT_OVERHEAD = 16 ;
14+ export const TOTAL_OVERHEAD = BLOCK_OVERHEAD + OBJECT_OVERHEAD ;
1315
1416const RT_TLSF = "~lib/rt/tlsf/" ;
1517
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ var rtrace = (function(exports) {
55 Object . defineProperty ( exports , "__esModule" , {
66 value : true
77 } ) ;
8- exports . default = exports . Rtrace = void 0 ;
8+ exports . default = exports . Rtrace = exports . TOTAL_OVERHEAD = exports . OBJECT_OVERHEAD = exports . BLOCK_OVERHEAD = void 0 ;
99 // WebAssembly pages are 65536 kb
1010 const PAGE_SIZE_BITS = 16 ;
1111 const PAGE_SIZE = 1 << PAGE_SIZE_BITS ;
@@ -16,6 +16,11 @@ var rtrace = (function(exports) {
1616 const PTR_MASK = PTR_SIZE - 1 ;
1717 const PTR_VIEW = Uint32Array ;
1818 const BLOCK_OVERHEAD = PTR_SIZE ;
19+ exports . BLOCK_OVERHEAD = BLOCK_OVERHEAD ;
20+ const OBJECT_OVERHEAD = 16 ;
21+ exports . OBJECT_OVERHEAD = OBJECT_OVERHEAD ;
22+ const TOTAL_OVERHEAD = BLOCK_OVERHEAD + OBJECT_OVERHEAD ;
23+ exports . TOTAL_OVERHEAD = TOTAL_OVERHEAD ;
1924 const RT_TLSF = "~lib/rt/tlsf/" ;
2025
2126 function assert ( x ) {
You can’t perform that action at this time.
0 commit comments