2016-11-24 19:35:26 +00:00
|
|
|
#include <stdlib.h>
|
2010-10-02 21:52:29 +00:00
|
|
|
#include <em_abs.h>
|
2018-06-17 20:30:27 +00:00
|
|
|
#include "pc.h"
|
2010-10-02 21:52:29 +00:00
|
|
|
|
2016-11-24 19:35:26 +00:00
|
|
|
void _new(int n, void** ptr)
|
2010-10-02 21:52:29 +00:00
|
|
|
{
|
2016-11-24 19:35:26 +00:00
|
|
|
void* p = malloc(n);
|
|
|
|
if (!p)
|
|
|
|
_trp(EHEAP);
|
2010-10-02 21:52:29 +00:00
|
|
|
|
2016-11-24 19:35:26 +00:00
|
|
|
*ptr = p;
|
|
|
|
}
|
2010-10-02 21:52:29 +00:00
|
|
|
|
2016-11-24 19:35:26 +00:00
|
|
|
void _dis(int n, void** ptr)
|
2010-10-02 21:52:29 +00:00
|
|
|
{
|
2016-11-24 19:35:26 +00:00
|
|
|
free(*ptr);
|
|
|
|
*ptr = NULL;
|
|
|
|
}
|