|
Boost Users : |
From: Shriram V (shriram_vishwanathan_at_[hidden])
Date: 2005-08-05 14:09:39
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 <boost/pool/simple_segregated_storage.hpp>
#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); //$B"+(B Floating point exception here.
cout << T.malloc() << endl;
return 0;
}
</snip>
simple_segregated_storage.hpp:194
=================================
<snip>
char * old = static_cast<char *>(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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net