Skip to content

Commit

Permalink
Merge pull request #115 from jelu/doc
Browse files Browse the repository at this point in the history
Doc
  • Loading branch information
jelu authored Aug 16, 2023
2 parents 740a99e + 75283cc commit fdcaee5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To install the dependencies under Debian/Ubuntu:
apt-get install -y zlib1g-dev libmaxminddb-dev
```

To install the dependencies under CentOS (with EPEL enabled):
To install the dependencies under CentOS (with EPEL/PowerTools enabled):
```
yum install -y zlib-devel libmaxminddb-devel
```
Expand Down
6 changes: 2 additions & 4 deletions src/refcountstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
struct RefCountString {
// data
int count;
char data[sizeof(int)]; // this is a dummy, actual array will be larger
char data[];

// implementation
void inc_refcount()
Expand All @@ -50,9 +50,7 @@ struct RefCountString {

static RefCountString* allocate(int data_length)
{
std::size_t size = sizeof(RefCountString) - sizeof(char[sizeof(int)]) + data_length * sizeof(char);

void* chunk = std::calloc(1, size);
void* chunk = std::calloc(1, sizeof(RefCountString) + data_length);
if (!chunk)
throw std::bad_alloc();

Expand Down

0 comments on commit fdcaee5

Please sign in to comment.