| | |
deallocate allocated memory
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jul 2009
Posts: 57
Reputation:
Solved Threads: 0
Hi,
I'm trying to implement my own allocator using malloc and free. One thing what interests me is that in declaration of deallocate in addition to pointer we have also parameter size which suppose to be size of elements allocated with allocate but having implemented my deallocate as this:
I have no idea for what I should use this (size_type) parameter.
Looking forward to your reply.
Thank you.
I'm trying to implement my own allocator using malloc and free. One thing what interests me is that in declaration of deallocate in addition to pointer we have also parameter size which suppose to be size of elements allocated with allocate but having implemented my deallocate as this:
c++ Syntax (Toggle Plain Text)
template<typename T> void Allocator<T>::deallocate(pointer p, size_type n) { free(p); }
Looking forward to your reply.
Thank you.
•
•
•
•
I have no idea for what I should use this (size_type) parameter.
-Tommy (For Great Justice!) Gunn
![]() |
Similar Threads
- Memory Leak While using ACE_Thread (C++)
- 2D Vector Memory Problems (C++)
- Dynamically Allocated 2D Matrix Memory Issues (C++)
- Better way of allocating a memory( auto_ptr vs new vs malloc) (C++)
- Problem with my Memory Tracker (C++)
- Memory management - Advice please (C++)
- ACE: Sharing Dynamically Allocated Memory Across Threads (C++)
- still available even after freeing dynamic allocated memory (C)
Other Threads in the C++ Forum
- Previous Thread: [Boost] Installing Separately Compiled Libraries
- Next Thread: Dynamic Memory allocation
Views: 644 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for memory
3g 30-nm age amd apple array assign avatar bandwidth beginner black bluegene cache chips cpu database ddr3 delete desktop development disk dos dynamic economy energy enterprise firefox flash gecko gigabyte hard hardware hp ibm ibm.news ifstream industry intel intelibm iphone leak linux load medicine memory microsd microsoft monitor mozilla multi-core multidimensional mysql nand news objects openoffice opensource pc pcm processor ps3 ram rdimm recession recourse redhat reference return russia server speed ssd storage string sun supercomputer supercomputing technology trends ubuntu upgrade usb vb.net working x86






