208d207
< #include "mem/gems_common/Allocator.hh"
244a244,263
> # ******** Copy constructor ********
> if not self.isGlobal:
> code('${{self.c_ident}}(const ${{self.c_ident}}&other)')
>
> # Call superclass constructor
> if "interface" in self:
> code(' : ${{self["interface"]}}(other)')
>
> code('{')
> code.indent()
>
> for dm in self.data_members.values():
> code('m_${{dm.ident}} = other.m_${{dm.ident}};')
>
> if self.isMessage:
> code('proc_id = other.proc_id;')
>
> code.dedent()
> code('}')
>
273,276c292,294
< # create a static factory method
< if "interface" in self:
< code('''
< static ${{self["interface"]}}*
---
> # create a static factory method and a clone member
> code('''
> static ${{self.c_ident}}*
281d298
< ''')
283,289c300
< # ******** Message member functions ********
< # FIXME: those should be moved into slicc file, slicc should
< # support more of the c++ class inheritance
<
< if self.isMessage:
< code('''
< Message *
---
> ${{self.c_ident}}*
292,293c303
< checkAllocator();
< return s_allocator_ptr->allocate(*this);
---
> return new ${{self.c_ident}}(*this);
295,311d304
<
< void
< destroy()
< {
< checkAllocator();
< s_allocator_ptr->deallocate(this);
< }
<
< static Allocator<${{self.c_ident}}>* s_allocator_ptr;
<
< static void
< checkAllocator()
< {
< if (s_allocator_ptr == NULL) {
< s_allocator_ptr = new Allocator<${{self.c_ident}}>;
< }
< }
417,418d409
< if self.isMessage:
< code('Allocator<${{self.c_ident}}>* ${{self.c_ident}}::s_allocator_ptr = NULL;')