Leopold Toetsch <[EMAIL PROTECTED]> writes: > In perl.perl6.internals, you wrote: > > Leopold Toetsch <[EMAIL PROTECTED]> writes: > > >> As long as packfile functions don't allocate memory (besides their > >> own structures) it doesn't matter very much. Nethertheless, when > >> doing changes I would include an interpreter param. > > > I wonder if 'interpreter' is fast becoming the wrong name for the > > thing you're passing around (at least from the point of view of > > functions like the bytecode generator where you're only really using > > the thing as a memory manager.)
The memory subsytem can be factored out of the interpreter. Each interpreter will have one memory subsystem. > Yep. I wrote (or a void* argument), though I don't know, how these > functions would know, what this argument really is. Maybe callback > functions would be a better choice, so that byte code generators could > better communicate with packout. > > WRT memory manager, why not but packfile functions don't need one. The packfile functions allways need to have a memory manager. This is at the moment a very simple one: The memory is allocated directly from the system and is managed there, when the packfile is destroyed all associated memory will be destroyed also. This is not a very clever management, but a management. The problem starts when the memory comes from a diffrent source, e.g if a compiler uses Buffers and garbage-collection for intermediate storage of bytecode, which then is entered into the packfile. Who is responsible for destroying the Memory? These kind of problems arise at all interfaces between memory systems. Some evil idea just comes up my mind: Why is the packfile not yet an other PMC? The memory is simply managed by the interpreter, the individual chunks/segments/sections are simple keyed access functions. I must think a little more about this. bye b. -- Juergen Boemmels [EMAIL PROTECTED] Fachbereich Physik Tel: ++49-(0)631-205-2817 Universitaet Kaiserslautern Fax: ++49-(0)631-205-3906 PGP Key fingerprint = 9F 56 54 3D 45 C1 32 6F 23 F6 C7 2F 85 93 DD 47