I need to pass around some objects(specifically int[]) that may
be used by several other objects at the same time. While I could
clone these and free them when the parent object is done this
wastes memory for no real reason except ease of use.
Since many objects may contain a ptr to the array,
On 10-Sep-11 3:09 PM, Jonathan M Davis wrote:
Jonathan M Davis
Ok, now I have a better idea with char pointers. And the std.conv.to
worked too. Thanks.
- Joelcnz
On Saturday, September 10, 2011 13:00:02 Joel Christensen wrote:
> Hi,
>
> In the std.string document at toStringz it has this note:
>
> Important Note: When passing a char* to a C function, and the C function
> keeps it around for any reason, make sure that you keep a reference to
> it in your D
Hi,
In the std.string document at toStringz it has this note:
Important Note: When passing a char* to a C function, and the C function
keeps it around for any reason, make sure that you keep a reference to
it in your D code. Otherwise, it may go away during a garbage collection
cycle and caus
Thank you for your reply. It was helpful.
JMRyan:
> In theory, garbage collectors make memory leaks a thing of the past.
Even with a perfect GC you may leave around references that keep alive some
data that you will never need to use. This is a kind of memory leak.
And the current D GC is not fully precise, this means that sometimes it
In theory, garbage collectors make memory leaks a thing of the past. In
practice, garbage collectors don't always work according to theory. This
makes me curious: how does one test for memory leaks in a D program?
I also don't know how smart or dumb garbage collectors are. How much help
doe
Some of the examples at
http://digitalmars.com/d/2.0/memory.html
seem to be outdated:
- dmd 2.046 does not have std.outofmemory. Where is OutOfMemoryException
defined?
- no std.gc: (I found out later that core.memory is it)
Where can I learn more about the current features on memory
101 - 108 of 108 matches
Mail list logo