1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 03:49:01 +00:00

Align blocks to 2 * sizeof(size_t) in charpool.c. This is what Glibc's malloc

does.
This commit is contained in:
david
2007-11-13 01:17:39 +00:00
parent 278baafd04
commit 0e5ba41d15

View File

@@ -99,6 +99,8 @@
/* $Id$ */
#include <stddef.h>
#include "nbase.h"
/* Character pool memory allocation */
@@ -110,7 +112,10 @@ static int currentcharpool;
static int currentcharpoolsz;
static char *nextchar;
#define ALIGN_ON sizeof(char *)
/* Allocated blocks are allocated to multiples of ALIGN_ON. This is the
definition used by the malloc in Glibc 2.7, which says that it "suffices for
nearly all current machines and C compilers." */
#define ALIGN_ON (2 * sizeof(size_t))
static int cp_init(void) {
static int charpool_initialized = 0;