mirror of
https://github.com/nmap/nmap.git
synced 2026-01-19 20:59:01 +00:00
Use charpool to back string_pool
string_pool (string interning) was using STL strings with lots of extra constructions, when all we need is a const char array. We can use charpool for that and get all the benefits there of tightly-packed heap allocations.
This commit is contained in:
@@ -66,7 +66,9 @@
|
||||
#define CHARPOOL_H
|
||||
|
||||
void *cp_alloc(int sz);
|
||||
char *cp_strdup(const char *src);
|
||||
/* len does not include null terminator */
|
||||
const char *cp_strndup(const char *src, int len);
|
||||
const char *cp_strdup(const char *src);
|
||||
|
||||
void cp_free(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user