-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
None
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
In the current implementation, native memory segments are allocated using malloc. If the required alignment exceeds that provided by malloc (8 or 16 on 64-bit machines), a new segment is created with the address (allocated ptr + offset), which cannot be freed via std::free or similar functions
In C++, things get even worse if the structures are very overaligned. A variant of the new operator is called, which takes the size of memory block and the required alignment, and returns a pointer that can only be cleared through the delete operator, which also takes alignment.
At the moment, there is no way to allocate on the java side such highly aligned segments that can be deleted on the native side.
In the current implementation, native memory segments are allocated using malloc. If the required alignment exceeds that provided by malloc (8 or 16 on 64-bit machines), a new segment is created with the address (allocated ptr + offset), which cannot be freed via std::free or similar functions
In C++, things get even worse if the structures are very overaligned. A variant of the new operator is called, which takes the size of memory block and the required alignment, and returns a pointer that can only be cleared through the delete operator, which also takes alignment.
At the moment, there is no way to allocate on the java side such highly aligned segments that can be deleted on the native side.