/*-- Rev Header - do NOT edit!
 *
 *  Filename : AddMemToTC_MEMENTRY.c
 *  Purpose  : adds memory allocated by AllocVec or malloc to the memory-list
 *             which is deallocated at program-termination
 *
 *
 *  Program  : -
 *  Author   : Gerhard Müller
 *  Copyright: (c) by Gerhard Müller
 *  Creation : Sun Oct  3 03:03:14 1993
 *
 *  compile  : makefile
 *
 *
 *  Compile version  : 0.1
 *  Ext. Version     : 0.1
 *
 *  REVISION HISTORY
 *
 *  Date       C-Version  E-Version    Comment
 *  ---------  ---------  -----------  -------
 *  3.10.93                            work started
 *
 *
 *
 *-- REV_END --
 */

	/*
	 * C-Includes, C-Definitionen
	 *
	 */

#include <exec/types.h>
#include <exec/ports.h>
#include <exec/memory.h>
#include <exec/execbase.h>
#include <exec/tasks.h>
#include <inline/stubs.h>
#ifdef __OPTIMIZE__
#include <inline/exec.h>
#else
#include <clib/exec_protos.h>
#endif

void AddMemToTC_MEMENTRY(ULONG *rv)
{
	struct MemList *our_mem_list;
	struct Task *our_task = FindTask(0);

	if( (our_mem_list=(struct MemList *)AllocMem(sizeof(struct MemList),MEMF_ANY)))
	{
		our_mem_list->ml_NumEntries=1;
		our_mem_list->ml_ME[0].me_Un.meu_Addr=(APTR)((char *)rv-4);
		our_mem_list->ml_ME[0].me_Length=(*(rv-1));
		AddHead(&(our_task->tc_MemEntry), (struct Node *)our_mem_list);
	}
}
