Hi,
I am trying to use simple_segregated_storage<>, but I am getting "Floating
point exception" in simple_segregated_storage.hpp:194
This is the code that I used. Am I going wrong anywhere? Is it necessary to
upgrade to 1_32? Or is it some thing else?
Code:
=====
<snip>
#include <cstdlib>
#include
#include <iostream>
int main()
{
using namespace std;
std::size_t size = 10 * 1024;
void* ptr = malloc(size);
// cout << ptr << endl;
boost::simple_segregated_storage<char> T;
T.add_ordered_block(ptr, size, 1024); //← Floating point exception here.
cout << T.malloc() << endl;
return 0;
}
</snip>
simple_segregated_storage.hpp:194
=================================
<snip>
char * old = static_cast(block)
</snip>
This code was compiled as:
==========================
g++ --version:
(GCC) 3.3.2
g++ -Wall -Werror -g3 -pedantic -I/home/include/boost-1_31 -o smem.o -c
smem.cpp
g++ -o smem smem.o
Boost:
======
Version: 1_31
Please guide.
Regards,
-Shriram