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).

!7

sclass ModuleInfo {
  S name;
  long code, data;
}

module ModuleRAMSizes extends DynObjectTable<ModuleInfo> {
  start {
    itemToMap = func(ModuleInfo m) -> Map {
      litorderedmap(
        Name := m.name,
        "Code" := str_toK_questionMarkIfZero(m.code),
        "Data" := str_toK_questionMarkIfZero(m.data))
    };
    doEveryAndNow(60.0, r calcIt);
  }
  
  void calcIt {
    temp enter();
    new L<ModuleInfo> l;
    time "Calculate Module Sizes" {
      for (O mod : dm_listModules()) {
        long code = 0, data = 0;
        pcall-short { code = dm_moduleCodeSize(mod); }
        pcall-short { data = dm_moduleSize(mod); }
        l.add(nu(ModuleInfo,
          name := dm_moduleName(mod),
          +code,
          +data));
      }
    }
    setData(sortedByCalculatedFieldDesc(func(ModuleInfo m) { m.code+m.data }, l));
  }
}

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: 342 / 479
Version history: 1 change(s)
Referenced in: #1018937 - Module RAM Sizes v3 [with transitive code size]