A couple of questions:
1: Even though D has an automatic garbage collector, is one still
allowed to free the memory of a malloced array manually (using free
() ), to avoid pauses in the program?
2: One justification on the website for using automatic garbage
collection is how "allocated memory wi
Reply to Dan,
A couple of questions:
1: Even though D has an automatic garbage collector, is one still
allowed to free the memory of a malloced array manually (using free ()
), to avoid pauses in the program?
Yes, in fact if you malloc memory you MUST free it. Only stuff like dynamic
arrays
Dan W:
> 1: Even though D has an automatic garbage collector, is one still
> allowed to free the memory of a malloced array manually (using free
> () ), to avoid pauses in the program?
Other people here will just answer your question. But remember that in D manual
memory management is done only i
Thanks for that reply. I wonder if extending automatic garbage
collection for malloced memory would be a good idea...
> Only stuff like dynamic
> arrays, AAs and new'ed stuff gets cleaned up by the GC.
For the above types of allocating memory, is there a way to 'lock' a
variable and say to D, "d
"Daniel White" wrote
> Thanks for that reply. I wonder if extending automatic garbage
> collection for malloced memory would be a good idea...
>
>> Only stuff like dynamic
>> arrays, AAs and new'ed stuff gets cleaned up by the GC.
>
> For the above types of allocating memory, is there a way to 'loc
On Tue, Dec 9, 2008 at 9:16 AM, Daniel White <[EMAIL PROTECTED]> wrote:
> Thanks for that reply. I wonder if extending automatic garbage
> collection for malloced memory would be a good idea...
That would be a bad idea. Then how would you do manual memory
management in the few cases that absolute
On Tue, Dec 9, 2008 at 9:42 AM, Jarrett Billingsley
<[EMAIL PROTECTED]> wrote:
> On Tue, Dec 9, 2008 at 9:16 AM, Daniel White <[EMAIL PROTECTED]> wrote:
>> Thanks for that reply. I wonder if extending automatic garbage
>> collection for malloced memory would be a good idea...
>
> That would be a ba
> That would be a bad idea. Then how would you do manual memory
> management in the few cases that absolutely require it?
Two ways. Either:
a: being able to lock the variable so that the garbage collector
can't touch it until you unlock it.
b: Using a slightly different version of malloc (say '
On Tue, Dec 9, 2008 at 11:08 AM, Daniel White <[EMAIL PROTECTED]> wrote:
>> That would be a bad idea. Then how would you do manual memory
>> management in the few cases that absolutely require it?
>
> Two ways. Either:
>
> a: being able to lock the variable so that the garbage collector
> can't to
Jarrett Billingsley Wrote:
> On Tue, Dec 9, 2008 at 11:08 AM, Daniel White <[EMAIL PROTECTED]> wrote:
> >> That would be a bad idea. Then how would you do manual memory
> >> management in the few cases that absolutely require it?
> >
> > Two ways. Either:
> >
> > a: being able to lock the variabl
On Tue, Dec 9, 2008 at 2:53 PM, Daniel White <[EMAIL PROTECTED]> wrote:
> Jarrett Billingsley Wrote:
>
>> On Tue, Dec 9, 2008 at 11:08 AM, Daniel White <[EMAIL PROTECTED]> wrote:
>> >> That would be a bad idea. Then how would you do manual memory
>> >> management in the few cases that absolutely r
Daniel White wrote:
That would be a bad idea. Then how would you do manual memory
management in the few cases that absolutely require it?
Two ways. Either:
a: being able to lock the variable so that the garbage collector
can't touch it until you unlock it.
If you have a reference to the mem
Steven Schveighoffer:
> One thing you can do, that nobody has mentioned yet, is delete memory that
> you have allocated using the GC.
Leaving the GC manage and free your memory is usually OK. Managing manually
your memory allocated from the C heap is doable. But freeing manually and
forcefully
Tue, 9 Dec 2008 03:25:07 + (UTC), Dan W wrote:
> 1: Even though D has an automatic garbage collector, is one still
> allowed to free the memory of a malloced array manually (using free
> () ), to avoid pauses in the program?
Just to clarify. There are 3 types of allocation:
1. std.c.stdlib
14 matches
Mail list logo