Comments (4)
I mean, yes, it fails. This is because the initial block size is simply too small for the block size. You asked for 27 buckets with huge node sizes, and give it a block size that's too small to contain their initial memory. I'm not sure what its supposed to do in that case?
As an aside, as soon as you're talking about nodes in the size of a couple of KiB, the default new/malloc implementation is probably better suited for allocation than the use of a free list.
from memory.
Being new to this library and from looking at the documentation, it's not obvious to me that (1) all buckets are allocated eagerly instead of on-demand, and in particular (2) that they need to fit into a single block.
Given that I triggered some assertion five levels deep into the library, I assumed this to be a bug. Not to be overbearing in requesting features from an open source project -- but since you asked: If this is intended behavior, I would prefer it to tell me during construction of the collection.
As an aside, as soon as you're talking about nodes in the size of a couple of KiB, the default new/malloc implementation is probably better suited for allocation than the use of a free list.
Good to know, thanks. In my case I'm using pinned memory, which is extremely slow to allocate, so I'm actually gaining performance even for large (~10 MiB) nodes. I ended up using a simple pool though, instead of the collection.
from memory.
Being new to this library and from looking at the documentation, it's not obvious to me that (1) all buckets are allocated eagerly instead of on-demand, and in particular (2) that they need to fit into a single block.
This isn't the case. By default, the initial block size is partitioned into equally sized chunks for all free lists, which is lazily committed.
If this is intended behavior, I would prefer it to tell me during construction of the collection.
Good point. I have added a check in the constructor in 9d3bda1.
from memory.
Nice - thanks!
from memory.
Related Issues (20)
- [docs/examples] associative containers HOT 4
- memory_block_stack::owns() seems wrong? HOT 1
- Time for a new release? HOT 1
- problem with std::is_abstract for unique_ptr with allocator inside struct definition HOT 1
- give allocator_polymorphic_deleter a default constructor HOT 1
- Thread safety
- Build issues on MacOS while building tools with static flag HOT 3
- MinGW build fails due to "#warning" HOT 1
- Can a vector use a memory pool with a small_node_pool ?
- Unable to determine node size of C++ container HOT 4
- ARM64 crash when using static block allocator with small types HOT 2
- memory_pool_collection fails to allocate memory HOT 4
- Test fails on Android arm64-v8a
- memory pool allocate
- Wrap a memory_pool in a thread_safe_allocator? HOT 1
- Calling pure virtual function. HOT 1
- Page (4KiB) alignment for memory pool
- a new release/tag ?
- compiler error ( from warning) when compiled with FOONATHAN_MEMORY_DEBUG_ASSERT and FOONATHAN_MEMORY_ASSERT not defined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memory.