mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Align blocks to 2 * sizeof(size_t) in charpool.c. This is what Glibc's malloc
does.
This commit is contained in:
parent
278baafd04
commit
0e5ba41d15
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue