Skip to content

Commit

Permalink
Use const adding template
Browse files Browse the repository at this point in the history
  • Loading branch information
mjp41 committed Jun 12, 2024
1 parent 4da5b35 commit 6c90e21
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/snmalloc/backend_helpers/commonconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ namespace snmalloc
{
using StorageType = Empty;
using DataRef = Empty&;
using ConstDataRef = const Empty&;

static size_t required_count(size_t)
{
Expand All @@ -117,7 +116,6 @@ namespace snmalloc
{
using StorageType = T;
using DataRef = T&;
using ConstDataRef = const T&;

static size_t required_count(size_t max_count)
{
Expand Down
2 changes: 1 addition & 1 deletion src/snmalloc/global/libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ namespace snmalloc::libc
return ThreadAlloc::get().get_client_meta_data(p);
}

inline typename snmalloc::Alloc::Config::ClientMeta::ConstDataRef
inline std::add_const_t<typename snmalloc::Alloc::Config::ClientMeta::DataRef>
get_client_meta_data_const(void* p)
{
return ThreadAlloc::get().get_client_meta_data_const(p);
Expand Down
2 changes: 1 addition & 1 deletion src/snmalloc/mem/localalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ namespace snmalloc
* @brief Get the client meta data for the snmalloc allocation covering this
* pointer.
*/
typename Config::ClientMeta::ConstDataRef
std::add_const_t<typename Config::ClientMeta::DataRef>
get_client_meta_data_const(void* p)
{
const PagemapEntry& entry =
Expand Down

0 comments on commit 6c90e21

Please sign in to comment.