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
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: someanon@yahoo.com

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 someanon@yahoo.com  2009-01-15 17:10 -------
and more fun:

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

according to: http://digitalmars.com/d/2.0/changelog.html#new2_020
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

sean@invisibleduck.org changed:

           What    |Removed                     |Added
         AssignedTo|bugzilla@digitalmars.com    |sean@invisibleduck.org

------- Comment #2 from sean@invisibleduck.org  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 <yebblies@gmail.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies@gmail.com
         Resolution|                            |FIXED

--- Comment #3 from yebblies <yebblies@gmail.com> 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home