Quuxplusone planned changes to this revision.
Quuxplusone added inline comments.


================
Comment at: src/experimental/memory_resource.cpp:240
+    bool allocation_contains(const char *p) const {
+        // TODO: This part technically relies on undefined behavior.
+        return allocation <= p && p < ((char*)allocation + bytes);
----------------
I now see how to avoid doing this: instead of keeping a separate free-list per 
each chunk, I should keep one big free-list per pool, where blocks from all 
chunks in the same pool are mixed together. This is okay because we never 
deallocate one chunk unless we're deallocating *all* chunks.
I'll rework the patch to eliminate this undefined behavior and keep a free-list 
per pool.


Repository:
  rCXX libc++

https://reviews.llvm.org/D47358



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to