Hello, I have some questions about Pool Allocation Is it possible for a program to access and manipulate an (automatically allocated) pool at run time? For example, if a program wants to dump all the allocated pools that is using, is it possible to enumerate all those pools and access them (contents and information about the pool) and then dump all this information to a file? Also, please correct me if I am wrong. I understand that if in a program there are two disjoint data structures and this data structure has 4 different kinds of nodes (heterogeneous nodes), the runtime system is going to create 8 different pools? : 2 disjoint "instances" (e.g., two complete trees) of the same data structure * 4 kinds of nodes = 8 different pools At runtime, Can I identify all the pools that belong to a specific instance of any of the data structures and then dump only the pools that belong to that specific instance? Thanks --------------------------------- Do you Yahoo!? Yahoo! Search presents - Jib Jab's 'Second Term' -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050221/a55bee4d/attachment.html>
On Mon, 21 Feb 2005, xavier wrote:> Hello, > > I have some questions about Pool Allocation > > Is it possible for a program to access and manipulate an (automatically > allocated) pool at run time? For example, if a program wants to dump all > the allocated pools that is using, is it possible to enumerate all those > pools and access them (contents and information about the pool) and then > dump all this information to a file?Yes, but not in any simple way. You basically have to hack the pool runtime to do the stuff you want. If you look at the actual runtime we use by default (llvm-poolalloc/runtime/FL2Allocator/), you can see there are various #defines you can enable for debugging in the .cpp file: #ifndef NDEBUG // Configuration macros. Define up to one of these. //#define PRINT_NUM_POOLS // Print use dynamic # pools info //#define PRINT_POOLDESTROY_STATS // When pools are destroyed, print stats #define PRINT_POOL_TRACE // Print a full trace #endif> Also, please correct me if I am wrong. I understand that if in a program > there are two disjoint data structures and this data structure has 4 > different kinds of nodes (heterogeneous nodes), the runtime system is > going to create 8 different pools? : 2 disjoint "instances" (e.g., two > complete trees) of the same data structure * 4 kinds of nodes = 8 > different pools.Yes, that's the idea. Up to the limit of what the pointer analysis (which tends to be very good) can prove though.> At runtime, Can I identify all the pools that belong to a specific > instance of any of the data structures and then dump only the pools that > belong to that specific instance?Today, not really. However, it would be straight-forward to add ID numbers to the pool creation sites and record the info in the pool descriptor. What are you goals with pool allocation btw? -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
Hello, Thanks for your answer> What are you goals with pool allocation btw?At this moment I have some fuzzy ideas, but I am trying to clarify some things so that I can have something more concrete. Thanks Chris Lattner <sabre at nondot.org> wrote: On Mon, 21 Feb 2005, xavier wrote:> Hello, > > I have some questions about Pool Allocation > > Is it possible for a program to access and manipulate an (automatically > allocated) pool at run time? For example, if a program wants to dump all > the allocated pools that is using, is it possible to enumerate all those > pools and access them (contents and information about the pool) and then > dump all this information to a file?Yes, but not in any simple way. You basically have to hack the pool runtime to do the stuff you want. If you look at the actual runtime we use by default (llvm-poolalloc/runtime/FL2Allocator/), you can see there are various #defines you can enable for debugging in the .cpp file: #ifndef NDEBUG // Configuration macros. Define up to one of these. //#define PRINT_NUM_POOLS // Print use dynamic # pools info //#define PRINT_POOLDESTROY_STATS // When pools are destroyed, print stats #define PRINT_POOL_TRACE // Print a full trace #endif> Also, please correct me if I am wrong. I understand that if in a program > there are two disjoint data structures and this data structure has 4 > different kinds of nodes (heterogeneous nodes), the runtime system is > going to create 8 different pools? : 2 disjoint "instances" (e.g., two > complete trees) of the same data structure * 4 kinds of nodes = 8 > different pools.Yes, that's the idea. Up to the limit of what the pointer analysis (which tends to be very good) can prove though.> At runtime, Can I identify all the pools that belong to a specific > instance of any of the data structures and then dump only the pools that > belong to that specific instance?Today, not really. However, it would be straight-forward to add ID numbers to the pool creation sites and record the info in the pool descriptor. What are you goals with pool allocation btw? -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/ _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev --------------------------------- Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. Learn more. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050224/d5f67c06/attachment.html>