मैंने एक vc7.1 प्रोजेक्ट को बनाम 2010 में परिवर्तित करने की कोशिश की जिसे मुझे कोडप्रोजेक्ट से मिला। (और यहां लिंक एचटीटी पी: //www.codeproject.com/KB/cpp/transactions.aspx है? Fid = 11253 & df = 90 & एमपीपी = 50 & शोर = 3 & प्रकार = स्थिति & दृश्य = विस्तारित & fr = 1 # xx0xxक्या प्लेसमेंट पॉइंटर शून्य होने पर प्लेसमेंट नए कन्स्ट्रक्टर को कॉल करता है?
लेकिन परिवर्तित और इसके विन्यास संशोधित करने के बाद।
मुझे लगता है यह असफल डिबग, यह क्रिया के अपवाद कहते हैं DrawIt.exe में 0x0028e7b9: 0xC0000005: उल्लंघन उल्लंघन स्थान 0x00000000 का उपयोग करें।
त्रुटि पंक्ति इस
data = new(Mm::Allocate(sizeof(DocData), sid)) DocData();
और समारोह
void* Allocate(size_t size, SPACEID sid)
{
AUDIT
Spaces::iterator s = spaces.find(sid);
if (s == spaces.end())
return NULL;
Space& space = s->second;
if (!space.transacting)
return NULL;
size = max(size, sizeof(Free));
// TODO: assert that "data" is allocated in space
space.AssertData();
// are there any more free chunks?
if (!space.data->sFreeHead) {
space.data->Insert(space.More(size));
}
AUDIT
// find the first chunk at least the size requested
Free* prev = 0;
Free* f = space.data->sFreeHead;
while (f && (f->size < size)) {
prev = f;
f = f->next;
}
AUDIT
// if we found one, disconnect it
if (f) {
space.data->locTree.remove((size_t)f);
if (prev) prev->next = f->next;
else space.data->sFreeHead = f->next;
f->next = 0;
memset(&f->loc, 0, sizeof(f->loc));
} else {
f = space.More(size);
}
// f is disconnected from the free list at this point
AUDIT
// if the free chunk is too(?) big, carve a peice off and return
// the rest to the free list
if (f->size > (2*(size + sizeof(Free)))) {
Free* tmp = space.data->Slice(f, size); // slice size byte off 'f'
space.data->Insert(f); // return the remainder to the free list
f = tmp;
}
AUDIT
CHECK_POINTER(f)
void* p = reinterpret_cast<void*>((char*)f + sizeof(Free::SIZE_TYPE));
CHECK_POINTER(p)
return p;
}
किसी को भी, विचार आया plz की तरह चला जाता है?
चूंकि मैं सी ++ में अच्छा नहीं हूं, इस समस्या को हल करने के बारे में मुझे पता लगाने में कुछ समय लगेगा। बस स्रोत कोड source file अपलोड किया गया है, अगर कोई मदद कर सकता है तो इसकी सराहना की जाएगी।
यह वास्तव में एक अच्छा सवाल है जिसे छोटे शब्दों में बहाल किया जा सकता है: * प्लेसमेंट पॉइंटर शून्य होने पर नया कन्स्ट्रक्टर कॉल करता है? * –