I have just downloaded the allocator (congratulations for such a good and needed product) and started to try it out and I come with a few questions (I read all the doc I found, notably the Marc Ronell paper....)
I run a pooled_allocator::Multi_Process_Pool_alloc test (from the above paper) that does simply create a vector and push_back elements and I find the following issues:
- I cannot use the shutdown() method because I get a compiler error (I list it below)
- If I run it several times I see the that the vector contains the elements from previous invocations. is there a way to destroy the memory?
I also wanted to ask if there is a way of specifying how much memory to allocate (isn't it the key_addr paramter, is it?), sizes for chunks (and what to use for variable size, like for strings...) and if there is a way to see how much free/allocated memory we have.
I tried with gcc 3.2 and 3.3.1 (2.9.6 did not even compile the allocator) without stlport in redhat 7.1, 7.2 and 8.
the compiler error mentioned above:
../include/pooled_allocator.h: In member function `void
pooled_allocator::Pool<T, alloc_key, alloc_addr>::shutdown() [with T = int,
const char*alloc_key = (&key_val), const char*alloc_addr = (&key_addr)]':
../include/pooled_allocator.h:1577: instantiated from `void pooled_allocator::Multi_Process_Pool_alloc<Container, Object, alloc_key, container_key, alloc_addr>::shutdown() [with Container = main(int, char**)::my_vector_t, Object = int, const char*alloc_key = (&key_val), const char*container_key = (&key_container), const char*alloc_addr = (&key_addr)]'
vec.cpp:41: instantiated from here
../include/pooled_allocator.h:262: error: no matching function for call to `
mem_space::shared<(&key_val), (&key_addr)>::free(const int&, const int&)'
../include/shared_memory.h:1070: error: candidates are: bool
mem_space::shared<alloc_key, alloc_addr>::free() [with const char*alloc_key
= (&key_val), const char*alloc_addr = (&key_addr)]
Thanks for any help,
Javier.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It would be best to upgrade to Redhat 9. That version uses the needed version of glibc. The default build environment of Redhat 9 should allow you to compile without errors,
Marc
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I also run in the problem through using gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
*../include/pooled_allocator.h:262: error: no *matching function for call to `
*>mem_space::shared<(&key_val), (&key_addr)*>::free(const int&, const int&)'
*>../include/shared_memory.h:1070:
Tracing the source code in shared_memory and it seems true that no free() for call but free(const int&, const int&).
what I miss to shut the problem?
and How to solve it?
TKS
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
I have just downloaded the allocator (congratulations for such a good and needed product) and started to try it out and I come with a few questions (I read all the doc I found, notably the Marc Ronell paper....)
I run a pooled_allocator::Multi_Process_Pool_alloc test (from the above paper) that does simply create a vector and push_back elements and I find the following issues:
- I cannot use the shutdown() method because I get a compiler error (I list it below)
- If I run it several times I see the that the vector contains the elements from previous invocations. is there a way to destroy the memory?
I also wanted to ask if there is a way of specifying how much memory to allocate (isn't it the key_addr paramter, is it?), sizes for chunks (and what to use for variable size, like for strings...) and if there is a way to see how much free/allocated memory we have.
I tried with gcc 3.2 and 3.3.1 (2.9.6 did not even compile the allocator) without stlport in redhat 7.1, 7.2 and 8.
the compiler error mentioned above:
../include/pooled_allocator.h: In member function `void
pooled_allocator::Pool<T, alloc_key, alloc_addr>::shutdown() [with T = int,
const char*alloc_key = (&key_val), const char*alloc_addr = (&key_addr)]':
../include/pooled_allocator.h:1577: instantiated from `void pooled_allocator::Multi_Process_Pool_alloc<Container, Object, alloc_key, container_key, alloc_addr>::shutdown() [with Container = main(int, char**)::my_vector_t, Object = int, const char*alloc_key = (&key_val), const char*container_key = (&key_container), const char*alloc_addr = (&key_addr)]'
vec.cpp:41: instantiated from here
../include/pooled_allocator.h:262: error: no matching function for call to `
mem_space::shared<(&key_val), (&key_addr)>::free(const int&, const int&)'
../include/shared_memory.h:1070: error: candidates are: bool
mem_space::shared<alloc_key, alloc_addr>::free() [with const char*alloc_key
= (&key_val), const char*alloc_addr = (&key_addr)]
Thanks for any help,
Javier.
It would be best to upgrade to Redhat 9. That version uses the needed version of glibc. The default build environment of Redhat 9 should allow you to compile without errors,
Marc
I also run in the problem through using gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
*../include/pooled_allocator.h:262: error: no *matching function for call to `
*>mem_space::shared<(&key_val), (&key_addr)*>::free(const int&, const int&)'
*>../include/shared_memory.h:1070:
Tracing the source code in shared_memory and it seems true that no free() for call but free(const int&, const int&).
what I miss to shut the problem?
and How to solve it?
TKS
So you are using allocator version 1.07 from the web site with a fully installed RedHat version 9.0 ix86 system? It should work with this setup.
If you unpack the allocator, what happens when you cd to the test directory and type make? How do the tests perform? What is their output?
Marc