Cleaner implementation of signed pointers. (#347)
* Cleaner implementation of signed pointers. This encodes a back pointer in each node. The back pointer is stored in an encoded form so that it is hard to corrupt and trick the allocator into following incorrect pointers. This changes the encoding from previously being a Feistel network on the next pointer that was using the prev as part of the key, to now effectively using a doubly linked queue, where the back pointers are scrambled, so it is hard to forge them. This has the positive effects of - Not needing to store previous while building the list, as the append nows, curr and next at the point of writing into next, and does not need an additional previous. - The encoding is not affecting the actual next value, so more instructions can be executed in parallel by the CPU. Future extensions, store a changing key in the FreeListBuilder so it becomes harder to try to forge the previous token. This approach can also be applied to the remote list, and will in a subsequent PR. This enables the idea to be tested. * Remove unused header. * Apply suggestions from code review Co-authored-by: Nathaniel Wesley Filardo <VP331RHQ115POU58JFRLKB7OPA0L18E3@cmx.ietfng.org> Co-authored-by: Nathaniel Wesley Filardo <VP331RHQ115POU58JFRLKB7OPA0L18E3@cmx.ietfng.org>
This commit is contained in:
committed by
GitHub
parent
d0ecba5280
commit
de8ef3efc7
@@ -9,8 +9,6 @@
|
||||
#include "sizeclasstable.h"
|
||||
#include "slaballocator.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace snmalloc
|
||||
{
|
||||
template<typename SharedStateHandle>
|
||||
|
||||
Reference in New Issue
Block a user