Bug 401 – add more std.gc APIs, e.g. std.gc.allocatedMemory();

Status
RESOLVED
Resolution
LATER
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2006-10-05T15:22:00Z
Last change time
2015-06-09T01:31:19Z
Assigned to
sean
Creator
someanon

Comments

Comment #0 by someanon — 2006-10-05T15:22:19Z
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.learn&artnum=4775 > I think the std.gc module should also provide some APIs like > > ulong std.gc.allocatedMemory(); // in bytes > ulong std.gc.availableMemory(); > > So we can monitor the memory usage within the program itself. This certainly wouldn't be difficult to implement. Sean
Comment #1 by thomas-dloop — 2007-04-29T04:01:25Z
The data is available via std.gc.getStats allocatedMemory -> usedsize availableMemory -> freelistsize
Comment #2 by andrej.mitrovich — 2014-04-24T15:02:31Z
Is this still being planned to be added? Could it become cumbersome for some GC implementations to expose such an API (e.g. if it's not a O(1) operation but something way more expensive)? If so then maybe it's best not to try exposing such operations.
Comment #3 by andrei — 2014-04-24T17:29:58Z
This looks more like a task than an enhancecement request. @Sean okay to remove it for now?
Comment #4 by sean — 2014-04-24T18:21:34Z
Please do.