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 {
27
27
getMemory ( ) : WebAssembly . Memory ;
28
28
}
29
29
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
+
30
37
export declare class Rtrace {
31
38
[ key : string ] : unknown ; // can be used as a Wasm import
32
39
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ const PTR_SIZE = 1 << PTR_SIZE_BITS;
9
9
const PTR_MASK = PTR_SIZE - 1 ;
10
10
const PTR_VIEW = Uint32Array ;
11
11
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 ;
13
15
14
16
const RT_TLSF = "~lib/rt/tlsf/" ;
15
17
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ var rtrace = (function(exports) {
5
5
Object . defineProperty ( exports , "__esModule" , {
6
6
value : true
7
7
} ) ;
8
- exports . default = exports . Rtrace = void 0 ;
8
+ exports . default = exports . Rtrace = exports . TOTAL_OVERHEAD = exports . OBJECT_OVERHEAD = exports . BLOCK_OVERHEAD = void 0 ;
9
9
// WebAssembly pages are 65536 kb
10
10
const PAGE_SIZE_BITS = 16 ;
11
11
const PAGE_SIZE = 1 << PAGE_SIZE_BITS ;
@@ -16,6 +16,11 @@ var rtrace = (function(exports) {
16
16
const PTR_MASK = PTR_SIZE - 1 ;
17
17
const PTR_VIEW = Uint32Array ;
18
18
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 ;
19
24
const RT_TLSF = "~lib/rt/tlsf/" ;
20
25
21
26
function assert ( x ) {
You can’t perform that action at this time.
0 commit comments