wip commit. acpi button driver.
[AROS.git] / compiler / arossupport / nastyfreemem.c
blobd0c29fd87a2a6a88e70916c1996b82b47978e610
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Erase contents of memory before freeing it.
6 Lang: english
7 */
9 #include <proto/exec.h>
10 #include <aros/system.h>
11 #include <aros/debug.h>
12 #include <exec/execbase.h>
14 #undef FreeMem /* Don't use any kind of macro here :) We want the real thing */
15 void FreeMem(APTR, IPTR);
18 extern struct ExecBase * SysBase;
20 /*****************************************************************************
22 NAME */
23 #include <proto/arossupport.h>
25 void NastyFreeMem (
27 /* SYNOPSIS */
28 APTR mem,
29 IPTR size)
31 /* FUNCTION
32 Overwrites the memory with 0xDEADBEEF before actually freeing it.
34 INPUTS
35 mem - Pointer which was returned by AllocMem()
36 size - Size which was given to AllocMem()
38 RESULT
39 The function may print some infos using kprintf().
41 NOTES
42 This function depends on SysBase.
44 EXAMPLE
46 BUGS
48 SEE ALSO
49 exec.library/FreeMem()
51 INTERNALS
53 ******************************************************************************/
55 MUNGE_BLOCK (mem, size, MEMFILL_FREE);
56 FreeMem (mem, size);
57 } /* NastyFreeMem */