This commit is contained in:
Jeff Becker 2019-05-10 07:49:56 -04:00
parent 018dd008ec
commit 11b9aea4a7
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 3 additions and 4 deletions

View File

@ -29,7 +29,8 @@ namespace llarp
NewPtr()
{
void *ptr = mem->allocate();
return new(ptr) Value_t();
new(ptr) Value_t;
return static_cast<Ptr_t>(ptr);
}
void
@ -94,9 +95,7 @@ namespace llarp
}
}
_allocated.set(_pos);
Value_t *ptr = (Value_t *)&_buffer[_pos * sizeof(Value_t)];
_pos = (_pos + 1) % maxEntries;
return ptr;
return (Value_t *)&_buffer[_pos * sizeof(Value_t)];
}
};