summaryrefslogtreecommitdiffstats
path: root/lib/libstand/zalloc.c
diff options
context:
space:
mode:
authoravatar <avatar@FreeBSD.org>2011-07-10 07:25:34 +0000
committeravatar <avatar@FreeBSD.org>2011-07-10 07:25:34 +0000
commitde81e76acbf0a83607cad211431cd0cc9538007a (patch)
tree88960d5ccb777573dddd5c69d68bad3af01c8997 /lib/libstand/zalloc.c
parentdb822870d75a60b6d4bff7a2f77202322076e66d (diff)
downloadFreeBSD-src-de81e76acbf0a83607cad211431cd0cc9538007a.zip
FreeBSD-src-de81e76acbf0a83607cad211431cd0cc9538007a.tar.gz
- Removing some unneeded definitions of NULL(cruft related to 1970's C).
In C90, NULL is guaranteed to be declared in <stddef.h> and also in <string.h>. Though the correct way to define NULL in FreeBSD is to include <sys/_null.h>, other parts of libstand still require <string.h> to build; therefore, we keep <string.h> in stand.h and add a note about this; - Removing no longer used 'Prototype' definition. Quote from bde@: 'Cruft related to getting incomplete struct declarations within prototypes forward-declared before the structs. It doesn't mean "prototype" but only part of a prototype-related hack. No longer used.' - Replacing iaddr_t with uintptr_t; - Removing use of long double to determine alignment. Use a fixed 16 byte alignment instead; Reviewed by: bde Obtained from: DragonFlyBSD (partially) MFC after: 1 month
Diffstat (limited to 'lib/libstand/zalloc.c')
-rw-r--r--lib/libstand/zalloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libstand/zalloc.c b/lib/libstand/zalloc.c
index f726c2e..41aef0d 100644
--- a/lib/libstand/zalloc.c
+++ b/lib/libstand/zalloc.c
@@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$");
*/
void *
-znalloc(MemPool *mp, iaddr_t bytes)
+znalloc(MemPool *mp, uintptr_t bytes)
{
/*
* align according to pool object size (can be 0). This is
@@ -136,7 +136,7 @@ znalloc(MemPool *mp, iaddr_t bytes)
*/
void
-zfree(MemPool *mp, void *ptr, iaddr_t bytes)
+zfree(MemPool *mp, void *ptr, uintptr_t bytes)
{
/*
* align according to pool object size (can be 0). This is
@@ -153,7 +153,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t bytes)
if ((char *)ptr < (char *)mp->mp_Base ||
(char *)ptr + bytes > (char *)mp->mp_End ||
- ((iaddr_t)ptr & MEMNODE_SIZE_MASK) != 0)
+ ((uintptr_t)ptr & MEMNODE_SIZE_MASK) != 0)
panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes);
/*
@@ -245,7 +245,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t bytes)
*/
void
-zextendPool(MemPool *mp, void *base, iaddr_t bytes)
+zextendPool(MemPool *mp, void *base, uintptr_t bytes)
{
if (mp->mp_Size == 0) {
mp->mp_Base = base;
OpenPOWER on IntegriCloud