add android support (#171)

* adjust for android

* update docs

* add const qualifier to `alloc_size`

* check const qualifier in cmake
This commit is contained in:
SchrodingerZhu
2020-04-18 14:58:13 +08:00
committed by GitHub
parent 0f5cc165e8
commit a43773c5b7
8 changed files with 43 additions and 10 deletions

View File

@@ -39,9 +39,10 @@ namespace snmalloc
return OS_PAGE_SIZE;
}
static Mediumslab* get(void* p)
static Mediumslab* get(const void* p)
{
return pointer_align_down<SUPERSLAB_SIZE, Mediumslab>(p);
return pointer_align_down<SUPERSLAB_SIZE, Mediumslab>(
const_cast<void*>(p));
}
void init(RemoteAllocator* alloc, sizeclass_t sc, size_t rsize)