Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

35
LINES

< > BotCompany Repo | #1018932 // Module RAM Sizes v2 [with code size]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (15732L/110K).

1  
!7
2  
3  
sclass ModuleInfo {
4  
  S name;
5  
  long code, data;
6  
}
7  
8  
module ModuleRAMSizes extends DynObjectTable<ModuleInfo> {
9  
  start {
10  
    itemToMap = func(ModuleInfo m) -> Map {
11  
      litorderedmap(
12  
        Name := m.name,
13  
        "Code" := str_toK_questionMarkIfZero(m.code),
14  
        "Data" := str_toK_questionMarkIfZero(m.data))
15  
    };
16  
    doEveryAndNow(60.0, r calcIt);
17  
  }
18  
  
19  
  void calcIt {
20  
    temp enter();
21  
    new L<ModuleInfo> l;
22  
    time "Calculate Module Sizes" {
23  
      for (O mod : dm_listModules()) {
24  
        long code = 0, data = 0;
25  
        pcall-short { code = dm_moduleCodeSize(mod); }
26  
        pcall-short { data = dm_moduleSize(mod); }
27  
        l.add(nu(ModuleInfo,
28  
          name := dm_moduleName(mod),
29  
          +code,
30  
          +data));
31  
      }
32  
    }
33  
    setData(sortedByCalculatedFieldDesc(func(ModuleInfo m) { m.code+m.data }, l));
34  
  }
35  
}

Author comment

Began life as a copy of #1018920

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018932
Snippet name: Module RAM Sizes v2 [with code size]
Eternal ID of this version: #1018932/2
Text MD5: 1bbad8d0ac595eea36b1e7422f6284ae
Transpilation MD5: ae80fdaca4b8da1e8f79db30fc9c3fa2
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-16 01:40:28
Source code size: 883 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 343 / 481
Version history: 1 change(s)
Referenced in: [show references]