|
From: Nitin S. <nit...@pa...> - 2006-06-29 13:12:17
|
Hi,
I am new for using small object allocator.I have read about its four layers
in the Modern C++ Design book.
Can any body give me a small example to demonstrate small objects in Visual
C++.
Here is what I wrote but I am getting error LNK2001(some linkage
error).Kindly reply soon.
#include <stdlib.h>
#include <iostream.h>
#include "SmallObj.h"
#include <cstddef>
#include <cstdlib>
#include <stdexcept>
#include "Threads.h"
using namespace Loki;
class user:public
Loki::SmallObject<Loki::SingleThreaded,DEFAULT_CHUNK_SIZE,MAX_SMALL_OBJECT_S
IZE>
{
public:
int m;
user()
{
m=10;
}
};
int main()
{
user obj = new user;
cout << obj.m;
return 0;
}
Regards,
Nitin Soman
http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________
This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to
whom this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at net...@pa... and delete this mail.
_____________________________________________________________________
|