Permalink
Browse files

Add support for valgrind cleanup of APV in task call.

  • Loading branch information...
1 parent 81ba404 commit 60b1ade52d19e9bc579a8e7e2ce0e73e4f55978f @caryr caryr committed Jan 2, 2013
Showing with 29 additions and 11 deletions.
  1. +12 −1 vvp/array.cc
  2. +8 −7 vvp/vpi_priv.h
  3. +7 −2 vvp/vpi_tasks.cc
  4. +2 −1 vvp/vvp_cleanup.h
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007-2012 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 2007-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
@@ -914,6 +914,11 @@ static int vpi_array_vthr_APV_get(int code, vpiHandle ref)
case vpiAutomatic:
return (int) parent->scope->is_automatic;
+#ifdef CHECK_WITH_VALGRIND
+ case _vpiFromThr:
+ return _vpi_at_APV;
+#endif
+
case vpiConstantSelect:
return 1;
@@ -1946,4 +1951,10 @@ void A_delete(vpiHandle item)
delete obj;
}
+
+void APV_delete(vpiHandle item)
+{
+ struct __vpiArrayVthrAPV*obj = (struct __vpiArrayVthrAPV*) item;
+ delete obj;
+}
#endif
View
@@ -1,7 +1,7 @@
#ifndef __vpi_priv_H
#define __vpi_priv_H
/*
- * 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
@@ -59,12 +59,13 @@ extern vpiHandle vpip_build_file_line(char*description,
*/
#ifdef CHECK_WITH_VALGRIND
#define _vpiFromThr 0x1000001
-# define _vpiNoThr 0
-# define _vpiString 1
-# define _vpiVThr 2
-# define _vpiWord 3
-# define _vpi_at_PV 4
-# define _vpi_at_A 5
+# define _vpiNoThr 0
+# define _vpiString 1
+# define _vpiVThr 2
+# define _vpiWord 3
+# define _vpi_at_PV 4
+# define _vpi_at_A 5
+# define _vpi_at_APV 6
#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
@@ -857,8 +857,13 @@ void vpi_call_delete(vpiHandle item)
}
break;
case vpiMemoryWord:
- if (vpi_get(_vpiFromThr, obj->args[arg]) == _vpi_at_A) {
+ switch (vpi_get(_vpiFromThr, obj->args[arg])) {
+ case _vpi_at_A:
A_delete(obj->args[arg]);
+ break;
+ case _vpi_at_APV:
+ APV_delete(obj->args[arg]);
+ break;
}
break;
case vpiPartSelect:
View
@@ -1,7 +1,7 @@
#ifndef __vvp_cleanup_H
#define __vvp_cleanup_H
/*
- * Copyright (c) 2009-2012 Cary R. (cygcary@yahoo.com)
+ * Copyright (c) 2009-2013 Cary R. (cygcary@yahoo.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
@@ -41,6 +41,7 @@ extern void vvp_net_pool_delete(void);
extern void ufunc_pool_delete(void);
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 constant_delete(class __vpiHandle *item);

0 comments on commit 60b1ade

Please sign in to comment.