NativeCall and memory management

2016-08-30 Thread Gianni Ceccarelli
Hello all! I'm trying to figure out how the NativeCall interface releases memory for objects with native representation, and I could use some help. For what I can see: * CPointer never frees anything https://github.com/MoarVM/MoarVM/blob/master/src/6model/reprs/CPointer.c#L148 * CStr always fre

NativeCall and memory management

2016-08-30 Thread Gianni Ceccarelli
Hello all! I'm trying to figure out how the NativeCall interface releases memory for objects with native representation, and I could use some help. For what I can see: * CPointer never frees anything https://github.com/MoarVM/MoarVM/blob/master/src/6model/reprs/CPointer.c#L148 * CStr always fre

[Parrot] New comment on Memory Management in PIRC.

2008-11-30 Thread Justin
Justin has left a new comment on your post "Memory Management in PIRC": APR is the Apache Runtime library. It's centered around the idea that all allocations are done for some specific request/task and that most (or even all) of that memory will be needed for the duration of th

[Parrot] New comment on Memory Management in PIRC.

2008-11-30 Thread Justin
Justin has left a new comment on your post "Memory Management in PIRC": That's one way to do it. Why not the APR way of things? Creating memory pools in which memory can only be allocated (not freed) and after each step is finished you simpy reclaim the entire pool (no fragmentat

[Parrot] New comment on Memory Management in PIRC.

2008-11-30 Thread kjs
kjs has left a new comment on your post "Memory Management in PIRC": Justin, thanks for sharing your thoughts. I'm not sure what "APR" way of things is.. Creating memory pools and reclaiming the pool after each step: all allocated memory is needed till the end of the c

Re: [PATCH] multiarray memory management

2002-10-22 Thread Steve Fink
On Oct-22, Steve Fink wrote: > On Mon, Oct 21, 2002 at 08:05:32PM +0200, Peter Gibbs wrote: > > The last one looks like a fundamental problem in MultiArray. > > The line > > b->cell_buffer = new_buffer_header(interpreter); > > in function new_marray is creating a new buffer header, overwriting > >

[PATCH] multiarray memory management

2002-10-21 Thread Steve Fink
On Mon, Oct 21, 2002 at 08:05:32PM +0200, Peter Gibbs wrote: > The last one looks like a fundamental problem in MultiArray. > The line > b->cell_buffer = new_buffer_header(interpreter); > in function new_marray is creating a new buffer header, overwriting > the new_bufferlike_header created earlie

Re: Of PMCs Buffers and memory management

2002-09-29 Thread Leopold Toetsch
Mike Lambert wrote: > http:[EMAIL PROTECTED]/msg11553.html Thanks for this. I must have missed some parts of this discussion on the list. Aligning the header pools could be an interesting approach, since now a considerable amount of time is spent to determine if a pointer on the sysem stack

Re: Of PMCs Buffers and memory management

2002-09-29 Thread Mike Lambert
> >>First and foremost, is there any compelling reason, to have totally > >>different structures for PMCs and Buffers? > >>- Both have a ->data aka ->bufstart > >>- Both have ->flags, that have vastly the same meaning. > >> > > > > As jason said in another message, Dan has changed his mind from >

Re: Of PMCs Buffers and memory management

2002-09-29 Thread Leopold Toetsch
Mike Lambert wrote: [ Unifying Buffer and PMC ] > As jason said in another message, Dan has changed his mind from > yesteryear, and decided that buffers and pmcs should be the same > structure. Roadmap --- 1) Hide Buffer and PMC internals, namely - buflen - bufstart - flags

Re: Of PMCs Buffers and memory management

2002-09-28 Thread Leopold Toetsch
Mike Lambert wrote: >>First and foremost, is there any compelling reason, to have totally >>different structures for PMCs and Buffers? >>- Both have a ->data aka ->bufstart >>- Both have ->flags, that have vastly the same meaning. >> > > As jason said in another message, Dan has changed his mind

Re: Of PMCs Buffers and memory management

2002-09-27 Thread Mike Lambert
> First and foremost, is there any compelling reason, to have totally > different structures for PMCs and Buffers? > - Both have a ->data aka ->bufstart > - Both have ->flags, that have vastly the same meaning. As jason said in another message, Dan has changed his mind from yesteryear, and decide

Re: Of PMCs Buffers and memory management

2002-09-27 Thread Jason Gloudon
On Fri, Sep 27, 2002 at 09:28:41AM +0200, Leopold Toetsch wrote: > First and foremost, is there any compelling reason, to have totally > different structures for PMCs and Buffers? The reasons stopped being compelling about a month or two ago, when it was decided to unify the two. No one has had

Of PMCs Buffers and memory management

2002-09-27 Thread Leopold Toetsch
I have some questions and suggestions regarding PMCs, Buffers and memory management/internal data structures. First and foremost, is there any compelling reason, to have totally different structures for PMCs and Buffers? - Both have a ->data aka ->bufstart - Both have ->flags, that ha

Re: More memory management changes

2002-05-20 Thread Steve Fink
Ok, this is now obsolete. I was too slow, I guess. :-) The following patch (1) is no longer needed because Peter's new version has already been committed, and (2) fails to pass a stacks.t test. But in case we want to keep the neonate counters, here's an updated version of Peter's original neonate

[APPLIED] Re: More memory management changes

2002-05-19 Thread Steve Fink
On Sat, May 18, 2002 at 06:58:40PM -0400, Dan Sugalski wrote [to P. Gibbs]: > Did we get you commit privs? If so, commit it. If not, get me your > perl.org login and I'll get it taken care of. In the meantime, I committed that patch.

Re: More memory management changes

2002-05-18 Thread Dan Sugalski
y the extra space in string headers for a start of string in addition to a start of buffer, and since the only things that care about it live in string.c, that's fine. So go ahead--I expect it may make COW a bit easier. >Once the latest memory management patch is in, I will resync and su

Re: More memory management changes

2002-05-18 Thread Peter Gibbs
compact_string_pool very cumbersome, and the performance was several percent slower than my current implementation. Once the latest memory management patch is in, I will resync and submit the COW code as a separate patch, and we'll see what everybody thinks about it. I have just done a benchmark

Re: More memory management changes

2002-05-18 Thread Dan Sugalski
At 10:29 AM -0700 5/18/02, Steve Fink wrote: >On Sat, May 18, 2002 at 12:18:14PM -0400, Dan Sugalski wrote: >> At 9:53 PM +0200 5/15/02, Peter Gibbs wrote: >> >The attached patch is the next set of proposed changes to the memory >> >management routines, with the

Re: More memory management changes

2002-05-18 Thread Steve Fink
On Sat, May 18, 2002 at 12:18:14PM -0400, Dan Sugalski wrote: > At 9:53 PM +0200 5/15/02, Peter Gibbs wrote: > >The attached patch is the next set of proposed changes to the memory > >management routines, with the copy-on-write logic removed. > > Peter, did these go in? I

Re: More memory management changes

2002-05-18 Thread Dan Sugalski
At 9:53 PM +0200 5/15/02, Peter Gibbs wrote: >The attached patch is the next set of proposed changes to the memory >management routines, with the copy-on-write logic removed. Peter, did these go in? -- Dan -

Re: More memory management changes

2002-05-15 Thread Steve Fink
icated code for the free_pool_buffers. But your patch is a *much* better way of doing that part. Mostly, I didn't want to make any major changes without the buy-in of the head memory management guys (which primarily means you at the moment.) I've finally managed to get a grip on the differen

More memory management changes

2002-05-15 Thread Peter Gibbs
The attached patch is the next set of proposed changes to the memory management routines, with the copy-on-write logic removed. Performance numbers on my 166-MHz Pentium (linux 2.2.18) for 5000-generation life.pasm are: Current CVS - 50.41 generations/second With this patch - 57.40 With COW

Re: [APPLIED] Re: Memory management revamp - phase 2

2002-05-05 Thread Jeff
Steve Fink wrote: > > On Sun, May 05, 2002 at 08:43:17PM -0700, Steve Fink wrote: > > On Sat, May 04, 2002 at 11:14:06PM -0400, Jeff wrote: > > > Daniel Grunblatt wrote: > > > > > > > > On Sat, 4 May 2002, Steve Fink wrote: > > > > > > > > > Applied, with one change: the alignments of the three p

Re: [APPLIED] Re: Memory management revamp - phase 2

2002-05-05 Thread Steve Fink
On Sun, May 05, 2002 at 08:43:17PM -0700, Steve Fink wrote: > On Sat, May 04, 2002 at 11:14:06PM -0400, Jeff wrote: > > Daniel Grunblatt wrote: > > > > > > On Sat, 4 May 2002, Steve Fink wrote: > > > > > > > Applied, with one change: the alignments of the three pools are now > > > > #defined. >

Re: [APPLIED] Re: Memory management revamp - phase 2

2002-05-05 Thread Steve Fink
On Sat, May 04, 2002 at 11:14:06PM -0400, Jeff wrote: > Daniel Grunblatt wrote: > > > > On Sat, 4 May 2002, Steve Fink wrote: > > > > > Applied, with one change: the alignments of the three pools are now > > > #defined. > > > > > > > I believe your commit was incomplete. > > I'd have to agree.

Re: [APPLIED] Re: Memory management revamp - phase 2

2002-05-05 Thread Jeff
Peter Gibbs wrote: > > Mike Lambert wrote: > > Wow. Tinderbox gave us fall and spring in a few hour period. Nice. Here's > > a patch to help make us make it to summer again. > > Steve actually pointed out that this style of code was not safe, but I still > managed to miss that one. > > > -

Re: [APPLIED] Re: Memory management revamp - phase 2

2002-05-04 Thread Peter Gibbs
Mike Lambert wrote: > Wow. Tinderbox gave us fall and spring in a few hour period. Nice. Here's > a patch to help make us make it to summer again. Steve actually pointed out that this style of code was not safe, but I still managed to miss that one. > -(char *)cur_buffer += pool->unit_si

Re: [APPLIED] Re: Memory management revamp - phase 2

2002-05-04 Thread Mike Lambert
> Commit completed. One thing I find handy when patching is to run a CVS > update, make distclean, and rebuild/retest on my local platform. This > helps catch misapplied and incomplete patches. Wow. Tinderbox gave us fall and spring in a few hour period. Nice. Here's a patch to help make us make

Re: [APPLIED] Re: Memory management revamp - phase 2

2002-05-04 Thread Jeff
Jeff wrote: > > Daniel Grunblatt wrote: > > > > On Sat, 4 May 2002, Steve Fink wrote: > > > > > Applied, with one change: the alignments of the three pools are now > > > #defined. > > > > > > > I believe your commit was incomplete. Commit completed. One thing I find handy when patching is to run

Re: [APPLIED] Re: Memory management revamp - phase 2

2002-05-04 Thread Jeff
Daniel Grunblatt wrote: > > On Sat, 4 May 2002, Steve Fink wrote: > > > Applied, with one change: the alignments of the three pools are now > > #defined. > > > > I believe your commit was incomplete. I'd have to agree. Some of the code appears to use 'last_PMC_Arena', which isn't defined yet i

Re: [APPLIED] Re: Memory management revamp - phase 2

2002-05-04 Thread Daniel Grunblatt
On Sat, 4 May 2002, Steve Fink wrote: > Applied, with one change: the alignments of the three pools are now > #defined. > I believe your commit was incomplete.

[APPLIED] Re: Memory management revamp - phase 2

2002-05-04 Thread Steve Fink
Applied, with one change: the alignments of the three pools are now #defined.

Re: Memory management revamp - phase 2

2002-05-04 Thread Peter Gibbs
Steve Fink wrote: > > Why use 2-byte alignment on constant strings? Wouldn't it speed up > memory copies to make them always be 4-byte aligned? (Or > machine-register-size aligned?) Changed to 4-byte alignment for now. If there is a specific sizeof(X) you would prefer, just change it. > 1. Can y

Re: Memory management revamp - phase 2

2002-05-03 Thread Steve Fink
On Fri, May 03, 2002 at 04:57:37PM +0200, Peter Gibbs wrote: > Attached is the second set of patches for the tracked resource memory > management system. > > Features: > Separate memory pools for buffers, normal strings, constant strings; the > latter is never compacted >

Memory management revamp - phase 2

2002-05-03 Thread Peter Gibbs
Attached is the second set of patches for the tracked resource memory management system. Features: Separate memory pools for buffers, normal strings, constant strings; the latter is never compacted Each pool has its own alignment; these are currently set to 16, 4 and 2 respectively; suggestions

Re: [APPLIED] Memory management bugs

2002-04-28 Thread Steve Fink
On Sat, Apr 27, 2002 at 05:06:08PM -0400, Mike Lambert wrote: > > For (1), maybe we should add an opcode: get_number_of_live_objects? > > Then you could write a test case that records the number of live > > objects, does stuff, forces a sweep and collect, and checks that the > > saved number + #ex

Re: [APPLIED] Memory management bugs

2002-04-27 Thread Mike Lambert
> For (1), maybe we should add an opcode: get_number_of_live_objects? > Then you could write a test case that records the number of live > objects, does stuff, forces a sweep and collect, and checks that the > saved number + #expected live objects is equal to the currently live > number? I agree

Re: [APPLIED] Memory management bugs

2002-04-27 Thread Steve Fink
On Sat, Apr 27, 2002 at 12:30:56PM -0700, Steve Fink wrote: > For (1), maybe we should add an opcode: get_number_of_live_objects? > Then you could write a test case that records the number of live > objects, does stuff, forces a sweep and collect, and checks that the > saved number + #expected liv

[APPLIED] Memory management bugs

2002-04-27 Thread Steve Fink
I'll paste a diff -ub below to show the changes without the reindentation noise. I am about to commit a patch that: - Fixes a bit test bug, changing to bits == (bitA | bitB) from bits == (bitA & bitB)) - Count of elements in an array of PMCs was wrong. It was looping over PMC*

Memory management!

2001-10-22 Thread Dan Sugalski
Okay folks, a quick heads up. *Any* function in the parrot core that allocates a parrot-managed structure (such as a string or PMC) *must* have a valid interpreter structure hanging around. I'm in the middle of rejigging everything so we can start allocating PMCs & string structures, and prope