X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fpool.c;h=3150c9056b2eb8c91b42662fddf2c590263a9455;hb=5204698c0d3a9bd3786d8bd19eba2a1ddbbb4311;hp=7a8a591da58a7e84ebaf6952f784cec17f7571d0;hpb=e99991940478d76062c4ab8e44a5747354e33259;p=pspp diff --git a/src/libpspp/pool.c b/src/libpspp/pool.c index 7a8a591da5..3150c9056b 100644 --- a/src/libpspp/pool.c +++ b/src/libpspp/pool.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2000, 2010 Free Software Foundation, Inc. + Copyright (C) 2000, 2010, 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -96,10 +96,16 @@ union align void (*fp) (void); long l; double d; + + /* glibc jmp_buf on ia64 requires 16-byte alignment. This ensures it. */ + size_t s[2]; }; /* This should be the alignment size used by malloc(). The size of - the union above is correct, if not optimal, in all known cases. */ + the union above is correct, if not optimal, in all known cases. + + This is normally 8 bytes for 32-bit architectures and 16 bytes for 64-bit + architectures. */ #define ALIGN_SIZE sizeof (union align) /* DISCRETE_BLOCKS may be declared as nonzero to prevent @@ -299,7 +305,8 @@ pool_alloc (struct pool *pool, size_t amt) void * pool_alloc_unaligned (struct pool *pool, size_t amt) { - assert (pool != NULL); + if (pool == NULL) + return xmalloc (amt); #ifndef DISCRETE_BLOCKS /* Strings need not be aligned on any boundary, but some