Permalink
Browse files

Merge branch 'master' of github.com:steveicarus/iverilog

  • Loading branch information...
2 parents fbd2843 + 10b5a82 commit cdbfe28c4e4fc6f1705cab7cc8628186a51a51bc @steveicarus committed Jan 3, 2013
Showing with 26 additions and 3 deletions.
  1. +2 −1 vpi/sys_display.c
  2. +14 −1 vvp/class_type.cc
  3. +8 −1 vvp/vpi_scope.cc
  4. +2 −0 vvp/vvp_cleanup.h
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2012 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 1999-2013 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -974,6 +974,7 @@ static char *get_display(unsigned int *rtnsz, const struct strobe_cb_info *info)
free(fmt);
rtn = realloc(rtn, (size+width)*sizeof(char));
memcpy(rtn+size-1, result, width);
+ free(result);
break;
case vpiSysFuncCall:
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 2012-2013 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -20,6 +20,10 @@
# include "class_type.h"
# include "compile.h"
# include "vpi_priv.h"
+# include "config.h"
+#ifdef CHECK_WITH_VALGRIND
+# include "vvp_cleanup.h"
+#endif
# include <cassert>
using namespace std;
@@ -55,6 +59,8 @@ void compile_class_property(unsigned idx, char*nam, char*typ)
{
assert(compile_class);
compile_class->set_property(idx, nam);
+ delete[]nam;
+ delete[]typ;
}
void compile_class_done(void)
@@ -64,3 +70,10 @@ void compile_class_done(void)
scope->classes[compile_class->class_name()] = compile_class;
compile_class = 0;
}
+
+#ifdef CHECK_WITH_VALGRIND
+void class_def_delete(class_type *item)
+{
+ delete item;
+}
+#endif
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 2001-2013 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -116,6 +116,13 @@ static void delete_sub_scopes(struct __vpiScope *scope)
}
}
free(scope->intern);
+
+ /* Clean up any class definitions. */
+ map<std::string, class_type*>::iterator citer;
+ for (citer = scope->classes.begin();
+ citer != scope->classes.end(); ++ citer ) {
+ class_def_delete(citer->second);
+ }
}
void root_table_delete(void)
View
@@ -44,6 +44,7 @@ extern void A_delete(class __vpiHandle *item);
extern void APV_delete(class __vpiHandle *item);
extern void PV_delete(class __vpiHandle *item);
extern void class_delete(class __vpiHandle *item);
+extern void class_def_delete(class_type *item);
extern void constant_delete(class __vpiHandle *item);
extern void contexts_delete(struct __vpiScope *scope);
extern void darray_delete(class __vpiHandle *item);
@@ -62,6 +63,7 @@ extern void exec_ufunc_delete(vvp_code_t euf_code);
extern void vthreads_delete(struct __vpiScope*scope);
extern void vvp_net_delete(vvp_net_t *item);
+
extern void pool_local_net(vvp_net_t *net);
#endif

0 comments on commit cdbfe28

Please sign in to comment.