##// END OF EJS Templates
manifest: fix possible SEGV caused by uninitialized lazymanifest fields...
manifest: fix possible SEGV caused by uninitialized lazymanifest fields Before, uninitialized self->pydata would be passed to lazymanifest_dealloc() on OOM, and Py_DECREF(self->pydata) would crash if we were unlucky. It's still wrong to do malloc() thingy in tp_init because __init__() may be called more than once [1], but I don't want to go a step further in stable branch. [1]: https://docs.python.org/2/c-api/typeobj.html#c.PyTypeObject.tp_new "The tp_new function should ... do only as much further initialization as is absolutely necessary. Initialization that can safely be ignored or repeated should be placed in the tp_init handler."

File last commit:

r34653:174d115d default
r38346:ae7f2786 stable
Show More
bdiff.h
23 lines | 467 B | text/x-c | CLexer
#ifndef _HG_BDIFF_H_
#define _HG_BDIFF_H_
#include "compat.h"
struct bdiff_line {
int hash, n, e;
ssize_t len;
const char *l;
};
struct bdiff_hunk;
struct bdiff_hunk {
int a1, a2, b1, b2;
struct bdiff_hunk *next;
};
int bdiff_splitlines(const char *a, ssize_t len, struct bdiff_line **lr);
int bdiff_diff(struct bdiff_line *a, int an, struct bdiff_line *b, int bn,
struct bdiff_hunk *base);
void bdiff_freehunks(struct bdiff_hunk *l);
#endif