- changed memory allocator functions to own allocator calls

This commit is contained in:
Jan Hutter
2005-11-09 09:11:06 +00:00
parent c1ca1ee042
commit 7953866962
22 changed files with 606 additions and 606 deletions
+10 -10
View File
@@ -1,8 +1,8 @@
/**
* @file packet.h
*
*
* @brief UDP-Packet, contains data, sender and receiver
*
*
*/
/*
@@ -27,9 +27,9 @@ static status_t destroy(packet_t *this)
{
if (this->data.ptr != NULL)
{
pfree(this->data.ptr);
allocator_free(this->data.ptr);
}
pfree(this);
allocator_free(this);
return SUCCESS;
}
@@ -68,12 +68,12 @@ status_t set_source(packet_t *this, char *address, u_int16_t port)
packet_t *packet_create(int family)
{
packet_t *this = alloc_thing(packet_t, "packet_t");
packet_t *this = allocator_alloc_thing(packet_t, "packet_t");
this->destroy = destroy;
this->set_destination = set_destination;
this->set_source = set_source;
this->family = family;
switch (family)
{
@@ -81,11 +81,11 @@ packet_t *packet_create(int family)
this->sockaddr_len = sizeof(struct sockaddr_in);
break;
default: /* not supported */
pfree(this);
return NULL;
allocator_free(this);
return NULL;
}
this->data.len = 0;
this->data.ptr = NULL;
this->data.ptr = NULL;
return this;
}