1
0
mirror of https://github.com/deadw00d/AROS.git synced 2025-12-08 14:34:41 +00:00
Files
AROS-v0/compiler/arossupport/nastyfreemem.c
Matthias Rustler 2dd7a55cbf compiler: detabbed
2021-05-02 14:18:58 +02:00

56 lines
1.1 KiB
C

/*
Copyright (C) 1995-2012, The AROS Development Team. All rights reserved.
Desc: Erase contents of memory before freeing it.
*/
#include <proto/exec.h>
#include <aros/system.h>
#include <aros/debug.h>
#include <exec/execbase.h>
#undef FreeMem /* Don't use any kind of macro here :) We want the real thing */
void FreeMem(APTR, IPTR);
extern struct ExecBase * SysBase;
/*****************************************************************************
NAME */
#include <proto/arossupport.h>
void NastyFreeMem (
/* SYNOPSIS */
APTR mem,
IPTR size)
/* FUNCTION
Overwrites the memory with 0xDEADBEEF before actually freeing it.
INPUTS
mem - Pointer which was returned by AllocMem()
size - Size which was given to AllocMem()
RESULT
The function may print some infos using kprintf().
NOTES
This function depends on SysBase.
EXAMPLE
BUGS
SEE ALSO
exec.library/FreeMem()
INTERNALS
******************************************************************************/
{
MUNGE_BLOCK (mem, size, MEMFILL_FREE);
FreeMem (mem, size);
} /* NastyFreeMem */