Add support for valgrind cleanup of APV in task call.

This commit is contained in:
Cary R 2013-01-01 16:52:50 -08:00
parent 81ba40456f
commit 60b1ade52d
4 changed files with 29 additions and 11 deletions

View File

@ -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 File

@ -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
@ -65,6 +65,7 @@ extern vpiHandle vpip_build_file_line(char*description,
# define _vpiWord 3
# define _vpi_at_PV 4
# define _vpi_at_A 5
# define _vpi_at_APV 6
#endif

View File

@ -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 File

@ -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);