eCosPro® Reference Manual
Prev |  | Next

# netbuf_delete()

## Name

netbuf_delete() -- Deallocate a netbuf structure

## Synopsis

``void netbuf_delete`(struct netbuf *);`

## Description

Deallocates a netbuf structure previously allocated by a call to the `netbuf_new()` function. Any buffer memory allocated to the netbuf by calls to `netbuf_alloc()` is also deallocated.

## Example

Example 4-1. This example shows the basic mechanisms for using netbufs.

    int
    main()
    {
        struct netbuf *buf;
        buf = netbuf_new();     /* create a new netbuf */
        netbuf_alloc(buf, 100); /* allocate 100 bytes of buffer */

        /* do something with the netbuf */
        /* [...] */
        netbuf_delete(buf); /* deallocate netbuf */
    }

Prev | Home | Next
netbuf_new() | Up | netbuf_alloc()