Thread overview
[Issue 2586] New: broken import gcstats
Jan 15, 2009
Jan 15, 2009
Jan 16, 2009
Jun 10, 2011
January 15, 2009

           Summary: broken import gcstats
           Product: D
           Version: 2.023
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

the file is in dmd-v2.023/src/druntime/src/gc/basic/gcstats.d and declared: module gc.gcstats;

However, if I do:
import gc.gcstats;

dmd says: module gcstats cannot read file 'gc/gcstats.d'

if I do:

import gcstats;

dmd says: module gcstats cannot read file 'gcstats.d'

So how do I import gcstats?


January 15, 2009

------- Comment #1 from  2009-01-15 17:10 -------
and more fun:

previously I call: std.gc.getStats(...);

according to:
from  to
std.gc.*()  memory.gc_*()

I tried: memory.gc_getStats(gs);
it says: Error: undefined identifier memory

I tried: core.memory.gc_getStats(gs);
it says: Error: undefined identifier module memory.gc_getStats

I tried: core.memory.gc.getStats(gs);
it says: Error: undefined identifier module memory.gc

I tried: core.memory.getStats(gs);
it says: Error: undefined identifier module memory.getStats

Come on!!!!! is the release package really tested? or the doc accurate at all?


January 16, 2009 changed:

           What    |Removed                     |Added
         AssignedTo|    |

------- Comment #2 from  2009-01-16 11:23 -------
Since that module isn't in the import directory, it should be clear that it's not intended to be externally visible.  GC stats have yet to be formally defined in druntime, so there is no public interface for accessing them.  You can obtain them manually via:

struct GCStats
    size_t poolsize;        // total size of pool
    size_t usedsize;        // bytes allocated
    size_t freeblocks;      // number of blocks marked FREE
    size_t freelistsize;    // total of memory on free lists
    size_t pageblocks;      // number of blocks marked PAGE
extern (C) GCStats gc_stats();
auto s = gc_stats();

But be aware that the structure of GCStats may change.


June 10, 2011

yebblies <> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |
         Resolution|                            |FIXED

--- Comment #3 from yebblies <> 2011-06-10 07:17:24 PDT ---
The package.module now matches the directory and file name, so this would work if you added the right directories to the import path.

Configure issuemail:
------- You are receiving this mail because: -------