Search the Community
Showing results for tags 'memory manager'.
-
Today, I used the method burst_read() in class uvm_mem_region. passing a dynamic array to it, which had been allocated a size of 100, but burst_read output an array of 0 size. I have checked the source code, and found a problem. The array value[] has a modifier of output, and value.size() in the method will always return 0, because the local value[] never be allocated. I think the modifier should be ref. Anyone know if this is right?
- 1 reply
-
- uvm 1.2
- memory manager
-
(and 1 more)
Tagged with:
-
Dear all, I implemented a memory manager (implementing the tlm_mm_interface interface). However, whenever I use the manager with TLM, I get loads of memory leaks, that seem to be caused by the new in the allocate method. Does anybody know an alternative implementation of this, or does anybody understand how I could avoid the leaks? What am I doing wrong? Best regards, S. #include <systemc.h> #include <tlm.h> class mem_manager : public tlm::tlm_mm_interface{ public: std::vector<tlm::tlm_generic_payload *> free_list; tlm::tlm_generic_payload * allocate(); void free(tlm::tlm_generic_payload *); tlm::tlm_generic_payload * ptr; private: ~mem_manager(); }; mem_manager::~mem_manager(){ } tlm::tlm_generic_payload * mem_manager::allocate(){ if (!free_list.empty()) { ptr = free_list.back(); free_list.pop_back(); cout<<"free list not empty"<<endl; } else { ptr = new tlm::tlm_generic_payload(this); cout<<"free list empty"<<endl; } return ptr; } void mem_manager::free(tlm::tlm_generic_payload * trans){ free_list.push_back((tlm::tlm_generic_payload *)trans); }
- 2 replies
-
- tlm_mm_interface
- memory manager
-
(and 2 more)
Tagged with: