Open froydnj opened 6 years ago
Good point. I originally had this as std::map
. However, I changed this to the above as when using this library in Firefox, including the map
header caused compilation issues. Therefore I wanted the ability to use the API without the map header
In this use case, since we don't have a map (aka the function pointer cache) we performed symbol resolution manually prior to call and then used sandbox_invoke_with_fnptr
instead of sandbox_invoke
. Thus getFunctionPointerFromCache is never invoked, and no code with std::map exists in the binary.
Note, that this the code has since evolved significantly and I'm not sure if the limitations that originally required this change still apply... So, its worth investigating if I can just change this back
The sandbox member variable
fnPointerMap
is declared asvoid*
, yet is only even used asstd::map<...> *
. Why is the casting necessary? Shouldn't the member variable just bestd::map<...>*
?https://github.com/shravanrn/rlbox_api/blob/master/rlbox.h#L1118-L1139