1 |
/* objalloc.h -- routines to allocate memory for objects |
/* objalloc.h -- routines to allocate memory for objects |
2 |
Copyright 1997 Free Software Foundation, Inc. |
Copyright 1997, 2001 Free Software Foundation, Inc. |
3 |
Written by Ian Lance Taylor, Cygnus Solutions. |
Written by Ian Lance Taylor, Cygnus Solutions. |
4 |
|
|
5 |
This program is free software; you can redistribute it and/or modify it |
This program is free software; you can redistribute it and/or modify it |
56 |
#ifndef offsetof |
#ifndef offsetof |
57 |
#include <stddef.h> |
#include <stddef.h> |
58 |
#endif |
#endif |
|
#define OBJALLOC_ALIGN \ |
|
|
((ptrdiff_t) ((char *) &((struct objalloc_align *) 0)->d - (char *) 0)) |
|
|
#else |
|
|
#define OBJALLOC_ALIGN \ |
|
|
((long) ((char *) &((struct objalloc_align *) 0)->d - (char *) 0)) |
|
59 |
#endif |
#endif |
60 |
|
#ifndef offsetof |
61 |
|
#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) |
62 |
|
#endif |
63 |
|
#define OBJALLOC_ALIGN offsetof (struct objalloc_align, d) |
64 |
|
|
65 |
/* Create an objalloc structure. Returns NULL if malloc fails. */ |
/* Create an objalloc structure. Returns NULL if malloc fails. */ |
66 |
|
|