Subject: 0xdeadbeef memory reference
To: 'firstname.lastname@example.org' <email@example.com>
From: Ljubisa Milenkovic <firstname.lastname@example.org>
Date: 07/06/2001 09:20:27
I'm working on a NAT implementation for NetBSD for our specific usage of
NetBSD. I came to a point where I need to ask a kernel question.
After I release memory I allocated, the pointer reference to following
addresses: 0xdeadbeef and 0xdead(xxxx) where xxxx are numbers. Did I release
To allocate memory I use following macros:
#define NEW(t) (t *) malloc ((u_long) sizeof (t), M_TEMP, M_NOWAIT)
/**< Returns a pointer to type t */
#define VNEW(t, n) (t *) malloc ((u_long) n * (u_long) sizeof (t),
M_TEMP, M_NOWAIT) /**< Returns a pointer to array of type t */
And to free:
#define LFREE(t) free (&t, M_TEMP)
/**< Frees the allocated memory */
Is there something wrong with my macros?
I would like to test if the released pointer is free. For that I use a IF
If (pointer != NULL)
But pointer points to 0xdeadbeef and not NULL.
If I set the pointer to point to NULL (after LFREE(p)) is that memory
Thanks for response.
Reddo Networks AB
phone: +46 73 942 24 45