It appears that some code to handle the LGLSXP case has already been written in mmap.c in the mmap_extract() and mmap_replace() functions. The LGLSXP subcase appears to be missing in the data.frame case, however. in both functions.
To start, only implement as.mmap.logical() for the C_logi8 mode rather than the C_bits mode because figuring out how to encode NA in the C_bits mode requires a bit more creativity. With C_logi8, we can simply encode FALSE as 0, TRUE as 1, and NA as 255.
It appears that some code to handle the
LGLSXP
case has already been written inmmap.c
in themmap_extract()
andmmap_replace()
functions. TheLGLSXP
subcase appears to be missing in thedata.frame
case, however. in both functions.To start, only implement
as.mmap.logical()
for theC_logi8
mode rather than theC_bits
mode because figuring out how to encodeNA
in theC_bits
mode requires a bit more creativity. WithC_logi8
, we can simply encodeFALSE
as0
,TRUE
as1
, andNA
as255
.