Comments (1)
Sure, you can use rpfree for a block from a first class heap, but you must still make sure that only one thread calls it at any given time (the thread ownership test in the free path will just let any thread directly free from a first class heap) - so for a first class heap rpfree will NOT be thread safe.
The other option would be to promote the heap to be the current heap for a thread by using rpmalloc_heap_thread_set_current
in which case it will be assigned to the caller thread and now thread safe. Note that you cannot 'unassign' a heap from a thread in this case.
The main use case for a first class heap is when you have a known lifetime of the heap and can do a single call to rpmalloc_heap_free_all
to release all memory used in the heap.
from rpmalloc.
Related Issues (20)
- Some usage annoyances while compiling & using rpmalloc on Sony's consoles HOT 1
- Question about case in _rpmalloc_span_double_link_list_remove HOT 3
- Add packages to vcpkg? HOT 1
- build failed with msvs 2022 HOT 4
- Compilation fails on latest Alpine Linux HOT 1
- Potential bug: get_thread_id / rpmalloc_heap_thread_set_current HOT 10
- Warnings: "... specifies less restrictive attributes than its target" HOT 4
- Segmentation fault when building with ENABLE_OVERRIDE=1 and linking it statically HOT 15
- Segmentation fault when revising parameters(span_size and span_map_count) HOT 1
- undefined `false` when compiling HOT 1
- Linking error: unresolved external symbol _rpmalloc_module_init HOT 5
- `SIGABRT` when building w/ `-DENABLE_ASSERTS=1 -DENABLE_OVERRIDE=1 -DENABLE_PRELOAD=1` HOT 1
- Memory usage seems large compared with alternatives and is unaffected by cache settings. HOT 7
- Segmentation fault with the rewrite branch in certain benchmarks HOT 5
- enable_unlimited_thread_cache HOT 1
- Build fails using clang-16 HOT 3
- rpmalloc_heap_free_all has some bug HOT 3
- rpmalloc and msvc asan HOT 4
- Add version information
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 rpmalloc.