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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user